diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..09bc62c1393 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..fd6068d9b1d --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/target/ +/.classpath +/.project +/.settings/ +/.checkstyle +/test.properties diff --git a/README.md b/README.md new file mode 100644 index 00000000000..1551916962c --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# HtmlUnit + +HtmlUnit is a "GUI-Less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser. + +It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating Chrome, Firefox or Internet Explorer depending on the configuration used. + +It is typically used for testing purposes or to retrieve information from web sites. + +### Project News +[HtmlUnit@Twitter][3] + +### Latest release Version 2.36.0 / August 24, 2019 +[Download from Sourceforge][1] + +For maven, you would add: + + + net.sourceforge.htmlunit + htmlunit + 2.36.0 + + +[Latest CI build][2] + +## Features +* Support for the HTTP and HTTPS protocols +* Support for cookies +* Ability to specify whether failing responses from the server should throw exceptions or should be returned as pages of the appropriate type (based on content type) +* Support for submit methods POST and GET (as well as HEAD, DELETE, ...) +* Ability to customize the request headers being sent to the server +* Support for HTML responses + * Wrapper for HTML pages that provides easy access to all information contained inside them + * Support for submitting forms + * Support for clicking links + * Support for walking the DOM model of the HTML document +* Proxy server support +* Support for basic and NTLM authentication +* Excellent JavaScript support (see the JavaScript section below) + + + +## License + +This project is licensed under the Apache 2.0 License + + +[1]: https://sourceforge.net/projects/htmlunit/files/htmlunit/2.36.0/ "HtmlUnit on sourceforge" +[2]: http://167.86.92.69/job/HtmlUnit/ "HtmlUnit CI" +[3]: https://twitter.com/HtmlUnit "https://twitter.com/HtmlUnit" diff --git a/checkstyle.xml b/checkstyle.xml index f9c78fdf4a6..4e5fefc3239 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -1,4 +1,3 @@ - @@ -25,13 +24,17 @@ - + + + + + @@ -120,10 +123,6 @@ - - - - @@ -132,8 +131,6 @@ - - @@ -220,11 +217,16 @@ + + + + + diff --git a/checkstyle_suppressions.xml b/checkstyle_suppressions.xml index b91ea9e2997..99b357b75bc 100644 --- a/checkstyle_suppressions.xml +++ b/checkstyle_suppressions.xml @@ -25,7 +25,7 @@ - + @@ -49,18 +49,7 @@ - - - - - - - - - - - - + @@ -73,4 +62,6 @@ + + diff --git a/debug.log b/debug.log new file mode 100644 index 00000000000..5220278e0f3 --- /dev/null +++ b/debug.log @@ -0,0 +1 @@ +[0202/184406.220:ERROR:file_io.cc(134)] WriteFile: Die Pipe wird gerade geschlossen. (0xE8) diff --git a/pmd-ruleset.xml b/pmd-ruleset.xml new file mode 100644 index 00000000000..b224cd88b24 --- /dev/null +++ b/pmd-ruleset.xml @@ -0,0 +1,61 @@ + + + + + HtmlUnit rules + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index c8f19b22715..bb5bd43f487 100644 --- a/pom.xml +++ b/pom.xml @@ -4,24 +4,40 @@ 4.0.0 net.sourceforge.htmlunit htmlunit - 2.31 + 2.37.0 HtmlUnit Gargoyle Software Inc. http://www.GargoyleSoftware.com/ jar - A headless browser intended for use in testing web-based applications. + + A headless browser intended for use in testing web-based applications. + http://htmlunit.sourceforge.net UTF-8 yyyy-MM-dd HH:mm -Xdoclint:none + + 8 + 8 + + 2.37.0 + 1.5.0 + 2.37.0 + 2.37.0 + + 4.5.11 + 9.4.26.v20200117 + 2.13.0 + 1.7.30 + 3.141.59 + - 8.10 - 9.4.10.v20180503 - 3.12.0 - 2.30.1 + 8.29 + 3.1.12 + 6.21.0 @@ -29,11 +45,8 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + 3.8.1 - - 1.8 - 1.8 **/CodeChecker.java @@ -42,13 +55,11 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.0.0 + 3.1.0 checkstyle.xml checkstyle_suppressions.xml true - true - true @@ -58,10 +69,48 @@ + + com.github.spotbugs + spotbugs-maven-plugin + 3.1.12.2 + + + + com.github.spotbugs + spotbugs + ${spotbugs.version} + + + + spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.12.0 + + + net.sourceforge.pmd + pmd-core + ${pmd.version} + + + net.sourceforge.pmd + pmd-java + ${pmd.version} + + + + + ${basedir}/pmd-ruleset.xml + + + org.apache.maven.plugins maven-jar-plugin - 3.1.0 + 3.2.0 @@ -86,12 +135,12 @@ org.apache.maven.plugins maven-site-plugin - 3.7.1 + 3.8.2 org.apache.maven.plugins maven-assembly-plugin - 3.1.0 + 3.2.0 make-assembly @@ -113,7 +162,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 + 3.2.1 @@ -125,9 +174,16 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.0 + 3.1.1 + true --allow-script-in-comments + + http://docs.oracle.com/javase/8/docs/api/ + http://commons.apache.org/logging/apidocs/ + http://commons.apache.org/codec/apidocs/ + http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/ + @@ -193,8 +249,8 @@ + - ]]> @@ -213,7 +269,7 @@ org.apache.maven.plugins maven-scm-plugin - 1.9.5 + 1.11.2 ${project.name}-${project.version} Release ${project.version} @@ -222,7 +278,7 @@ org.apache.felix maven-bundle-plugin - 3.5.0 + 4.2.1 true @@ -236,7 +292,7 @@ org.simplify4u.plugins pgpverify-maven-plugin - 1.2.0 + 1.6.0 @@ -250,27 +306,32 @@ org.apache.maven.wagon wagon-ssh - 3.0.0 + 3.3.4 - without-huge-tests + without-library-and-huge-tests - true + + withoutLibsHuge + org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 2.22.2 + + false + **/libraries/*.java **/huge/*.java - -Xms256m -Xmx1024m + -Xms128m -Xmx512m -Dsun.reflect.noInflation=true maven @@ -280,10 +341,10 @@ - without-library-and-huge-tests + only-library-tests - withoutLibsHuge + onlyLibs @@ -291,13 +352,17 @@ org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 2.22.2 + + false + + **/libraries/*.java + - **/libraries/*.java - **/huge/*.java + **/libraries/JQuery3x3x1Test.java - -Xms128m -Xmx512m -Dsun.reflect.noInflation=true + -Xms128m -Xmx512m maven @@ -307,10 +372,10 @@ - only-library-tests + jquery3-tests - onlyLibs + onlyjquery3 @@ -318,10 +383,12 @@ org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 2.22.2 + + false - **/libraries/*.java + **/libraries/JQuery3x3x1Test.java -Xms128m -Xmx512m @@ -333,10 +400,97 @@ - only-huge-tests + only-huge-tests-closes + + + onlyHugeCloses + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/ElementClosesElementTest.java + + -Xms256m -Xmx512m + + maven + + + + + + + + only-huge-tests-a-c + + + onlyHugeAC + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/HostParentOfATest.java + **/huge/HostParentOfBTest.java + **/huge/HostParentOfCTest.java + + -Xms512m -Xmx1024m + + maven + + + + + + + + only-huge-tests-d-g + + + onlyHugeDG + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/HostParentOfDTest.java + **/huge/HostParentOfFTest.java + + -Xms512m -Xmx1024m + + maven + + + + + + + + only-huge-tests-h-l - onlyHuge + onlyHugeHL @@ -344,12 +498,15 @@ org.apache.maven.plugins maven-surefire-plugin - 2.21.0 + 2.22.2 + + false - **/huge/*.java + **/huge/HostParentOfHTest.java + **/huge/HostParentOfITest.java - -Xms1024m -Xmx2048m + -Xms512m -Xmx1024m maven @@ -359,12 +516,118 @@ - htmlunit3 + only-huge-tests-m-o - hu3 + onlyHugeMO + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/HostParentOfMTest.java + **/huge/HostParentOfNTest.java + + -Xms512m -Xmx1024m + + maven + + + + + + + + only-huge-tests-p-r + + + onlyHugePR + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/HostParentOfPTest.java + + -Xms512m -Xmx1024m + + maven + + + + + + + + only-huge-tests-s + + + onlyHugeS + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/HostParentOfSTest.java + + -Xms512m -Xmx1024m + + maven + + + + + + + + only-huge-tests-t-z + + + onlyHugeTZ + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + false + + **/huge/HostParentOfTTest.java + **/huge/HostParentOfWTest.java + + -Xms512m -Xmx1024m + + maven + + + + + @@ -372,8 +635,9 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.0.0 + 3.1.1 + true com.gargoylesoftware.htmlunit.javascript:com.gargoylesoftware.htmlunit.protocol:com.gargoylesoftware.htmlunit.ssl:com.gargoylesoftware.htmlunit.html.xpath:com.gargoylesoftware.htmlunit.html.applets:com.gargoylesoftware.htmlunit.html.impl:com.gargoylesoftware.htmlunit.activex --allow-script-in-comments @@ -387,20 +651,12 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 2.9 + 3.0.0 org.apache.maven.plugins maven-jxr-plugin - 2.5 - - - org.apache.maven.plugins - maven-pmd-plugin - 3.9.0 - - 1.8 - + 3.0.0 org.apache.maven.plugins @@ -429,8 +685,8 @@ - SourceForge2 - http://sourceforge.net/p/htmlunit/bugs/ + GitHub + https://github.com/HtmlUnit/htmlunit/issues 2002 @@ -441,13 +697,13 @@ - scm:svn:https://svn.code.sf.net/p/htmlunit/code/trunk/htmlunit - scm:svn:https://svn.code.sf.net/p/htmlunit/code/trunk/htmlunit - https://sourceforge.net/p/htmlunit/code + scm:git:https://github.com/HtmlUnit/htmlunit + scm:git:https://github.com/HtmlUnit/htmlunit + https://github.com/HtmlUnit/htmlunit - TeamCity - https://ci.canoo.com/teamcity/viewLog.html?buildTypeId=Htmlunit_CheckInBuild&buildId=lastSuccessful&tab=artifacts + Jenkins + http://167.86.92.69/job/HtmlUnit/ @@ -817,6 +1073,12 @@ Hartmut Arlt + + Le Stephane + + + Michael Anstis + @@ -837,49 +1099,45 @@ org.apache.commons commons-lang3 - 3.7 + 3.9 org.apache.commons commons-text - 1.3 + 1.8 + + + org.apache.commons + commons-lang3 + + org.apache.httpcomponents httpmime - 4.5.5 + ${httpcomponents.version} org.apache.httpcomponents httpclient - 4.5.5 + ${httpcomponents.version} test-jar test - - - commons-codec - commons-codec - - - org.apache.httpcomponents - httpcore - - net.sourceforge.htmlunit htmlunit-core-js - 2.31 + ${htmlunitcorejs.version} net.sourceforge.htmlunit neko-htmlunit - 2.31 + ${htmlunitneko.version} net.sourceforge.htmlunit htmlunit-cssparser - 1.0.0 + ${htmlunitcssparser.version} commons-io @@ -896,6 +1154,11 @@ commons-net 3.6 + + org.brotli + dec + 0.1.2 + org.eclipse.jetty.websocket @@ -906,46 +1169,78 @@ junit junit - 4.12 + 4.13 test org.easymock easymock - 3.6 - test - - - org.apache.logging.log4j - log4j-api - 2.11.0 + 4.1 test - commons-fileupload - commons-fileupload - 1.3.3 - test + com.tngtech.archunit + archunit-junit4 + 0.13.0 - commons-io - commons-io + org.slf4j + slf4j-api + + + junit + junit + test - + org.slf4j slf4j-api - 1.7.25 + ${slf4j.version} test org.slf4j slf4j-log4j12 - 1.7.25 + ${slf4j.version} + test + + + + + org.apache.logging.log4j + log4j-api + ${log4j.version} test + + org.apache.logging.log4j + log4j-core + ${log4j.version} + test + + + org.apache.logging.log4j + log4j-jcl + ${log4j.version} + test + + + + commons-fileupload + commons-fileupload + 1.4 + test + + + commons-io + commons-io + + + org.jfree jfreechart @@ -965,6 +1260,12 @@ ${jetty.version} test + + com.caucho + quercus + 4.0.63 + test + org.seleniumhq.selenium @@ -977,8 +1278,8 @@ htmlunit - commons-codec - commons-codec + org.apache.httpcomponents + httpclient org.apache.httpcomponents @@ -996,14 +1297,14 @@ org.apache.httpcomponents httpclient - - commons-codec - commons-codec - org.apache.httpcomponents httpcore + + com.squareup.okio + okio + @@ -1016,10 +1317,6 @@ org.apache.httpcomponents httpclient - - commons-codec - commons-codec - org.apache.httpcomponents httpcore @@ -1036,10 +1333,6 @@ org.apache.httpcomponents httpclient - - commons-codec - commons-codec - org.apache.httpcomponents httpcore @@ -1056,32 +1349,12 @@ org.apache.httpcomponents httpclient - - commons-codec - commons-codec - org.apache.httpcomponents httpcore - - org.tmatesoft.svnkit - svnkit - 1.9.2 - test - - - com.jcraft - jsch.agentproxy.connector-factory - - - com.jcraft - jsch.agentproxy.svnkit-trilead-ssh2 - - - @@ -1091,11 +1364,11 @@ sonatype-nexus-snapshots - http://oss.sonatype.org/content/repositories/snapshots + https://oss.sonatype.org/content/repositories/snapshots sonatype-nexus-staging - http://oss.sonatype.org/service/local/staging/deploy/maven2 + https://oss.sonatype.org/service/local/staging/deploy/maven2 diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml new file mode 100644 index 00000000000..c7116bc3623 --- /dev/null +++ b/spotbugs-exclude.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/changes/changes.xml b/src/changes/changes.xml index f7bf642a25a..c907a41493e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -7,6 +7,495 @@ + + + Security: prevent Rhinos access to Java resources; e.g. call java methods. + + + Upgrade Apache HttpComponents to 4.5.11. + + + XSLTProcessor now respects the xsl:output indent='yes' setting when simulating chrome. + + + Upgrade Jetty to 9.4.26.v20200117. + + + DocumentFragment.getElementById() added. + + + DocumentFragment methods childElementCount(), firstElementChild(), and lastElementChild() are no longer + failing because of a ClassCastException. + + + Resync core-js with rhino trunk (2019-11-25). This includes some improvements to iterable processing. + + + The entity processing was broken if an '&' was in front of a tag like </div>&X</div>. + + + Promise.all() and Promise.race() are now able to work with iterables instead of only supporting + arrays. + + + Upgrade Jetty to 9.4.25.v20191220. + + + Try to make stopping of the WebSockets more robust. + + + Some documentation added for file upload. + + + Upgrade Apache log4j-api to 2.13.0. + + + CanvasRenderingContext2D.globalAlpha implemented. + + + Angle handling for CanvasRenderingContext2D ellipse and arc fixed. + + + No longer use annotations for the implementation of isReadOnlySettable to + make the code simpler and faster. + + + CanvasRenderingContext2D.ellipse(..) implemented. + + + DOMRectList is visible. + + + Resync core-js with rhino trunk (2019-11-25). This fixes a bug regarding isExtensible handling. + + + Browser specific vAling handling fixed. + + + Do not create js peers during html parsing if js is disabled. + + + Some neko updates and some caching to use less objects and memory during html parsing. + + + Firefox 68 ESR simulation now available. + + + More robust color parsing. + + + CanvasRenderingContext2D.closePath() implemented. + + + Upgrade Jetty to 9.4.24.v20191120. + + + MockWebConnection.getRequestedUrls() added. + + + Respect form 'novalidate' attribute. + + + Resync core-js with rhino trunk (2019-10-19). + + + Img elements in forms are accessible directly using the name also when nested. + + + WebClient#openWindow no longer throws a ClassCastException when called from a non html page. + + + Wrong encoding used in window.atob(). + + + File input with required attribute now validates correctly. + + + Upgrade Apache HttpComponents to 4.5.10. + + + + + INCOMPATIBLE CHANGE: WebConnection.close() and WebConnectionWrapper.close() are throwing an + IOException instead of an Exception now. + + + Method isAttachment(WebResponse) moved from Attachment to the AttachmentHandler interface + as default method. Based on this you can now overwrite the isAttachment(WebResponse) + implementation with your own. + + + FIREFOX_52 is deprecated. + + + Correct handling of media properties without values. + + + Console.assert(..) added. + + + Do not start the (Default)JavascriptExecutor if javascript is disabled for the client. + + + New method com.gargoylesoftware.htmlunit.Cache.clearOutdated() to remove outdated entries. + + + Make responses cachable in case the Cache-Control header with max-age or s-maxage overrules the Expires header. + + + Javascript Proxy stub removed. The class is only a stub an might confuse feature detections code + that only checks for existence. + + + Brotli support added. + + + Class XPathUtils renamed to XPathHelper. + + + Class XmlUtil renamed to XmlUtils and moved to com.gargoylesoftware.htmlunit.util. + + + Class TextUtil renamed to TextUtils and moved to com.gargoylesoftware.htmlunit.util. + + + ArchUnit added. + + + Log no longer a warning for not supported link types. Instead log more detailed debug messages + for this case. + + + Fix NPE for some unsupported css hacks. + + + Add a save() method in TextPage, which knows to save in the same charset as was received in the response. + + + Upgrade Apache commons-text to 1.7. + + + HtmlPage.save(File) no longer fails if some linked resources are not available. + + + Link to sourceforge mailing lists fixed. + + + MessageEvent.initMessageEvent() port parameter checking fixed. + + + Improved offsetTop calculation. + + + Trigger the correct event listener if a script tag points to an url that returns 204 (no content). + + + WebSocket onOpen event handler is called with the event as parameter. + + + WebSocket events are initialized with correct srcElement and origin. + + + Cleanup our logging setup; slf4j dependencies removed, log4j2 is now used for all the tests + of log output. + + + Fix the referrer and origin header when the request was created from window.location.reload(). + + + AudioContext.createBufferSource and a simple AudioContext.decodeAudioData added. + + + Revert a minor change to ensure backward compatibility with older jetty versions. + + + neko: Handle the (invalid) comment close tag '--!>' like the valid one regarding to the + spec (https://html.spec.whatwg.org/multipage/parsing.html#comment-end-bang-state) + + + XMLHttpRequestEventTarget has no ctor. + + + Properties onError and onLoad moved from XMLHttpRequest up to XMLHttpRequestEventTarget. + + + Clicking a label with a valid for attribute does not forward the click to the target + if the target is disabled. + + + Code cleanup and some resource handling fixes for HttpWebConnection. + + + + + + Upgrade Apache commons-lang3 to 3.9. + + + Upgrade Apache HttpClient to 4.5.8. + + + StackOverflowError during javascript processing are now handled like other javascript errors. + Only the JavaScriptErrorListener gets informed. + + + Make the processing of request headers more correct and document the general idea. + + + Log a warning, if click() is a no-op because the target element is disabled or not displayed. + + + Fix an error in the url circle detection when loading frame content. + + + Avoid scientific notation when converting float back to strings (CSSParser) + + + Logging documentation updated. + + + INCOMPATIBLE CHANGE: JavaScriptErrorListener interface defines one new method + warn(String, String, int, String, int). + Please add an implementation to your own implementations of this interface. + + + INCOMPATIBLE CHANGE: DefaultJavaScriptErrorListener now logs all messages. + + + Class SilentJavaScriptErrorListener added. + + + JavaScriptErrorListener is no longer saved from the HtmlUnitContextFactory to be sure + to use always the currently configured one. + + + Class com.gargoylesoftware.htmlunit.javascript.StrictErrorHandler removed. + + + Class com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter removed. + + + core-js: some array length border cases fixed + + + core-js: array length null/undefined fixed + + + core-js: array includes added + + + core-js: array padStart and padEnd added + + + Image handler are processed (again) if an image is imported into a new document. + + + Page of the imported node fixed when importing. + + + There is no need for a window if constructing a new event handler. + + + Fix NPE when getting the baseUrl from a page created using DOMImplementation.createHTMLDocument(). + + + Invalid urls with the about protocol (e.g. about:htmlunit) are now throwing a MalformedURLException + to be handled like any other IOException. + + + HtmlRangeInput improvements. + + + Input element with type date now stores the value typed in. + + + + + + Fix insert position for elements with contenteditable='true'. + + + Send 'image/png' as mime type when uploading a png file. + + + + + + CSS declarations in CDATA sections are not processed for XHtml and Xml pages. + + + Script code in CDATA sections are not processed for XHtml and Xml pages. + + + Neko-HtmlUnit parser: entity reference handling rewritten according to the spec. + All specified character references are now supported and a bunch of fixes where + also made for numeric references. + + + ClassList.toggle/add/remove should take care of the HtmlAttributeChangeListener. + + + Audio node created from js now supports nodeType and nodeName property. + + + Upgrade Apache HttpClient to 4.5.7. + + + Avoid the try to add a response to cache if the response is already from cache or an redirect. + + + Fix caching for redirected calls. + + + Some fixes for broken attribute processing done in neko-htmlunit. + + + JavaScriptExecutor is no longer serializable. + + + FileReader.readAsText() added. + + + Major cleanup of the htmlunit-cssparser; all the references to the w3c classes are removed. + This avoid a lot of instanceof/cast processing and will make it simpler to enhance the parser + in the future. + + + New method Window.animateAnimationsFrames(). Use this to force one animation cycle. + + + Huge improvement for CanvasRenderingContext2D; we have working path handling and transformations now. + + + Another Rhino update; Array.fill, Array.keys, Array.entries, and Array.values is now supported. + + + HtmlPage.save(File) and XmlSerializer.save(SgmlPage, File) are using the correct file encoding. + + + No longer fail if the generated bytecode for method exceeds 64K limit; + we (Rhino) will fall back to the interpreter mode. + + + We are using the Map/Set/WeakMap/WeakMap implementation from Rhino now, our own impl is gone. + + + Improved support for insecure socket connections; InsecureTrustManager now + extends X509ExtendedTrustManager instead of implementing only X509TrustManager. + + + Fix Promise.resolve() called with an object having no 'then' slot. + + + Fix handling of invalid values in media queries. + + + Browsers are supporting GMT time format for cookie expires parsing. + + + Fix calculation of absolute url from relative one if dots present. + + + Setting the innerHtml has to clear the computed styles to force recalculation + based on the new content. + + + Map and Set forEach() are using undefined as this context in strict mode. + + + Stub impl of DateTimeFormat.resolvedOptions() added. + + + Correct handling of content type 'no-gzip' and 'gzip-only-text/html'. + + + Reworked JS event listeners implementation; many incompatibilities with + all supported browsers are fixed. + + + Maven Fluido Skin used for the web page updated to version 1.7 + + + + + + INCOMPATIBLE CHANGE: ScriptResult.getNewPage() is no longer available. You can use something like + webClient.getCurrentWindow().getEnclosedPage() instead. + + + Source repository is on GitHub now. + + + Input tel/search/number now fires the oninput event. + + + Reworked JS event listeners implementation; many incompatibilities with + all supported browsers are fixed. + + + Maven Fluido Skin used for the web page updated to version 1.7 + + + Improved calculation of the left offset. + + + We are using the typed array implementation from Rhino now, our own impl is gone. + + + Method Date.toUTCString() is available in Rhino; remove our own impl. + + + Fix the order of the windows returned by WebClient.getTopLevelWindows() + to be again the same as WebClient.getWebWindows(). + + + Improved support for javascript named function expressions (core-js). + + + DomNodeIterator no longer traverses uncles of root node. + + + Add missing default delegating methods getContentLength(), cleanUp(), and defaultCharsetUtf8() + to WebResponseWrapper. + + + Major cleanup for neko and switch to xerces 2.12.0 + + + + + + Event listeners had to be functions, other types are ignored. + + + Setting window.clientInformation is ignored in IE. + + + HTMLxxxInput.reset() results in a wrong state of the selection delegate. + + + FF60 ESR support. + + + FF45 support removed. + + + Many fixes for document.createEvent('xxx') to support the various UI events. + + + Correct handling of additional parameters provided in functions setTimeout/setInterval. + + + NPE in HtmlTextArea.removeFocus(). + + + WebClient default request header should not overwrite request-specific ones. + + + Various fixes for the selector specificity calculation (CssParser). + + + core-js is now in sync with the latest Rhino codebase. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/AbstractPage.java b/src/main/java/com/gargoylesoftware/htmlunit/AbstractPage.java index e30a7288c9a..7d585bb4dbc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/AbstractPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/AbstractPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/AjaxController.java b/src/main/java/com/gargoylesoftware/htmlunit/AjaxController.java index 0ad9cb46102..fa924c9c322 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/AjaxController.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/AjaxController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/AlertHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/AlertHandler.java index b263dedc907..44e2cc28feb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/AlertHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/AlertHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,16 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.Serializable; + /** * A handler for JavaScript alerts. Alerts are triggered when the JavaScript method Window.alert() * is called. * * @author Mike Bowler + * @author Ronald Brill */ -public interface AlertHandler { +public interface AlertHandler extends Serializable { /** * Handle an alert for the given page. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/AppletConfirmHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/AppletConfirmHandler.java index 48ea60793cd..8fc895f50fa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/AppletConfirmHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/AppletConfirmHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.Serializable; + import com.gargoylesoftware.htmlunit.html.HtmlApplet; import com.gargoylesoftware.htmlunit.html.HtmlObject; @@ -23,7 +25,7 @@ * * @author Ronald Brill */ -public interface AppletConfirmHandler { +public interface AppletConfirmHandler extends Serializable { /** * Handles a confirm for the specified page. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java b/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java index 868e3ef931d..d9158466cc6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.AbstractJavaScriptConfiguration; import com.gargoylesoftware.htmlunit.javascript.configuration.BrowserFeature; import com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Objects of this class represent one specific version of a given browser. Predefined @@ -37,18 +38,18 @@ * *

You can create a different browser setup by using the BrowserVersionFactory. *

- *      String applicationName = "APPNAME";
- *      String applicationVersion = "APPVERSION";
- *      String userAgent = "USERAGENT";
- *      int browserVersionNumeric = NUMERIC;
+ *         final String applicationName = "APPNAME";
+ *         final String applicationVersion = "APPVERSION";
+ *         final String userAgent = "USERAGENT";
  *
- *      BrowserVersion browser = new BrowserVersion.BrowserVersionFactory(FF52)
- *          .setApplicationName(applicationName)
- *          .setApplicationVersion(applicationVersion)
- *          .setUserAgent(userAgent)
- *          .build();
+ *         final BrowserVersion browser =
+ *                 new BrowserVersion.BrowserVersionBuilder(BrowserVersion.FIREFOX_68)
+ *                     .setApplicationName(applicationName)
+ *                     .setApplicationVersion(applicationVersion)
+ *                     .setUserAgent(userAgent)
+ *                     .build();
  * 
- *

But keep in mind this now one still behaves like a FF52, only the stuff reported to the + *

But keep in mind this now one still behaves like a FF68, only the stuff reported to the * outside is changed. This is more or less the same you can do with real browsers installing * plugins like UserAgentSwitcher. * @@ -93,27 +94,22 @@ public final class BrowserVersion implements Serializable { private static final String PLATFORM_WIN64 = "Win64"; /** - * Firefox 45 ESR. - * @since 2.21 - * @deprecated As of 2.31 + * Firefox 60 ESR. + * @since 2.32 */ - @Deprecated - public static final BrowserVersion FIREFOX_45 = new BrowserVersion(45, "FF45"); + public static final BrowserVersion FIREFOX_60 = new BrowserVersion(60, "FF60"); /** - * Firefox 52 ESR. - * @since 2.26 + * Firefox 68 ESR. + * @since 2.37 */ - public static final BrowserVersion FIREFOX_52 = new BrowserVersion(52, "FF52"); + public static final BrowserVersion FIREFOX_68 = new BrowserVersion(68, "FF68"); /** Internet Explorer 11. */ public static final BrowserVersion INTERNET_EXPLORER = new BrowserVersion(11, "IE"); /** Latest Chrome. */ - public static final BrowserVersion CHROME = new BrowserVersion(60, "Chrome"); - - /** Microsoft Edge. Work In Progress!!! */ - public static final BrowserVersion EDGE = new BrowserVersion(14, "Edge"); + public static final BrowserVersion CHROME = new BrowserVersion(67, "Chrome"); /** * The best supported browser version at the moment. @@ -125,13 +121,12 @@ public final class BrowserVersion implements Serializable { /** Register plugins for the browser versions. */ static { - // FF45 - FIREFOX_45.applicationVersion_ = "5.0 (Windows)"; - FIREFOX_45.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0"; - FIREFOX_45.platform_ = PLATFORM_WIN32; - FIREFOX_45.buildId_ = "20170411115307"; - FIREFOX_45.productSub_ = "20100101"; - FIREFOX_45.headerNamesOrdered_ = new String[] { + // FF60 + FIREFOX_60.applicationVersion_ = "5.0 (Windows)"; + FIREFOX_60.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"; + FIREFOX_60.buildId_ = "20190124141046"; + FIREFOX_60.productSub_ = "20100101"; + FIREFOX_60.headerNamesOrdered_ = new String[] { HttpHeader.HOST, HttpHeader.USER_AGENT, HttpHeader.ACCEPT, @@ -140,11 +135,11 @@ public final class BrowserVersion implements Serializable { HttpHeader.REFERER, HttpHeader.COOKIE, HttpHeader.CONNECTION}; - FIREFOX_45.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; - FIREFOX_45.xmlHttpRequestAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; - FIREFOX_45.imgAcceptHeader_ = "image/png,image/*;q=0.8,*/*;q=0.5"; - FIREFOX_45.cssAcceptHeader_ = "text/css,*/*;q=0.1"; - FIREFOX_45.fontHeights_ = new int[] { + FIREFOX_60.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; + FIREFOX_60.xmlHttpRequestAcceptHeader_ = "*/*"; + FIREFOX_60.imgAcceptHeader_ = "*/*"; + FIREFOX_60.cssAcceptHeader_ = "text/css,*/*;q=0.1"; + FIREFOX_60.fontHeights_ = new int[] { 0, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 53, 55, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 84, 85, 86, 87, 88, @@ -152,30 +147,32 @@ public final class BrowserVersion implements Serializable { 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 138, 139, 139, 141, 142, 143, 144, 146, 147, 148, 149}; - // FF52 - FIREFOX_52.applicationVersion_ = "5.0 (Windows)"; - FIREFOX_52.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0"; - FIREFOX_52.buildId_ = "20180315163333"; - FIREFOX_52.productSub_ = "20100101"; - FIREFOX_52.headerNamesOrdered_ = new String[] { + // FF68 + FIREFOX_68.applicationVersion_ = "5.0 (Windows)"; + FIREFOX_68.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"; + FIREFOX_68.buildId_ = "20181001000000"; + FIREFOX_68.productSub_ = "20100101"; + FIREFOX_68.headerNamesOrdered_ = new String[] { HttpHeader.HOST, HttpHeader.USER_AGENT, HttpHeader.ACCEPT, HttpHeader.ACCEPT_LANGUAGE, HttpHeader.ACCEPT_ENCODING, HttpHeader.REFERER, - HttpHeader.COOKIE, HttpHeader.CONNECTION, - "Upgrade-Insecure-Requests"}; - FIREFOX_52.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; - FIREFOX_52.cssAcceptHeader_ = "text/css,*/*;q=0.1"; - FIREFOX_52.fontHeights_ = new int[] { - 0, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 53, 55, 57, 58, - 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 84, 85, 86, 87, 88, - 89, 90, 91, 93, 94, 95, 96, 96, 98, 99, 100, 101, 103, 104, 105, 106, 106, 108, 109, 111, 112, 113, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 138, 139, - 139, 141, 142, 143, 144, 146, 147, 148, 149}; + HttpHeader.COOKIE}; + FIREFOX_68.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; + FIREFOX_68.xmlHttpRequestAcceptHeader_ = "*/*"; + FIREFOX_68.imgAcceptHeader_ = "image/webp,*/*"; + FIREFOX_68.cssAcceptHeader_ = "text/css,*/*;q=0.1"; + FIREFOX_68.fontHeights_ = new int[] { + 0, 2, 3, 5, 6, 6, 7, 9, 10, 11, 12, 13, 15, 16, 16, 17, 18, 20, 21, 22, 23, 25, 26, 26, 28, 29, + 31, 32, 33, 34, 35, 37, 38, 38, 39, 41, 42, 43, 44, 45, 47, 48, 48, 49, 51, 52, 53, 54, 56, 58, 59, 59, + 60, 61, 63, 64, 65, 66, 68, 69, 69, 70, 71, 73, 74, 75, 76, 77, 79, 79, + 80, 82, 84, 85, 86, 87, 88, 90, 91, 91, 92, 94, 95, 96, 97, 98, + 100, 101, 101, 102, 103, 105, 106, 107, 108, 111, 112, 112, 113, 114, 116, 117, 118, 119, + 120, 122, 122, 123, 124, 126, 127, 128, 129, 130, 132, 132, 133, 134, 137, 138, 139, + 140, 141, 143, 143, 144, 145, 146, 148}; // IE INTERNET_EXPLORER.applicationVersion_ = "5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"; @@ -203,18 +200,9 @@ public final class BrowserVersion implements Serializable { 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 147}; - // EDGE - EDGE.applicationVersion_ = "5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"; - EDGE.userAgent_ = "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"; - - EDGE.htmlAcceptHeader_ = "text/html, application/xhtml+xml, image/jxr, */*"; - EDGE.cssAcceptHeader_ = "text/css, */*"; - EDGE.imgAcceptHeader_ = "image/png, image/svg+xml, image/jxr, image/*;q=0.8, */*;q=0.5"; - EDGE.scriptAcceptHeader_ = "application/javascript, */*;q=0.8"; - // CHROME - CHROME.applicationVersion_ = "5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"; - CHROME.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"; + CHROME.applicationVersion_ = "5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"; + CHROME.userAgent_ = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36"; CHROME.applicationCodeName_ = "Mozilla"; CHROME.vendor_ = "Google Inc."; @@ -226,12 +214,17 @@ public final class BrowserVersion implements Serializable { HttpHeader.CONNECTION, "Upgrade-Insecure-Requests", HttpHeader.USER_AGENT, + HttpHeader.SEC_FETCH_USER, HttpHeader.ACCEPT, + HttpHeader.SEC_FETCH_SITE, + HttpHeader.SEC_FETCH_MODE, HttpHeader.REFERER, HttpHeader.ACCEPT_ENCODING, HttpHeader.ACCEPT_LANGUAGE, HttpHeader.COOKIE}; - CHROME.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"; + CHROME.acceptEncodingHeader_ = "gzip, deflate, br"; + CHROME.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;" + + "q=0.8,application/signed-exchange;v=b3;q=0.9"; CHROME.imgAcceptHeader_ = "image/webp,image/apng,image/*,*/*;q=0.8"; CHROME.cssAcceptHeader_ = "text/css,*/*;q=0.1"; CHROME.scriptAcceptHeader_ = "*/*"; @@ -245,13 +238,14 @@ public final class BrowserVersion implements Serializable { 138, 139, 140, 142, 142, 143, 144, 145, 147}; // default file upload mime types - CHROME.registerUploadMimeType("html", "text/html"); - CHROME.registerUploadMimeType("htm", "text/html"); - CHROME.registerUploadMimeType("css", "text/css"); - CHROME.registerUploadMimeType("xml", "text/xml"); + CHROME.registerUploadMimeType("html", MimeType.TEXT_HTML); + CHROME.registerUploadMimeType("htm", MimeType.TEXT_HTML); + CHROME.registerUploadMimeType("css", MimeType.TEXT_CSS); + CHROME.registerUploadMimeType("xml", MimeType.TEXT_XML); CHROME.registerUploadMimeType("gif", "image/gif"); CHROME.registerUploadMimeType("jpeg", "image/jpeg"); CHROME.registerUploadMimeType("jpg", "image/jpeg"); + CHROME.registerUploadMimeType("png", "image/png"); CHROME.registerUploadMimeType("webp", "image/webp"); CHROME.registerUploadMimeType("mp4", "video/mp4"); CHROME.registerUploadMimeType("m4v", "video/mp4"); @@ -268,63 +262,66 @@ public final class BrowserVersion implements Serializable { CHROME.registerUploadMimeType("xhtml", "application/xhtml+xml"); CHROME.registerUploadMimeType("xht", "application/xhtml+xml"); CHROME.registerUploadMimeType("xhtm", "application/xhtml+xml"); - CHROME.registerUploadMimeType("txt", "text/plain"); - CHROME.registerUploadMimeType("text", "text/plain"); - - FIREFOX_45.registerUploadMimeType("html", "text/html"); - FIREFOX_45.registerUploadMimeType("htm", "text/html"); - FIREFOX_45.registerUploadMimeType("css", "text/css"); - FIREFOX_45.registerUploadMimeType("xml", "text/xml"); - FIREFOX_45.registerUploadMimeType("gif", "image/gif"); - FIREFOX_45.registerUploadMimeType("jpeg", "image/jpeg"); - FIREFOX_45.registerUploadMimeType("jpg", "image/jpeg"); - FIREFOX_45.registerUploadMimeType("mp4", "video/mp4"); - FIREFOX_45.registerUploadMimeType("m4v", "video/mp4"); - FIREFOX_45.registerUploadMimeType("m4a", "audio/mp4"); - FIREFOX_45.registerUploadMimeType("mp3", "audio/mpeg"); - FIREFOX_45.registerUploadMimeType("ogv", "video/ogg"); - FIREFOX_45.registerUploadMimeType("ogm", "video/x-ogm"); - FIREFOX_45.registerUploadMimeType("ogg", "video/ogg"); - FIREFOX_45.registerUploadMimeType("oga", "audio/ogg"); - FIREFOX_45.registerUploadMimeType("opus", "audio/ogg"); - FIREFOX_45.registerUploadMimeType("webm", "video/webm"); - FIREFOX_45.registerUploadMimeType("wav", "audio/wav"); - FIREFOX_45.registerUploadMimeType("flac", "audio/x-flac"); - FIREFOX_45.registerUploadMimeType("xhtml", "application/xhtml+xml"); - FIREFOX_45.registerUploadMimeType("xht", "application/xhtml+xml"); - FIREFOX_45.registerUploadMimeType("txt", "text/plain"); - FIREFOX_45.registerUploadMimeType("text", "text/plain"); - - FIREFOX_52.registerUploadMimeType("html", "text/html"); - FIREFOX_52.registerUploadMimeType("htm", "text/html"); - FIREFOX_52.registerUploadMimeType("css", "text/css"); - FIREFOX_52.registerUploadMimeType("xml", "text/xml"); - FIREFOX_52.registerUploadMimeType("gif", "image/gif"); - FIREFOX_52.registerUploadMimeType("jpeg", "image/jpeg"); - FIREFOX_52.registerUploadMimeType("jpg", "image/jpeg"); - FIREFOX_52.registerUploadMimeType("mp4", "video/mp4"); - FIREFOX_52.registerUploadMimeType("m4v", "video/mp4"); - FIREFOX_52.registerUploadMimeType("m4a", "audio/mp4"); - FIREFOX_52.registerUploadMimeType("mp3", "audio/mpeg"); - FIREFOX_52.registerUploadMimeType("ogv", "video/ogg"); - FIREFOX_52.registerUploadMimeType("ogm", "video/x-ogm"); - FIREFOX_52.registerUploadMimeType("ogg", "video/ogg"); - FIREFOX_52.registerUploadMimeType("oga", "audio/ogg"); - FIREFOX_52.registerUploadMimeType("opus", "audio/ogg"); - FIREFOX_52.registerUploadMimeType("webm", "video/webm"); - FIREFOX_52.registerUploadMimeType("wav", "audio/wav"); - FIREFOX_52.registerUploadMimeType("xhtml", "application/xhtml+xml"); - FIREFOX_52.registerUploadMimeType("xht", "application/xhtml+xml"); - FIREFOX_52.registerUploadMimeType("txt", "text/plain"); - FIREFOX_52.registerUploadMimeType("text", "text/plain"); - - INTERNET_EXPLORER.registerUploadMimeType("html", "text/html"); - INTERNET_EXPLORER.registerUploadMimeType("htm", "text/html"); - INTERNET_EXPLORER.registerUploadMimeType("css", "text/css"); - INTERNET_EXPLORER.registerUploadMimeType("xml", "text/xml"); + CHROME.registerUploadMimeType("txt", MimeType.TEXT_PLAIN); + CHROME.registerUploadMimeType("text", MimeType.TEXT_PLAIN); + + FIREFOX_60.registerUploadMimeType("html", MimeType.TEXT_HTML); + FIREFOX_60.registerUploadMimeType("htm", MimeType.TEXT_HTML); + FIREFOX_60.registerUploadMimeType("css", MimeType.TEXT_CSS); + FIREFOX_60.registerUploadMimeType("xml", MimeType.TEXT_XML); + FIREFOX_60.registerUploadMimeType("gif", "image/gif"); + FIREFOX_60.registerUploadMimeType("jpeg", "image/jpeg"); + FIREFOX_60.registerUploadMimeType("jpg", "image/jpeg"); + FIREFOX_60.registerUploadMimeType("png", "image/png"); + FIREFOX_60.registerUploadMimeType("mp4", "video/mp4"); + FIREFOX_60.registerUploadMimeType("m4v", "video/mp4"); + FIREFOX_60.registerUploadMimeType("m4a", "audio/mp4"); + FIREFOX_60.registerUploadMimeType("mp3", "audio/mpeg"); + FIREFOX_60.registerUploadMimeType("ogv", "video/ogg"); + FIREFOX_60.registerUploadMimeType("ogm", "video/x-ogm"); + FIREFOX_60.registerUploadMimeType("ogg", "video/ogg"); + FIREFOX_60.registerUploadMimeType("oga", "audio/ogg"); + FIREFOX_60.registerUploadMimeType("opus", "audio/ogg"); + FIREFOX_60.registerUploadMimeType("webm", "video/webm"); + FIREFOX_60.registerUploadMimeType("wav", "audio/wav"); + FIREFOX_60.registerUploadMimeType("xhtml", "application/xhtml+xml"); + FIREFOX_60.registerUploadMimeType("xht", "application/xhtml+xml"); + FIREFOX_60.registerUploadMimeType("txt", MimeType.TEXT_PLAIN); + FIREFOX_60.registerUploadMimeType("text", MimeType.TEXT_PLAIN); + + FIREFOX_68.registerUploadMimeType("html", MimeType.TEXT_HTML); + FIREFOX_68.registerUploadMimeType("htm", MimeType.TEXT_HTML); + FIREFOX_68.registerUploadMimeType("css", MimeType.TEXT_CSS); + FIREFOX_68.registerUploadMimeType("xml", MimeType.TEXT_XML); + FIREFOX_68.registerUploadMimeType("gif", "image/gif"); + FIREFOX_68.registerUploadMimeType("jpeg", "image/jpeg"); + FIREFOX_68.registerUploadMimeType("jpg", "image/jpeg"); + FIREFOX_68.registerUploadMimeType("mp4", "video/mp4"); + FIREFOX_68.registerUploadMimeType("m4v", "video/mp4"); + FIREFOX_68.registerUploadMimeType("m4a", "audio/mp4"); + FIREFOX_68.registerUploadMimeType("png", "image/png"); + FIREFOX_68.registerUploadMimeType("mp3", "audio/mpeg"); + FIREFOX_68.registerUploadMimeType("ogv", "video/ogg"); + FIREFOX_68.registerUploadMimeType("ogm", "video/x-ogm"); + FIREFOX_68.registerUploadMimeType("ogg", "video/ogg"); + FIREFOX_68.registerUploadMimeType("oga", "audio/ogg"); + FIREFOX_68.registerUploadMimeType("opus", "audio/ogg"); + FIREFOX_68.registerUploadMimeType("webm", "video/webm"); + FIREFOX_68.registerUploadMimeType("webp", "image/webp"); + FIREFOX_68.registerUploadMimeType("wav", "audio/wav"); + FIREFOX_68.registerUploadMimeType("xhtml", "application/xhtml+xml"); + FIREFOX_68.registerUploadMimeType("xht", "application/xhtml+xml"); + FIREFOX_68.registerUploadMimeType("txt", MimeType.TEXT_PLAIN); + FIREFOX_68.registerUploadMimeType("text", MimeType.TEXT_PLAIN); + + INTERNET_EXPLORER.registerUploadMimeType("html", MimeType.TEXT_HTML); + INTERNET_EXPLORER.registerUploadMimeType("htm", MimeType.TEXT_HTML); + INTERNET_EXPLORER.registerUploadMimeType("css", MimeType.TEXT_CSS); + INTERNET_EXPLORER.registerUploadMimeType("xml", MimeType.TEXT_XML); INTERNET_EXPLORER.registerUploadMimeType("gif", "image/gif"); INTERNET_EXPLORER.registerUploadMimeType("jpeg", "image/jpeg"); INTERNET_EXPLORER.registerUploadMimeType("jpg", "image/jpeg"); + INTERNET_EXPLORER.registerUploadMimeType("png", "image/png"); INTERNET_EXPLORER.registerUploadMimeType("mp4", "video/mp4"); INTERNET_EXPLORER.registerUploadMimeType("m4v", "video/mp4"); INTERNET_EXPLORER.registerUploadMimeType("m4a", "audio/mp4"); @@ -334,50 +331,14 @@ public final class BrowserVersion implements Serializable { INTERNET_EXPLORER.registerUploadMimeType("wav", "audio/wav"); INTERNET_EXPLORER.registerUploadMimeType("xhtml", "application/xhtml+xml"); INTERNET_EXPLORER.registerUploadMimeType("xht", "application/xhtml+xml"); - INTERNET_EXPLORER.registerUploadMimeType("txt", "text/plain"); - - EDGE.registerUploadMimeType("html", "text/html"); - EDGE.registerUploadMimeType("htm", "text/html"); - EDGE.registerUploadMimeType("css", "text/css"); - EDGE.registerUploadMimeType("xml", "text/xml"); - EDGE.registerUploadMimeType("gif", "image/gif"); - EDGE.registerUploadMimeType("jpeg", "image/jpeg"); - EDGE.registerUploadMimeType("jpg", "image/jpeg"); - EDGE.registerUploadMimeType("mp4", "video/mp4"); - EDGE.registerUploadMimeType("m4v", "video/mp4"); - EDGE.registerUploadMimeType("m4a", "audio/mp4"); - EDGE.registerUploadMimeType("mp3", "audio/mpeg"); - EDGE.registerUploadMimeType("ogm", "video/x-ogm"); - EDGE.registerUploadMimeType("ogg", "application/ogg"); - EDGE.registerUploadMimeType("wav", "audio/wav"); - EDGE.registerUploadMimeType("xhtml", "application/xhtml+xml"); - EDGE.registerUploadMimeType("xht", "application/xhtml+xml"); - EDGE.registerUploadMimeType("txt", "text/plain"); + INTERNET_EXPLORER.registerUploadMimeType("txt", MimeType.TEXT_PLAIN); // flush plugin (windows version) - PluginConfiguration flash = new PluginConfiguration("Shockwave Flash", - "Shockwave Flash 29.0 r0", "29.0.0.140", "NPSWF32_29_0_0_140.dll"); - flash.getMimeTypes().add(new PluginConfiguration.MimeType("application/x-shockwave-flash", - "Shockwave Flash", "swf")); - FIREFOX_45.plugins_.add(flash); - - flash = new PluginConfiguration("Shockwave Flash", - "Shockwave Flash 29.0 r0", "29.0.0.140", "NPSWF64_29_0_0_140.dll"); - flash.getMimeTypes().add(new PluginConfiguration.MimeType("application/x-shockwave-flash", - "Shockwave Flash", "swf")); - FIREFOX_52.plugins_.add(flash); - - flash = new PluginConfiguration("Shockwave Flash", - "Shockwave Flash 29.0 r0", "29.0.0.140", "Flash32_29_0_0_140.ocx"); + final PluginConfiguration flash = new PluginConfiguration("Shockwave Flash", + "Shockwave Flash 30.0 r0", "30.0.0.113", "Flash32_30_0_0_113.ocx"); //NOPMD flash.getMimeTypes().add(new PluginConfiguration.MimeType("application/x-shockwave-flash", "Shockwave Flash", "swf")); INTERNET_EXPLORER.plugins_.add(flash); - - flash = new PluginConfiguration("Shockwave Flash", - "Shockwave Flash 18.0 r0", "18.0.0.232", "Flash.ocx"); - flash.getMimeTypes().add(new PluginConfiguration.MimeType("application/x-shockwave-flash", - "Shockwave Flash", "swf")); - EDGE.plugins_.add(flash); } private final int browserVersionNumeric_; @@ -400,6 +361,7 @@ public final class BrowserVersion implements Serializable { private String userLanguage_ = LANGUAGE_ENGLISH_US; private final Set plugins_; private final Set features_; + private String acceptEncodingHeader_; private String htmlAcceptHeader_; private String imgAcceptHeader_; private String cssAcceptHeader_; @@ -413,13 +375,14 @@ public final class BrowserVersion implements Serializable { * Creates a new browser version instance. * * @param browserVersionNumeric the floating number version of the browser - * @param nickname the short name of the browser (like "FF52", "IE", ...) - has to be unique + * @param nickname the short name of the browser (like "FF68", "IE", ...) - has to be unique */ private BrowserVersion(final int browserVersionNumeric, final String nickname) { browserVersionNumeric_ = browserVersionNumeric; nickname_ = nickname; applicationName_ = NETSCAPE; + acceptEncodingHeader_ = "gzip, deflate"; htmlAcceptHeader_ = "*/*"; imgAcceptHeader_ = "*/*"; cssAcceptHeader_ = "*/*"; @@ -438,17 +401,14 @@ private void initFeatures() { if (isChrome()) { expectedBrowser = SupportedBrowser.CHROME; } - else if (isFirefox52()) { - expectedBrowser = SupportedBrowser.FF52; + else if (isFirefox60()) { + expectedBrowser = SupportedBrowser.FF60; } else if (isFirefox()) { - expectedBrowser = SupportedBrowser.FF45; - } - else if (isIE()) { - expectedBrowser = SupportedBrowser.IE; + expectedBrowser = SupportedBrowser.FF68; } else { - expectedBrowser = SupportedBrowser.EDGE; + expectedBrowser = SupportedBrowser.IE; } for (final BrowserVersionFeatures features : BrowserVersionFeatures.values()) { @@ -507,15 +467,6 @@ public boolean isChrome() { return getNickname().startsWith("Chrome"); } - /** - * Returns {@code true} if this BrowserVersion instance represents some - * version of Microsoft Edge. - * @return whether or not this version is a version of an Edge browser - */ - public boolean isEdge() { - return getNickname().startsWith("Edge"); - } - /** * Returns {@code true} if this BrowserVersion instance represents some * version of Firefox. @@ -527,10 +478,10 @@ public boolean isFirefox() { /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
- * @return whether or not this version version 52 of a Firefox browser + * @return whether or not this version version 60 of a Firefox browser */ - public boolean isFirefox52() { - return isFirefox() && getBrowserVersionNumeric() == 52; + public boolean isFirefox60() { + return isFirefox() && getBrowserVersionNumeric() == 60; } /** @@ -671,6 +622,14 @@ public String getUserLanguage() { return userLanguage_; } + /** + * Returns the value used by the browser for the {@code Accept_Encoding} header. + * @return the accept encoding header string + */ + public String getAcceptEncodingHeader() { + return acceptEncodingHeader_; + } + /** * Returns the value used by the browser for the {@code Accept} header if requesting a page. * @return the accept header string @@ -842,17 +801,17 @@ public BrowserVersionBuilder(final BrowserVersion version) { .setPlatform(version.getPlatform()) .setSystemLanguage(version.getSystemLanguage()) .setSystemTimezone(version.getSystemTimezone()) - .setUserLanguage(version.getUserLanguage()); - - workPiece_.buildId_ = version.getBuildId(); - workPiece_.productSub_ = version.getProductSub(); - workPiece_.htmlAcceptHeader_ = version.getHtmlAcceptHeader(); - workPiece_.imgAcceptHeader_ = version.getImgAcceptHeader(); - workPiece_.cssAcceptHeader_ = version.getCssAcceptHeader(); - workPiece_.scriptAcceptHeader_ = version.getScriptAcceptHeader(); - workPiece_.xmlHttpRequestAcceptHeader_ = version.getXmlHttpRequestAcceptHeader(); - workPiece_.headerNamesOrdered_ = version.getHeaderNamesOrdered(); - workPiece_.fontHeights_ = version.fontHeights_; + .setUserLanguage(version.getUserLanguage()) + .setBuildId(version.getBuildId()) + .setProductSub(version.getProductSub()) + .setAcceptEncodingHeader(version.getAcceptEncodingHeader()) + .setHtmlAcceptHeader(version.getHtmlAcceptHeader()) + .setImgAcceptHeader(version.getImgAcceptHeader()) + .setCssAcceptHeader(version.getCssAcceptHeader()) + .setScriptAcceptHeader(version.getScriptAcceptHeader()) + .setXmlHttpRequestAcceptHeader(version.getXmlHttpRequestAcceptHeader()) + .setHeaderNamesOrdered(version.getHeaderNamesOrdered()) + .setFontHeights(version.fontHeights_); for (final PluginConfiguration pluginConf : version.getPlugins()) { workPiece_.plugins_.add(pluginConf.clone()); @@ -986,6 +945,15 @@ public BrowserVersionBuilder setUserLanguage(final String userLanguage) { return this; } + /** + * @param acceptEncodingHeader the {@code Accept-Encoding} header + * @return this for fluent use + */ + public BrowserVersionBuilder setAcceptEncodingHeader(final String acceptEncodingHeader) { + workPiece_.acceptEncodingHeader_ = acceptEncodingHeader; + return this; + } + /** * @param htmlAcceptHeader the {@code Accept} header to be used when retrieving pages * @return this for fluent use @@ -1031,5 +999,41 @@ public BrowserVersionBuilder setXmlHttpRequestAcceptHeader(final String xmlHttpR workPiece_.xmlHttpRequestAcceptHeader_ = xmlHttpRequestAcceptHeader; return this; } + + /** + * @param productSub the productSub + * @return this for fluent use + */ + BrowserVersionBuilder setProductSub(final String productSub) { + workPiece_.productSub_ = productSub; + return this; + } + + /** + * @param headerNamesOrdered the headerNamesOrdered + * @return this for fluent use + */ + BrowserVersionBuilder setHeaderNamesOrdered(final String[] headerNamesOrdered) { + workPiece_.headerNamesOrdered_ = headerNamesOrdered; + return this; + } + + /** + * @param headerNamesOrdered the headerNamesOrdered + * @return this for fluent use + */ + BrowserVersionBuilder setFontHeights(final int[] fontHeights) { + workPiece_.fontHeights_ = fontHeights; + return this; + } + + /** + * @param buildId the buildId + * @return this for fluent use + */ + BrowserVersionBuilder setBuildId(final String buildId) { + workPiece_.buildId_ = buildId; + return this; + } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java b/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java index de679977c7e..2d8e7be2c1d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,9 @@ package com.gargoylesoftware.htmlunit; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.BrowserFeature; @@ -48,26 +47,22 @@ public enum BrowserVersionFeatures { /** Ignore target when {@code href} is a javascript snippet. */ @BrowserFeature(CHROME) - ANCHOR_IGNORE_TARGET_FOR_JS_HREF, - - /** Is the default display style of Applet is 'inline-block'. */ - @BrowserFeature(FF45) - APPLET_INLINE_BLOCK, + ANCHOR_SEND_PING_REQUEST, /** Background image is 'initial'. */ @BrowserFeature(CHROME) CSS_BACKGROUND_INITIAL, - /** Computed {@code display} is {@code block} for non-attached elements. */ + /** Background image is 'rgba(0, 0, 0, 0)'. */ @BrowserFeature(FF) - CSS_COMPUTED_BLOCK_IF_NOT_ATTACHED, + CSS_BACKGROUND_RGBA, /** Computed {@code zIndex} is not considered. */ @BrowserFeature(CHROME) CSS_COMPUTED_NO_Z_INDEX, /** Is display style of HtmlDialog is 'none'. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF}) CSS_DIALOG_NONE, /** Is display style 'block'. */ @@ -78,18 +73,27 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, FF}) CSS_DISPLAY_BLOCK2, - /** {@code CSSFontFaceRule.cssText} uses {@code \r\n} to break lines. */ - @BrowserFeature(IE) - CSS_FONTFACERULE_CSSTEXT_CRLF, - /** {@code CSSFontFaceRule.cssText} has no {@code \n}. */ @BrowserFeature(CHROME) - CSS_FONTFACERULE_CSSTEXT_NO_CRLF, + CSS_FONTFACERULE_CSSTEXT_CHROME_STYLE, + + /** {@code CSSFontFaceRule.cssText} has no {@code \n}. */ + @BrowserFeature(FF60) + CSS_FONTFACERULE_CSSTEXT_FF60_STYLE, + + /** {@code CSSFontFaceRule.cssText} uses {@code \n\t} to break lines. */ + @BrowserFeature(IE) + CSS_FONTFACERULE_CSSTEXT_IE_STYLE, /** The default value of the display property for the 'input' tags is 'inline-block'. */ @BrowserFeature({CHROME, IE}) CSS_INPUT_DISPLAY_INLINE_BLOCK, + /** The default value of the display property for the 'input' tags of type + * radio or checkbox is 'inline-block'. */ + @BrowserFeature(FF) + CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK, + /** 'initial' is a valid length value. */ @BrowserFeature({CHROME, FF}) CSS_LENGTH_INITIAL, @@ -126,6 +130,14 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) CSS_SET_NULL_THROWS, + /** For disconnectd items style properties are blank. */ + @BrowserFeature({CHROME, FF68}) + CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY, + + /** For disconnectd items style font property is blank. */ + @BrowserFeature(CHROME) + CSS_STYLE_PROP_FONT_DISCONNECTED_IS_EMPTY, + /** Internet Explorer versions 5 and later support the behavior property. The behavior property lets * you use CSS to attach a script to a specific element in order to implement * DHTML (Dynamic HTML) components. @@ -149,9 +161,9 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) DOM_NORMALIZE_REMOVE_CHILDREN, - /** Event false result. */ - @BrowserFeature(IE) - EVENT_FALSE_RESULT, + /** Indicates whether returnValue behaves HTML5-like with an empty string default. */ + @BrowserFeature({CHROME, FF}) + EVENT_BEFORE_UNLOAD_RETURN_VALUE_IS_HTML5_LIKE, /** Triggers the onfocus onfocusin blur onfocusout events in this order. */ @BrowserFeature(CHROME) @@ -161,6 +173,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) EVENT_FOCUS_IN_FOCUS_OUT_BLUR, + /** Indicates whether returning 'null' from a property handler is meaningful. */ + @BrowserFeature(IE) + EVENT_HANDLER_NULL_RETURN_IS_MEANINGFUL, + /** Mouse events are triggered on disabled elements also. */ @BrowserFeature(FF) EVENT_MOUSE_ON_DISABLED, @@ -189,16 +205,12 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, IE}) EVENT_ONHASHCHANGE_BUBBLES_FALSE, - /** Event.cancelable is false in 'onload' event handler. */ - @BrowserFeature({CHROME, FF, IE}) - EVENT_ONLOAD_CANCELABLE_FALSE, - /** Triggers "onload" event if internal javascript loaded. */ @BrowserFeature(IE) EVENT_ONLOAD_INTERNAL_JAVASCRIPT, /** MessageEvent default data value is null. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) EVENT_ONMESSAGE_DEFAULT_DATA_NULL, /** Does not trigger "onmousedown" event handler for the select options. */ @@ -225,6 +237,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) EVENT_ONMOUSEUP_NOT_FOR_SELECT_OPTION, + /** PopStateEvent can not be created by calling document.createEvent('PopStateEvent'). */ + @BrowserFeature(FF) + EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED, + /** Supports event type 'BeforeUnloadEvent'. */ @BrowserFeature({CHROME, FF}) EVENT_TYPE_BEFOREUNLOADEVENT, @@ -237,6 +253,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(FF) EVENT_TYPE_KEY_EVENTS, + /** Supports vendor specific event type 'MouseWheelEvent'. */ + @BrowserFeature(IE) + EVENT_TYPE_MOUSEWHEELEVENT, + /** Supports event type 'PointerEvent'. */ @BrowserFeature(IE) EVENT_TYPE_POINTEREVENT, @@ -245,6 +265,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) EVENT_TYPE_PROGRESSEVENT, + /** Supports event type 'WheelEvent'. */ + @BrowserFeature({CHROME, IE}) + EVENT_TYPE_WHEELEVENT, + /** For new pages the focus points to the body node. */ @BrowserFeature(IE) FOCUS_BODY_ELEMENT_AT_START, @@ -290,15 +314,15 @@ public enum BrowserVersionFeatures { HTMLABBREVIATED, /** HtmlAllCollection.item returns null instead of undefined if an element was not found. */ - @BrowserFeature({IE, FF}) + @BrowserFeature({IE, FF60}) HTMLALLCOLLECTION_DO_NOT_CONVERT_STRINGS_TO_NUMBER, /** HtmlAllCollection.item(int) is not supported. */ - @BrowserFeature(FF) + @BrowserFeature(FF60) HTMLALLCOLLECTION_DO_NOT_SUPPORT_PARANTHESES, /** HtmlAllCollection.item(int) requires int parameter. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF68}) HTMLALLCOLLECTION_INTEGER_INDEX, /** HtmlCollection returns the first hit instead of a collection if many elements found. */ @@ -318,7 +342,7 @@ public enum BrowserVersionFeatures { HTMLBASE_HREF_DEFAULT_EMPTY, /** HtmlCollection.item() supports also doubles as index. */ - @BrowserFeature({IE, FF}) + @BrowserFeature({IE, FF60}) HTMLCOLLECTION_ITEM_FUNCT_SUPPORTS_DOUBLE_INDEX_ALSO, /** HtmlCollection.item[] supports also doubles as index. */ @@ -345,6 +369,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(FF) HTMLDEFINITION_INLINE_IN_QUIRKS, + /** {@code document.applets} returns a NodeList. */ + @BrowserFeature(FF60) + HTMLDOCUMENT_APPLETS_NODELIST, + /** Is {@code document.charset} lower-case. */ @BrowserFeature(IE) HTMLDOCUMENT_CHARSET_LOWERCASE, @@ -353,6 +381,12 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) HTMLDOCUMENT_COLOR, + /** + /** {@code document.getElementsByName} returns an empty list if called with the empty string. + */ + @BrowserFeature(FF) + HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY, + /** We can used function in detached documents. */ @BrowserFeature(IE) HTMLDOCUMENT_FUNCTION_DETACHED, @@ -376,6 +410,10 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, FF}) HTMLELEMENT_ALIGN_INVALID, + /** Detaching the active element from the dom tree triggers no keyup event. */ + @BrowserFeature(IE) + HTMLELEMENT_DETACH_ACTIVE_TRIGGERS_NO_KEYUP_EVENT, + /** Removing the active element from the dom tree triggers the onblur event. */ @BrowserFeature(CHROME) HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT, @@ -385,7 +423,7 @@ public enum BrowserVersionFeatures { HTMLIMAGE_BLANK_SRC_AS_EMPTY, /** Empty src attribute sets display to false. */ - @BrowserFeature({IE, FF52}) + @BrowserFeature({IE, FF}) HTMLIMAGE_EMPTY_SRC_DISPLAY_FALSE, /** Is document.cretaeElement('image') an HTMLElement. */ @@ -417,12 +455,20 @@ public enum BrowserVersionFeatures { HTMLINPUT_FILES_UNDEFINED, /** HTMLInputElement: type {@code file} selectionSart/End are null. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) HTMLINPUT_FILE_SELECTION_START_END_NULL, - /** HTMLInputElement: type {@code file} value to be {@code fakepath}. */ - @BrowserFeature({CHROME, IE}) - HTMLINPUT_FILE_VALUE_FAKEPATH, + /** HTMLInputElement color type is not supported. */ + @BrowserFeature(IE) + HTMLINPUT_TYPE_COLOR_NOT_SUPPORTED, + + /** HTMLInputElement date and time types are supported. */ + @BrowserFeature({CHROME, FF}) + HTMLINPUT_TYPE_DATETIME_SUPPORTED, + + /** HTMLInputElement date and time types are not supported. */ + @BrowserFeature(FF) + HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED, /** Should the HTMLElement of {@code keygen} have no end tag. */ @BrowserFeature(IE) @@ -432,10 +478,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(CHROME) HTMLLINK_CHECK_TYPE_FOR_STYLESHEET, - /** If the single select has exact one option, this options gets never deselected. */ - @BrowserFeature(FF45) - HTMLOPTION_EXACT_ONE_OPTION_GETS_NERVER_DESELECTED, - /** */ @BrowserFeature(IE) HTMLOPTION_PREVENT_DISABLED, @@ -481,7 +523,7 @@ public enum BrowserVersionFeatures { HTML_COMMAND_TAG, /** HTML parser supports the 'isindex' tag. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF}) HTML_ISINDEX_TAG, /** HTML parser supports the 'main' tag. */ @@ -497,13 +539,13 @@ public enum BrowserVersionFeatures { HTTP_COOKIE_EXTENDED_DATE_PATTERNS_1, /** Dates format pattern 2. */ - @BrowserFeature({CHROME, EDGE}) + @BrowserFeature(CHROME) HTTP_COOKIE_EXTENDED_DATE_PATTERNS_2, /** Indicates that the path is extracted from the location. * Sample: from the location /foo/boo only /foo is used. */ - @BrowserFeature({IE, EDGE}) + @BrowserFeature(IE) HTTP_COOKIE_EXTRACT_PATH_FROM_LOCATION, /** domain '.org' is handled as 'org'. */ @@ -514,11 +556,15 @@ public enum BrowserVersionFeatures { * instead of 2000 (Two digits years are interpreted as 20xx * if before 1970 and as 19xx otherwise). */ - @BrowserFeature({CHROME, FF, EDGE}) + @BrowserFeature({CHROME, FF}) HTTP_COOKIE_START_DATE_1970, + /** Browser sends Sec-Fetch headers. */ + @BrowserFeature(CHROME) + HTTP_HEADER_SEC_FETCH, + /** Browser sends Upgrade-Insecure-Requests header. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) HTTP_HEADER_UPGRADE_INSECURE_REQUEST, /** Supports redirect via 308 code. */ @@ -548,7 +594,7 @@ public enum BrowserVersionFeatures { JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL, /** The anchor pathname property returns nothing for broken http(s) url's. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF}) JS_ANCHOR_PATHNAME_NONE_FOR_BROKEN_URL, /** The anchor pathname property returns nothing for none http(s) url's. */ @@ -567,6 +613,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(CHROME) JS_ANCHOR_PROTOCOL_COLON_UPPER_CASE_DRIVE_LETTERS, + /** The anchor protocol property returns 'http' for broken http(s) url's. */ + @BrowserFeature(FF) + JS_ANCHOR_PROTOCOL_HTTP_FOR_BROKEN_URL, + /** Indicates that "someFunction.arguments" is a read-only view of the function's argument. */ @BrowserFeature({CHROME, FF}) JS_ARGUMENTS_READ_ONLY_ACCESSED_FROM_FUNCTION, @@ -595,10 +645,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_BOUNDINGCLIENTRECT_THROWS_IF_DISCONNECTED, - /** If we're emulating IE, the overall JavaScript return value is the last return value. */ - @BrowserFeature(IE) - JS_CALL_RESULT_IS_LAST_RETURN_VALUE, - /** toDataURL for canvas returns the CHROME version of the PNG. */ @BrowserFeature(CHROME) JS_CANVAS_DATA_URL_CHROME_PNG, @@ -607,10 +653,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_CANVAS_DATA_URL_IE_PNG, - /** draw for canvas throws an error if no image available. */ - @BrowserFeature(FF45) - JS_CANVAS_DRAW_THROWS_FOR_MISSING_IMG, - /** Do not allow invalid clear values. */ @BrowserFeature(IE) JS_CLEAR_RESTRICT, @@ -619,8 +661,12 @@ public enum BrowserVersionFeatures { @BrowserFeature(CHROME) JS_CLIENTHIGHT_INPUT_17, + /** ClientHeight for input is 21. */ + @BrowserFeature(FF60) + JS_CLIENTHIGHT_INPUT_21, + /** ClientRectList toString reports the first item. */ - @BrowserFeature(FF) + @BrowserFeature(FF60) JS_CLIENTRECTLIST_DEFAUL_VALUE_FROM_FIRST, /** ClientRectList.item throws instead of returning null if an element was not found. */ @@ -636,17 +682,13 @@ public enum BrowserVersionFeatures { JS_CLIENTWIDTH_INPUT_TEXT_169, /** Is window can be used as Console. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_CONSOLE_HANDLE_WINDOW, /** item is enumerated before length property of CSSRuleList. */ @BrowserFeature(FF) JS_CSSRULELIST_ENUM_ITEM_LENGTH, - /** Uses {@code MozCSSKeyframesRule}. */ - @BrowserFeature(FF45) - JS_CSS_MOZ_CSS_KEYFRAMES_RULE, - /** Date.toLocaleDateString() returns a short form (d.M.yyyy). */ @BrowserFeature({CHROME, FF}) JS_DATE_LOCALE_DATE_SHORT, @@ -671,10 +713,6 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, FF}) JS_DOCUMENT_CREATE_ATTRUBUTE_LOWER_CASE, - /** Javascript function document.createElement accepts only tag names. */ - @BrowserFeature({CHROME, FF, IE}) - JS_DOCUMENT_CREATE_ELEMENT_STRICT, - /** The browser supports the design mode 'Inherit'. */ @BrowserFeature(IE) JS_DOCUMENT_DESIGN_MODE_INHERIT, @@ -691,10 +729,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_DOCUMENT_SETTING_DOMAIN_THROWS_FOR_ABOUT_BLANK, - /** If setting the document.location inside onclick() of anchor element should be triggered. */ - @BrowserFeature({IE, FF}) - JS_DOCUMENT_SET_LOCATION_EXECUTED_IN_ANCHOR, - /** createHTMLDucument requires a title. */ @BrowserFeature(IE) JS_DOMIMPLEMENTATION_CREATE_HTMLDOCOMENT_REQUIRES_TITLE, @@ -764,7 +798,7 @@ public enum BrowserVersionFeatures { JS_DOMIMPLEMENTATION_FEATURE_STYLESHEETS, /** If document.implementation.hasFeature() supports 'http://www.w3.org/TR/SVG11/feature#BasicStructure 1.2'. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_DOMIMPLEMENTATION_FEATURE_SVG_BASICSTRUCTURE_1_2, /** If document.implementation.hasFeature() supports 'MutationNameEvents'. */ @@ -804,7 +838,7 @@ public enum BrowserVersionFeatures { JS_DOMPARSER_PARSERERROR_ON_ERROR, /** DOMTokenList returns false instead of throwing an exception when receiver is blank. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_DOMTOKENLIST_CONTAINS_RETURNS_FALSE_FOR_BLANK, /** DOMTokenList uses an enhanced set of whitespace chars. */ @@ -816,19 +850,15 @@ public enum BrowserVersionFeatures { JS_DOMTOKENLIST_GET_NULL_IF_OUTSIDE, /** DOMTokenList ignores duplicates when determining the length. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF}) JS_DOMTOKENLIST_LENGTH_IGNORES_DUPLICATES, /** DOMTokenList removed all whitespace chars during add. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF}) JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_ADD, - /** DOMTokenList removed all whitespace chars during edit. */ - @BrowserFeature({CHROME, IE}) - JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_EDIT, - /** DOMTokenList removed all whitespace chars during remove. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_REMOVE, /** Javascript property function {@code delete} throws an exception if the given count is negative. */ @@ -843,11 +873,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_ENUMERATOR_CONSTRUCTOR_THROWS, - /** Indicates that for(x in y) should enumerate the numbers first. */ - @BrowserFeature({CHROME, FF, - IE}) - JS_ENUM_NUMBERS_FIRST, - /** Javascript {@code Error.captureStackTrace}. */ @BrowserFeature(CHROME) JS_ERROR_CAPTURE_STACK_TRACE, @@ -864,10 +889,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(FF) JS_EVENT_DISTINGUISH_PRINTABLE_KEY, - /** Executes the window event listeners if the node is detached from the document. */ - @BrowserFeature(CHROME) - JS_EVENT_WINDOW_EXECUTE_IF_DITACHED, - /** Whether {@code FileReader} includes content type or not. */ @BrowserFeature(FF) JS_FILEREADER_CONTENT_TYPE, @@ -881,8 +902,12 @@ public enum BrowserVersionFeatures { JS_FILE_SHORT_DATE_FORMAT, /** Indicates that the action property will not be expanded if defined as empty string. */ - @BrowserFeature(FF) - JS_FORM_ACTION_EXPANDURL_IGNORE_EMPTY, + @BrowserFeature({CHROME, FF}) + JS_FORM_ACTION_EXPANDURL_NOT_DEFINED, + + /** use content-type text/plain if the file type is unknown'. */ + @BrowserFeature(IE) + JS_FORM_DATA_CONTENT_TYPE_PLAIN_IF_FILE_TYPE_UNKNOWN, /** form.dispatchEvent(e) submits the form if the event is of type 'submit'. */ @BrowserFeature(FF) @@ -900,10 +925,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_FORM_USABLE_AS_FUNCTION, - /** Indicates that function is defined even before its declaration, inside a block. */ - @BrowserFeature({CHROME, FF52, IE}) - JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK, - /** Indicates if the method toSource exists on the native objects. */ @BrowserFeature(FF) JS_FUNCTION_TOSOURCE, @@ -942,6 +963,12 @@ public enum BrowserVersionFeatures { @BrowserFeature({FF, IE}) JS_IMAGE_PROTOTYPE_SAME_AS_HTML_IMAGE, + /** + * Getting the width and height of an image tag with an empty source returns 0x0. + */ + @BrowserFeature({CHROME, FF}) + JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0, + /** * Getting the width and height of an image tag without a source returns 16x16; * for invalid values returns 0. @@ -950,8 +977,8 @@ public enum BrowserVersionFeatures { JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0, /** - * Getting the width and height of an image tag without a source returns 18x20; - * for invalid values returns 1. + * Getting the width and height of an image tag without a source returns 24x24; + * for invalid values returns 0x0. */ @BrowserFeature(FF) JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0, @@ -967,28 +994,28 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_INNER_HTML_ADD_CHILD_FOR_NULL_VALUE, - /** Indicates that innerHTML uses {@code crnl} instead of {@code nl}. */ + /** Indicates that innerHTML uses {@code lf} instead of {@code lf}. */ @BrowserFeature(IE) - JS_INNER_TEXT_CR_NL, + JS_INNER_TEXT_LF, /** Indicates that innerText setter supports null values. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_INNER_TEXT_VALUE_NULL, - /** Chrome ignores negative selection starts. */ - @BrowserFeature(CHROME) + /** Ignore negative selection starts. */ + @BrowserFeature({CHROME, FF}) JS_INPUT_IGNORE_NEGATIVE_SELECTION_START, /** Chrome/FF returns null for selectionStart/selectionEnd. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_INPUT_NUMBER_SELECTION_START_END_NULL, /** Setting the type property of an input converts the type to lowercase. */ @BrowserFeature(IE) JS_INPUT_SET_TYPE_LOWERCASE, - /** Setting the value of an Input Date to blank will result in an empty value. */ - @BrowserFeature(CHROME) + /** Setting the value of an Input Date will check for correct format. */ + @BrowserFeature({CHROME, FF}) JS_INPUT_SET_VALUE_DATE_SUPPORTED, /** Setting the value of an Input Email to blank will result in an empty value. */ @@ -1007,16 +1034,16 @@ public enum BrowserVersionFeatures { @BrowserFeature(CHROME) JS_INTL_V8_BREAK_ITERATOR, - /** Supports Iterator and StopIteration. */ - @BrowserFeature(FF) - JS_Iterator, + /** Indicates that isSearchProviderInstalled returns zero instead of undefined. */ + @BrowserFeature({CHROME, FF60, IE}) + JS_IS_SEARCH_PROVIDER_INSTALLED_ZERO, /** Property form for label always returns null. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) JS_LABEL_FORM_NULL, /** location.hash returns an encoded hash. */ - @BrowserFeature(FF) + @BrowserFeature({CHROME, FF}) JS_LOCATION_HASH_HASH_IS_ENCODED, /** @@ -1025,7 +1052,7 @@ public enum BrowserVersionFeatures { * for url 'http://localhost/something/#%C3%BC'.
* IE evaluates to #%C3%BC. */ - @BrowserFeature(FF) + @BrowserFeature({CHROME, FF}) JS_LOCATION_HASH_IS_DECODED, /** @@ -1041,12 +1068,12 @@ public enum BrowserVersionFeatures { * for url 'http://localhost/something/#ü'.
* IE evaluates to #ü. */ - @BrowserFeature(FF) + @BrowserFeature({CHROME, FF}) JS_LOCATION_HREF_HASH_IS_ENCODED, - /** Map ignores the argument constructor. */ - @BrowserFeature(IE) - JS_MAP_CONSTRUCTOR_IGNORE_ARGUMENT, + /** Reload sends a referrer header. */ + @BrowserFeature(CHROME) + JS_LOCATION_RELOAD_REFERRER, /** Indicates that an empty media list is represented by the string 'all'. */ @BrowserFeature(IE) @@ -1060,14 +1087,22 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_MENU_TYPE_EMPTY, + /** Type property of menu returns the current (maybe invalid) value. */ + @BrowserFeature(FF) + JS_MENU_TYPE_PASS, + /** Indicates if the String representation of a native function is without newline. */ - @BrowserFeature({CHROME, EDGE}) + @BrowserFeature(CHROME) JS_NATIVE_FUNCTION_TOSTRING_COMPACT, /** Indicates if the String representation of a native function begins and ends with a {@code \n}.*/ @BrowserFeature(IE) JS_NATIVE_FUNCTION_TOSTRING_NEW_LINE, + /** Indicates if the String representation of a native function has a newline for empty parameter list. */ + @BrowserFeature(FF) + JS_NATIVE_FUNCTION_TOSTRING_NL, + /** Navigator.doNotTrack returns unspecified if not set. */ @BrowserFeature(FF) JS_NAVIGATOR_DO_NOT_TRACK_UNSPECIFIED, @@ -1130,7 +1165,7 @@ public enum BrowserVersionFeatures { JS_PROPERTY_DESCRIPTOR_NEW_LINE, /** Support {@code Reflect}. */ - @BrowserFeature({CHROME, FF, EDGE}) + @BrowserFeature({CHROME, FF}) JS_REFLECT, /** RegExp.lastParen returns an empty string if the RegExp has too many groups. */ @@ -1141,9 +1176,15 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_REGEXP_GROUP0_RETURNS_WHOLE_MATCH, - /** Javascript script tags supports the 'for' and the 'event' attribute. + /** + * Javascript script tags handles a 204 (no content) response for the src + * attrib as error. */ @BrowserFeature(IE) + JS_SCRIPT_HANDLE_204_AS_ERROR, + + /** Javascript script tags supports the 'for' and the 'event' attribute. */ + @BrowserFeature(IE) JS_SCRIPT_SUPPORTS_FOR_AND_EVENT_WINDOW, /** Javascript selectorText property returns selectors in lower case. */ @@ -1154,17 +1195,17 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, FF}) JS_SELECT_FILE_THROWS, - /** When expanding the collection by setting the length don't add + /** When expanding the options collection by setting the length don't add * an empty text node. */ - @BrowserFeature({CHROME, IE}) - JS_SELECT_OPTIONS_DONT_ADD_EMPTY_TEXT_CHILD_WHEN_EXPANDING, + @BrowserFeature(FF60) + JS_SELECT_OPTIONS_ADD_EMPTY_TEXT_CHILD_WHEN_EXPANDING, /** Indicates that select.options has a wong class name. */ @BrowserFeature(IE) JS_SELECT_OPTIONS_HAS_SELECT_CLASS_NAME, /** Ignore negative value when setting the length. */ - @BrowserFeature({CHROME, FF}) + @BrowserFeature(CHROME) JS_SELECT_OPTIONS_IGNORE_NEGATIVE_LENGTH, /** The 'in' operator returns always true for HtmlOptionsCollection. */ @@ -1176,14 +1217,14 @@ public enum BrowserVersionFeatures { JS_SELECT_OPTIONS_NULL_FOR_OUTSIDE, /** Indicates that select.options.remove ignores the call if index is too large. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF68}) JS_SELECT_OPTIONS_REMOVE_IGNORE_IF_INDEX_NEGATIVE, /** Indicates that select.options.remove ignores the call if index is too large. */ - @BrowserFeature({CHROME, IE}) + @BrowserFeature({CHROME, FF68, IE}) JS_SELECT_OPTIONS_REMOVE_IGNORE_IF_INDEX_TOO_LARGE, - /** Indicates that select.options[i] throws an exception if the requested index is neagtive. */ + /** Indicates that select.options[i] throws an exception if the requested index is negative. */ @BrowserFeature(IE) JS_SELECT_OPTIONS_REMOVE_THROWS_IF_NEGATIV, @@ -1196,10 +1237,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_SELECT_SET_VALUES_CHECKS_ONLY_VALUE_ATTRIBUTE, - /** Set ignores the constructor argument. */ - @BrowserFeature(IE) - JS_SET_CONSTRUCTOR_IGNORE_ARGUMENT, - /** Whether to get any property from the items first. */ @BrowserFeature(IE) JS_STORAGE_GET_FROM_ITEMS, @@ -1213,7 +1250,7 @@ public enum BrowserVersionFeatures { JS_STYLESHEETLIST_ACTIVE_ONLY, /** Indicates if style.setProperty ignores case when determining the priority. */ - @BrowserFeature({CHROME, IE}) + @BrowserFeature({CHROME, FF68, IE}) JS_STYLE_SET_PROPERTY_IMPORTANT_IGNORES_CASE, /** IE supports accessing unsupported style elements via getter @@ -1232,13 +1269,9 @@ public enum BrowserVersionFeatures { JS_STYLE_WRONG_INDEX_RETURNS_UNDEFINED, /** Supports Symbol. */ - @BrowserFeature({CHROME, FF, EDGE}) + @BrowserFeature({CHROME, FF}) JS_SYMBOL, - /** Symbol support is limited in FF45. */ - @BrowserFeature(FF45) - JS_SYMBOL_FF45, - /** The width cell height does not return negative values. */ @BrowserFeature(IE) JS_TABLE_CELL_HEIGHT_DOES_NOT_RETURN_NEGATIVE_VALUES, @@ -1290,7 +1323,7 @@ public enum BrowserVersionFeatures { /** Setting the property cols throws an exception, if the provided value is not convertible into an integer. * FF ignores the provided value in this case and sets cols to 0. */ - @BrowserFeature({IE, FF45}) + @BrowserFeature(IE) JS_TEXT_AREA_SET_COLS_THROWS_EXCEPTION, /** Setting the property {@code maxLength} throws an exception, if the provided value is less than 0. */ @@ -1304,7 +1337,7 @@ public enum BrowserVersionFeatures { /** Setting the property rows throws an exception, if the provided value is not convertible into an integer. * FF ignores the provided value in this case and sets rows to 0. */ - @BrowserFeature({IE, FF45}) + @BrowserFeature(IE) JS_TEXT_AREA_SET_ROWS_THROWS_EXCEPTION, /** Setting the value processes null as null value. */ @@ -1322,17 +1355,13 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_TREEWALKER_FILTER_FUNCTION_ONLY, - /** Types arrays can be constructed with {@code null}. */ - @BrowserFeature(CHROME) - JS_TYPED_ARRAYS_NULL, - /** Setting the property align to arbitrary values is allowed. */ @BrowserFeature({CHROME, FF}) JS_TYPE_ACCEPTS_ARBITRARY_VALUES, - /** WeakMap ignores the constructor argument. */ + /** Setting the property valign converts to lowercase. */ @BrowserFeature(IE) - JS_WEAKMAP_CONSTRUCTOR_IGNORE_ARGUMENT, + JS_VALIGN_CONVERTS_TO_LOWERCASE, /** Allow inheriting parent constants * in {@link com.gargoylesoftware.htmlunit.javascript.host.event.WebGLContextEvent}. */ @@ -1370,12 +1399,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_WINDOW_FRAME_BY_ID_RETURNS_WINDOW, - /** - * Difference of window.outer/inner height is 89. - */ - @BrowserFeature(CHROME) - JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_132, - /** * Difference of window.outer/inner height is 63. */ @@ -1383,10 +1406,16 @@ public enum BrowserVersionFeatures { JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_63, /** - * Difference of window.outer/inner height is 94. + * Difference of window.outer/inner height is 86. */ @BrowserFeature(FF) - JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_94, + JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_86, + + /** + * Difference of window.outer/inner height is 92. + */ + @BrowserFeature(CHROME) + JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_92, /** Window.getSelection returns null, if the window is not visible. */ @BrowserFeature(FF) @@ -1428,6 +1457,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) JS_XML_SUPPORT_VIA_ACTIVEXOBJECT, + /** {@code XSLTProcessor.transformToDocument} supports output indent attribute. */ + @BrowserFeature(CHROME) + JS_XSLT_TRANSFORM_INDENT, + /** With special keys [in .type(int)], should we trigger onkeypress event or not. */ @BrowserFeature(FF) KEYBOARD_EVENT_SPECIAL_KEYPRESS, @@ -1465,10 +1498,6 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) QUERYSELECTORALL_NOT_IN_QUIRKS, - /** Indicates {@code .querySelectorAll()} ignores {@code :target} condition. */ - @BrowserFeature(CHROME) - QUERYSELECTORALL_NO_TARGET, - /** IE throws a syntax error if a css3 pseudo selector is used on a detached node. */ @BrowserFeature(IE) QUERYSELECTOR_CSS3_PSEUDO_REQUIRE_ATTACHED_NODE, @@ -1477,21 +1506,10 @@ public enum BrowserVersionFeatures { @BrowserFeature(IE) RESETINPUT_DEFAULT_VALUE_IF_VALUE_NOT_DEFINED, - /** - * Indicates that all options of a select are deselected, - * if the select state is changed for an unknown option. - */ - @BrowserFeature({CHROME, FF52, IE}) - SELECT_DESELECT_ALL_IF_SWITCHING_UNKNOWN, - /** The default display style of slot is 'content'. */ - @BrowserFeature(CHROME) + @BrowserFeature({CHROME, FF}) SLOT_CONTENTS, - /** Indicates that string.contains() is supported. */ - @BrowserFeature(FF45) - STRING_CONTAINS, - /** Indicates that string.includes() is supported. */ @BrowserFeature({CHROME, FF}) STRING_INCLUDES, @@ -1534,16 +1552,9 @@ public enum BrowserVersionFeatures { * Indicates, that the pathname for the url 'blank' is empty; * instead of 'blank'. */ - @BrowserFeature({CHROME, FF52}) + @BrowserFeature({CHROME, FF}) URL_ABOUT_BLANK_HAS_BLANK_PATH, - /** - * Indicates, that the pathname for the url {@code about:blank} is empty; - * instead of '/blank'. - */ - @BrowserFeature(FF45) - URL_ABOUT_BLANK_HAS_EMPTY_PATH, - /** * Indicates, that the browser supports username and password as * part of the url (e.g. http://john.smith:secret@localhost). @@ -1559,13 +1570,25 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, FF}) URL_MISSING_SLASHES, + /** Set the origin property for web socket events. */ + @BrowserFeature({CHROME, FF}) + WEBSOCKET_ORIGIN_SET, + + /** Set the srcElement property for web socket events. */ + @BrowserFeature({CHROME, FF68, IE}) + WEBSOCKET_SRC_ELEMENT_SET, + /** Execute window events. */ @BrowserFeature(IE) WINDOW_EXECUTE_EVENTS, - /** XMLHttpRequest.getAllResponseHeaders() has a trailing CrLf. */ + /** XMLHttpRequest.getAllResponseHeaders() has a trailing separator. */ @BrowserFeature(IE) - XHR_ALL_RESPONSE_HEADERS_APPEND_CRLF, + XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR, + + /** XMLHttpRequest.getAllResponseHeaders() uses only Lf as separator. */ + @BrowserFeature({FF, IE}) + XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF, /** XMLHttpRequest triggers the opened event at the beginning of the send method again. */ @BrowserFeature(IE) @@ -1581,7 +1604,7 @@ public enum BrowserVersionFeatures { XHR_IGNORE_PORT_FOR_SAME_ORIGIN, /** ProgressEvent.lengthComputable is true. */ - @BrowserFeature({FF45, IE}) + @BrowserFeature(IE) XHR_LENGTH_COMPUTABLE, /** A cross origin request to {@code about:blank} is not allowed. */ @@ -1592,33 +1615,14 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, FF}) XHR_OPEN_ALLOW_EMTPY_URL, - /** Indicates that open() throws an exception in sync mode if 'withCredentials' is set to true. */ - @BrowserFeature(FF45) - XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTION, - - /** Indicates that method overrideMimeType throws if msg was already sent. */ - @BrowserFeature({CHROME, FF52, IE}) - XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND, - /** Indicates that the content charset is used for response parsing. */ - @BrowserFeature(FF) + @BrowserFeature({FF, CHROME}) XHR_USE_CONTENT_CHARSET, - /** Indicates that the request uses the charset from the requesting page. */ - @BrowserFeature(CHROME) - XHR_USE_DEFAULT_CHARSET_FROM_PAGE, - /** Indicates that the "*" pattern is allowed when withCredential is enabled. */ @BrowserFeature(IE) XHR_WITHCREDENTIALS_ALLOW_ORIGIN_ALL, - /** - * Indicates that the property withCredentials is not writable for sync requests. - * Setting the property throws an exception. - */ - @BrowserFeature(FF45) - XHR_WITHCREDENTIALS_NOT_WRITEABLE_IN_SYNC_EXCEPTION, - /** Indicates that the XPath attribute is case sensitive. */ @BrowserFeature(CHROME) XPATH_ATTRIBUTE_CASE_SENSITIVE, @@ -1626,5 +1630,4 @@ public enum BrowserVersionFeatures { /** Indicates that the 'SelectionNamespaces' property is supported by XPath expressions. */ @BrowserFeature({IE, CHROME}) XPATH_SELECTION_NAMESPACES, - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/Cache.java b/src/main/java/com/gargoylesoftware/htmlunit/Cache.java index 717c748c62d..32f955de295 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/Cache.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,14 @@ import java.util.Collections; import java.util.Date; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.http.client.utils.DateUtils; -import org.w3c.dom.css.CSSStyleSheet; +import com.gargoylesoftware.css.dom.CSSStyleSheetImpl; import com.gargoylesoftware.htmlunit.util.HeaderUtils; import com.gargoylesoftware.htmlunit.util.UrlUtils; @@ -38,6 +39,7 @@ * @author Daniel Gredler * @author Ahmed Ashour * @author Anton Demydenko + * @author Ronald Brill */ public class Cache implements Serializable { @@ -45,7 +47,8 @@ public class Cache implements Serializable { private int maxSize_ = 40; private static final Pattern DATE_HEADER_PATTERN = Pattern.compile("-?\\d+"); - private static final long DELAY = 10 * org.apache.commons.lang3.time.DateUtils.MILLIS_PER_MINUTE; + static final long DELAY = 10 * org.apache.commons.lang3.time.DateUtils.MILLIS_PER_MINUTE; + /** * The map which holds the cached responses. Note that when keying on URLs, we key on the string version * of the URLs, rather than on the URLs themselves. This is done for performance, because a) the @@ -109,6 +112,42 @@ public int hashCode() { public void touch() { lastAccess_ = System.currentTimeMillis(); } + + /** + *

Check freshness return value if + * a) s-maxage specified + * b) max-age specified + * c) expired specified + * otherwise return {@code null}

+ * + * @see RFC 7234 + * + * @param response + * @param createdAt + * @return freshnessLifetime + */ + private boolean isStillFresh(final long now) { + long freshnessLifetime = 0; + if (!HeaderUtils.containsPrivate(response_) && HeaderUtils.containsSMaxage(response_)) { + // check s-maxage + freshnessLifetime = HeaderUtils.sMaxage(response_); + } + else if (HeaderUtils.containsMaxAge(response_)) { + // check max-age + freshnessLifetime = HeaderUtils.maxAge(response_); + } + else if (response_.getResponseHeaderValue(HttpHeader.EXPIRES) != null) { + final Date expires = parseDateHeader(response_, HttpHeader.EXPIRES); + if (expires != null) { + // use the same logic as in isCacheableContent() + return expires.getTime() - now > DELAY; + } + } + else { + return true; + } + return now - createdAt_ < freshnessLifetime * org.apache.commons.lang3.time.DateUtils.MILLIS_PER_SECOND; + } } /** @@ -123,7 +162,7 @@ public void touch() { */ public boolean cacheIfPossible(final WebRequest request, final WebResponse response, final Object toCache) { if (isCacheable(request, response)) { - final URL url = response.getWebRequest().getUrl(); + final URL url = request.getUrl(); if (url == null) { return false; } @@ -142,13 +181,13 @@ public boolean cacheIfPossible(final WebRequest request, final WebResponse respo * than requests and responses as is done above) because a) this allows us to cache inline CSS, b) CSS is * extremely expensive to parse, so we want to avoid it as much as possible, c) CSS files aren't usually * nearly as large as JavaScript files, so memory bloat won't be too bad, and d) caching on requests and - * responses requires checking dynamicity (see {@link #isCacheableContent(WebResponse)}), and headers often + * responses requires checking dynamically (see {@link #isCacheableContent(WebResponse)}), and headers often * aren't set up correctly, disallowing caching when in fact it should be allowed. * * @param css the CSS snippet from which styleSheet is derived * @param styleSheet the parsed version of css */ - public void cache(final String css, final CSSStyleSheet styleSheet) { + public void cache(final String css, final CSSStyleSheetImpl styleSheet) { final Entry entry = new Entry(css, null, styleSheet); entries_.put(entry.key_, entry); deleteOverflow(); @@ -205,7 +244,14 @@ protected boolean isCacheableContent(final WebResponse response) { } final Date lastModified = parseDateHeader(response, HttpHeader.LAST_MODIFIED); - final Date expires = parseDateHeader(response, HttpHeader.EXPIRES); + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires + // If there is a Cache-Control header with the max-age or s-maxage directive + // in the response, the Expires header is ignored. + Date expires = null; + if (!HeaderUtils.containsMaxAgeOrSMaxage(response)) { + expires = parseDateHeader(response, HttpHeader.EXPIRES); + } final long now = getCurrentTimestamp(); @@ -229,7 +275,7 @@ protected long getCurrentTimestamp() { * @param headerName the header name * @return the specified date header of the specified response */ - protected Date parseDateHeader(final WebResponse response, final String headerName) { + protected static Date parseDateHeader(final WebResponse response, final String headerName) { final String value = response.getResponseHeaderValue(headerName); if (value == null) { return null; @@ -286,61 +332,23 @@ private Entry getCacheEntry(final WebRequest request) { if (url == null) { return null; } - final Entry cachedEntry = entries_.get(UrlUtils.normalize(url)); + + final String normalizedUrl = UrlUtils.normalize(url); + final Entry cachedEntry = entries_.get(normalizedUrl); if (cachedEntry == null) { return null; } - // check if object still fresh - if (checkFreshness(cachedEntry.response_, cachedEntry.createdAt_)) { + if (cachedEntry.isStillFresh(getCurrentTimestamp())) { synchronized (entries_) { cachedEntry.touch(); } return cachedEntry; } - else { - entries_.remove(UrlUtils.normalize(url)); - } + entries_.remove(UrlUtils.normalize(url)); return null; } - /** - *

Check freshness return value if - * a) s-maxage specified - * b) max-age specified - * c) expired specified - * otherwise return {@code null}

- * - * @see RFC 7234 - * - * @param response - * @param createdAt - * @return freshnessLifetime - */ - private boolean checkFreshness(final WebResponse response, final long createdAt) { - final long now = getCurrentTimestamp(); - long freshnessLifetime = 0; - if (!HeaderUtils.containsPrivate(response) && HeaderUtils.containsSMaxage(response)) { - // check s-maxage - freshnessLifetime = HeaderUtils.sMaxage(response); - } - else if (HeaderUtils.containsMaxAge(response)) { - // check max-age - freshnessLifetime = HeaderUtils.maxAge(response); - } - else if (response.getResponseHeaderValue(HttpHeader.EXPIRES) != null) { - final Date expires = parseDateHeader(response, HttpHeader.EXPIRES); - if (expires != null) { - // use the same logic as in isCacheableContent() - return expires.getTime() - now > DELAY; - } - } - else { - return true; - } - return now - createdAt < freshnessLifetime * org.apache.commons.lang3.time.DateUtils.MILLIS_PER_SECOND; - } - /** * Returns the cached parsed version of the specified CSS snippet. If there is no * corresponding cached stylesheet, this method returns {@code null}. @@ -348,7 +356,7 @@ else if (response.getResponseHeaderValue(HttpHeader.EXPIRES) != null) { * @param css the CSS snippet whose cached stylesheet is sought * @return the cached stylesheet corresponding to the specified CSS snippet */ - public CSSStyleSheet getCachedStyleSheet(final String css) { + public CSSStyleSheetImpl getCachedStyleSheet(final String css) { final Entry cachedEntry = entries_.get(css); if (cachedEntry == null) { return null; @@ -356,7 +364,7 @@ public CSSStyleSheet getCachedStyleSheet(final String css) { synchronized (entries_) { cachedEntry.touch(); } - return (CSSStyleSheet) cachedEntry.value_; + return (CSSStyleSheetImpl) cachedEntry.value_; } /** @@ -405,4 +413,22 @@ public void clear() { entries_.clear(); } } + + /** + * Removes outdated entries from the cache. + */ + public void clearOutdated() { + synchronized (entries_) { + final long now = getCurrentTimestamp(); + + final Iterator> iter = entries_.entrySet().iterator(); + while (iter.hasNext()) { + final Map.Entry entry = iter.next(); + if (entry.getValue().response_ == null + || !entry.getValue().isStillFresh(now)) { + iter.remove(); + } + } + } + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/CollectingAlertHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/CollectingAlertHandler.java index fe8e024f9f9..20b33fe4e5e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/CollectingAlertHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/CollectingAlertHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ConfirmHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/ConfirmHandler.java index f6578091941..ba7fe0319df 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ConfirmHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ConfirmHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,15 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.Serializable; + /** * A handler for the JavaScript function window.confirm(). Confirms * are triggered when the JavaScript function window.confirm() is invoked. * * @author Mike Bowler */ -public interface ConfirmHandler { +public interface ConfirmHandler extends Serializable { /** * Handles a confirm for the specified page. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/CookieManager.java b/src/main/java/com/gargoylesoftware/htmlunit/CookieManager.java index 42c70977341..b7abd377d3b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/CookieManager.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/CookieManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider.java b/src/main/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider.java index f253a7995fe..12686ed440d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ */ public class DefaultCredentialsProvider implements CredentialsProvider, Serializable { - private final Map credentialsMap_ = new HashMap<>(); + private final Map credentialsMap_ = new HashMap<>(); /** * Adds credentials for the specified username/password for any host/port/realm combination. @@ -98,21 +98,13 @@ public synchronized void setCredentials(final AuthScope authscope, final Credent if (authscope == null) { throw new IllegalArgumentException("Authentication scope may not be null"); } - final CredentialsFactory factory; - if (credentials instanceof UsernamePasswordCredentials) { - final UsernamePasswordCredentials userCredentials = (UsernamePasswordCredentials) credentials; - factory = new UsernamePasswordCredentialsFactory(userCredentials.getUserName(), - userCredentials.getPassword()); - } - else if (credentials instanceof NTCredentials) { - final NTCredentials ntCredentials = (NTCredentials) credentials; - factory = new NTCredentialsFactory(ntCredentials.getUserName(), ntCredentials.getPassword(), - ntCredentials.getWorkstation(), ntCredentials.getDomain()); - } - else { - throw new IllegalArgumentException("Unsupported Credential type: " + credentials.getClass().getName()); + + if ((credentials instanceof UsernamePasswordCredentials) || (credentials instanceof NTCredentials)) { + credentialsMap_.put(new AuthScopeProxy(authscope), credentials); + return; } - credentialsMap_.put(new AuthScopeProxy(authscope), factory); + + throw new IllegalArgumentException("Unsupported Credential type: " + credentials.getClass().getName()); } /** @@ -122,28 +114,23 @@ else if (credentials instanceof NTCredentials) { * @param authscope the {@link AuthScope authentication scope} * @return the credentials */ - private static Credentials matchCredentials(final Map map, - final AuthScope authscope) { - final CredentialsFactory factory = map.get(new AuthScopeProxy(authscope)); - Credentials creds = null; - if (factory == null) { + private static Credentials matchCredentials(final Map map, final AuthScope authscope) { + Credentials creds = map.get(new AuthScopeProxy(authscope)); + if (creds == null) { int bestMatchFactor = -1; - AuthScope bestMatch = null; + AuthScopeProxy bestMatch = null; for (final AuthScopeProxy proxy : map.keySet()) { final AuthScope current = proxy.getAuthScope(); final int factor = authscope.match(current); if (factor > bestMatchFactor) { bestMatchFactor = factor; - bestMatch = current; + bestMatch = proxy; } } if (bestMatch != null) { - creds = map.get(new AuthScopeProxy(bestMatch)).getInstance(); + creds = map.get(bestMatch); } } - else { - creds = factory.getInstance(); - } return creds; } @@ -202,18 +189,22 @@ public synchronized void clear() { */ private static class AuthScopeProxy implements Serializable { private AuthScope authScope_; + AuthScopeProxy(final AuthScope authScope) { authScope_ = authScope; } + public AuthScope getAuthScope() { return authScope_; } + private void writeObject(final ObjectOutputStream stream) throws IOException { stream.writeObject(authScope_.getHost()); stream.writeInt(authScope_.getPort()); stream.writeObject(authScope_.getRealm()); stream.writeObject(authScope_.getScheme()); } + private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { final String host = (String) stream.readObject(); final int port = stream.readInt(); @@ -221,72 +212,15 @@ private void readObject(final ObjectInputStream stream) throws IOException, Clas final String scheme = (String) stream.readObject(); authScope_ = new AuthScope(host, port, realm, scheme); } + @Override public int hashCode() { return authScope_.hashCode(); } + @Override public boolean equals(final Object obj) { return obj instanceof AuthScopeProxy && authScope_.equals(((AuthScopeProxy) obj).getAuthScope()); } } - - /** - * We have to create a factory class, so that credentials can be serialized correctly. - */ - private static class UsernamePasswordCredentialsFactory implements CredentialsFactory, Serializable { - private String username_; - private String password_; - - UsernamePasswordCredentialsFactory(final String username, final String password) { - username_ = username; - password_ = password; - } - - @Override - public Credentials getInstance() { - return new UsernamePasswordCredentials(username_, password_); - } - - @Override - public String toString() { - return getInstance().toString(); - } - } - - /** - * We have to create a factory class, so that credentials can be serialized correctly. - */ - private static class NTCredentialsFactory implements CredentialsFactory, Serializable { - private String username_; - private String password_; - private String workstation_; - private String domain_; - - NTCredentialsFactory(final String username, final String password, final String workstation, - final String domain) { - username_ = username; - password_ = password; - workstation_ = workstation; - domain_ = domain; - } - - @Override - public Credentials getInstance() { - return new NTCredentials(username_, password_, workstation_, domain_); - } - - @Override - public String toString() { - return getInstance().toString(); - } - } - - /** - * Factory class interface - */ - private interface CredentialsFactory { - Credentials getInstance(); - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/DefaultCssErrorHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/DefaultCssErrorHandler.java index ecc3bc8b02e..444a13efbb8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/DefaultCssErrorHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/DefaultCssErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,9 @@ public class DefaultCssErrorHandler implements CSSErrorHandler, Serializable { */ @Override public void error(final CSSParseException exception) { - LOG.warn("CSS error: " + buildMessage(exception)); + if (LOG.isWarnEnabled()) { + LOG.warn("CSS error: " + buildMessage(exception)); + } } /** @@ -46,7 +48,9 @@ public void error(final CSSParseException exception) { */ @Override public void fatalError(final CSSParseException exception) { - LOG.warn("CSS fatal error: " + buildMessage(exception)); + if (LOG.isWarnEnabled()) { + LOG.warn("CSS fatal error: " + buildMessage(exception)); + } } /** @@ -54,7 +58,9 @@ public void fatalError(final CSSParseException exception) { */ @Override public void warning(final CSSParseException exception) { - LOG.warn("CSS warning: " + buildMessage(exception)); + if (LOG.isWarnEnabled()) { + LOG.warn("CSS warning: " + buildMessage(exception)); + } } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/DefaultPageCreator.java b/src/main/java/com/gargoylesoftware/htmlunit/DefaultPageCreator.java index 9568ba8e03b..dfbb73aaf4c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/DefaultPageCreator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/DefaultPageCreator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +23,12 @@ import org.apache.commons.lang3.StringUtils; import com.gargoylesoftware.htmlunit.html.DomElement; -import com.gargoylesoftware.htmlunit.html.HTMLParser; +import com.gargoylesoftware.htmlunit.html.Html; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.XHtmlPage; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParser; +import com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.xml.XmlPage; /** @@ -79,6 +82,8 @@ public class DefaultPageCreator implements PageCreator, Serializable { private static final byte[] markerUTF16BE_ = {(byte) 0xfe, (byte) 0xff}; private static final byte[] markerUTF16LE_ = {(byte) 0xff, (byte) 0xfe}; + private static final HTMLParser htmlParser_ = new HtmlUnitNekoHtmlParser(); + /** * The different supported page types. */ @@ -106,16 +111,16 @@ public static PageType determinePageType(final String contentType) { } switch (contentType) { - case "text/html": + case MimeType.TEXT_HTML: case "image/svg+xml": return PageType.HTML; case "text/javascript": case "application/x-javascript": - case "application/javascript": + case MimeType.APPLICATION_JAVASCRIPT: return PageType.JAVASCRIPT; - case "text/xml": + case MimeType.TEXT_XML: case "application/xml": case "text/vnd.wap.wml": return PageType.XML; @@ -163,7 +168,7 @@ public Page createPage(final WebResponse webResponse, final WebWindow webWindow) case XML: final SgmlPage sgmlPage = createXmlPage(webResponse, webWindow); final DomElement doc = sgmlPage.getDocumentElement(); - if (doc != null && HTMLParser.XHTML_NAMESPACE.equals(doc.getNamespaceURI())) { + if (doc != null && Html.XHTML_NAMESPACE.equals(doc.getNamespaceURI())) { return createXHtmlPage(webResponse, webWindow); } return sgmlPage; @@ -195,25 +200,33 @@ private String determineContentType(final WebResponse webResponse) try (InputStream contentAsStream = webResponse.getContentAsStream()) { final byte[] bytes = read(contentAsStream, 500); if (bytes.length == 0) { - return "text/plain"; + return MimeType.TEXT_PLAIN; } final String asAsciiString = new String(bytes, "ASCII").toUpperCase(Locale.ROOT); if (asAsciiString.contains("")) { - return "application/javascript"; + return MimeType.APPLICATION_JAVASCRIPT; } else if (isBinary(bytes)) { - return "application/octet-stream"; + return MimeType.APPLICATION_OCTET_STREAM; } } - return "text/plain"; + return MimeType.TEXT_PLAIN; + } + + /** + * {@inheritDoc} + */ + @Override + public HTMLParser getHtmlParser() { + return htmlParser_; } /** @@ -264,7 +277,7 @@ private static byte[] read(final InputStream stream, final int maxNb) throws IOE * @throws IOException if the page could not be created */ protected HtmlPage createHtmlPage(final WebResponse webResponse, final WebWindow webWindow) throws IOException { - return HTMLParser.parseHtml(webResponse, webWindow); + return htmlParser_.parseHtml(webResponse, webWindow); } /** @@ -276,7 +289,7 @@ protected HtmlPage createHtmlPage(final WebResponse webResponse, final WebWindow * @throws IOException if the page could not be created */ protected XHtmlPage createXHtmlPage(final WebResponse webResponse, final WebWindow webWindow) throws IOException { - return HTMLParser.parseXHtml(webResponse, webWindow); + return htmlParser_.parseXHtml(webResponse, webWindow); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/DialogWindow.java b/src/main/java/com/gargoylesoftware/htmlunit/DialogWindow.java index c7b7c9a3300..ecf1d56f95f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/DialogWindow.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/DialogWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/DownloadedContent.java b/src/main/java/com/gargoylesoftware/htmlunit/DownloadedContent.java index 7b73c467ada..b8d6b42b3cf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/DownloadedContent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/DownloadedContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,10 @@ import java.io.ByteArrayInputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; +import java.nio.file.Files; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.ArrayUtils; @@ -86,8 +85,8 @@ class OnFile implements DownloadedContent { } @Override - public InputStream getInputStream() throws FileNotFoundException { - return new FileInputStream(file_); + public InputStream getInputStream() throws IOException { + return Files.newInputStream(file_.toPath()); } @Override diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ElementNotFoundException.java b/src/main/java/com/gargoylesoftware/htmlunit/ElementNotFoundException.java index 10decfe40fe..564c580e35e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ElementNotFoundException.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ElementNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/FailingHttpStatusCodeException.java b/src/main/java/com/gargoylesoftware/htmlunit/FailingHttpStatusCodeException.java index e6dada07614..60513d9b9b3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/FailingHttpStatusCodeException.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/FailingHttpStatusCodeException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/FormEncodingType.java b/src/main/java/com/gargoylesoftware/htmlunit/FormEncodingType.java index 9825e2e4021..2020e235180 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/FormEncodingType.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/FormEncodingType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/History.java b/src/main/java/com/gargoylesoftware/htmlunit/History.java index e66f77df625..13f3799cad6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/History.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/History.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,24 @@ */ public class History implements Serializable { + /** The window to which this navigation history belongs. */ + private final WebWindow window_; + + /** + * Whether or not to ignore calls to {@link #addPage(Page)}; this is a bit hackish (we should probably be using + * explicit boolean parameters in the various methods that load new pages), but it does the job for now -- without + * any new API cruft. + */ + private transient ThreadLocal ignoreNewPages_; + + /** + * The {@link History.HistoryEntry}s in this navigation history. + */ + private final List entries_ = new ArrayList<>(); + + /** The current index within the list of pages which make up this navigation history. */ + private int index_ = -1; + /** * The single entry in the history. */ @@ -107,24 +125,6 @@ private void setState(final Object state) { } } - /** The window to which this navigation history belongs. */ - private final WebWindow window_; - - /** - * Whether or not to ignore calls to {@link #addPage(Page)}; this is a bit hackish (we should probably be using - * explicit boolean parameters in the various methods that load new pages), but it does the job for now -- without - * any new API cruft. - */ - private transient ThreadLocal ignoreNewPages_; - - /** - * The {@link History.HistoryEntry}s in this navigation history. - */ - private final List entries_ = new ArrayList<>(); - - /** The current index within the list of pages which make up this navigation history. */ - private int index_ = -1; - /** * Creates a new navigation history for the specified window. * @param window the window which owns the new navigation history @@ -289,8 +289,8 @@ private void goToUrlAtCurrentIndex() throws IOException { page.getWebResponse().getWebRequest().setUrl(entry.getUrl()); } - final Window jsWindow = (Window) window_.getScriptableObject(); - if (jsWindow.hasEventHandlers("onpopstate")) { + final Window jsWindow = window_.getScriptableObject(); + if (jsWindow != null && jsWindow.hasEventHandlers("onpopstate")) { final Event event = new PopStateEvent(jsWindow, Event.TYPE_POPSTATE, entry.getState()); jsWindow.executeEventLocally(event); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/HttpHeader.java b/src/main/java/com/gargoylesoftware/htmlunit/HttpHeader.java index c2fb88c293b..e3a884d8da6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/HttpHeader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/HttpHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public final class HttpHeader { /** Accept. */ public static final String ACCEPT = "Accept"; - /** accept. */ + /** Accept-LC. */ public static final String ACCEPT_LC = "accept"; /** Accept-Language. */ @@ -89,12 +89,24 @@ public final class HttpHeader { /** connection. */ public static final String CONNECTION_LC = "connection"; + /** Connection. */ + public static final String CONTENT_DISPOSITION = "Content-Disposition"; + /** DNT. */ public static final String DNT = "DNT"; /** Upgrade-Insecure-Requests. */ public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + /** Sec-Fetch-Mode. */ + public static final String SEC_FETCH_MODE = "Sec-Fetch-Mode"; + + /** Sec-Fetch-Site. */ + public static final String SEC_FETCH_SITE = "Sec-Fetch-Site"; + + /** Sec-Fetch-User. */ + public static final String SEC_FETCH_USER = "Sec-Fetch-User"; + /** Access-Control-Request-Method. */ public static final String ACCESS_CONTROL_REQUEST_METHOD = "Access-Control-Request-Method"; /** Access-Control-Request-Headers. */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/HttpMethod.java b/src/main/java/com/gargoylesoftware/htmlunit/HttpMethod.java index 689581d3e5e..7d5aec83ac5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/HttpMethod.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/HttpMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java index 18c682f81c3..6b6e865367a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,14 +20,15 @@ import java.io.ByteArrayOutputStream; import java.io.EOFException; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.Charset; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -96,6 +97,7 @@ import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.content.InputStreamBody; import org.apache.http.impl.client.BasicAuthCache; +import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.protocol.HttpContext; @@ -111,6 +113,7 @@ import com.gargoylesoftware.htmlunit.httpclient.HtmlUnitSSLConnectionSocketFactory; import com.gargoylesoftware.htmlunit.httpclient.SocksConnectionSocketFactory; import com.gargoylesoftware.htmlunit.util.KeyDataPair; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; import com.gargoylesoftware.htmlunit.util.UrlUtils; @@ -166,14 +169,7 @@ public HttpWebConnection(final WebClient webClient) { */ @Override public WebResponse getResponse(final WebRequest request) throws IOException { - final URL url = request.getUrl(); final HttpClientBuilder builder = reconfigureHttpClientIfNeeded(getHttpClientBuilder()); - final HttpContext httpContext = getHttpContext(); - - if (connectionManager_ == null) { - connectionManager_ = createConnectionManager(builder); - } - builder.setConnectionManager(connectionManager_); HttpUriRequest httpMethod = null; try { @@ -181,21 +177,26 @@ public WebResponse getResponse(final WebRequest request) throws IOException { httpMethod = makeHttpMethod(request, builder); } catch (final URISyntaxException e) { - throw new IOException("Unable to create URI from URL: " + url.toExternalForm() + throw new IOException("Unable to create URI from URL: " + request.getUrl().toExternalForm() + " (reason: " + e.getMessage() + ")", e); } final HttpHost hostConfiguration = getHostConfiguration(request); final long startTime = System.currentTimeMillis(); + final HttpContext httpContext = getHttpContext(); HttpResponse httpResponse = null; try { - httpResponse = builder.build().execute(hostConfiguration, httpMethod, httpContext); + try (CloseableHttpClient closeableHttpClient = builder.build()) { + httpResponse = closeableHttpClient.execute(hostConfiguration, httpMethod, httpContext); + } } catch (final SSLPeerUnverifiedException s) { // Try to use only SSLv3 instead if (webClient_.getOptions().isUseInsecureSSL()) { HtmlUnitSSLConnectionSocketFactory.setUseSSL3Only(httpContext, true); - httpResponse = builder.build().execute(hostConfiguration, httpMethod, httpContext); + try (CloseableHttpClient closeableHttpClient = builder.build()) { + httpResponse = closeableHttpClient.execute(hostConfiguration, httpMethod, httpContext); + } } else { throw s; @@ -286,8 +287,8 @@ private void setProxy(final HttpRequestBase httpRequest, final WebRequest webReq private HttpUriRequest makeHttpMethod(final WebRequest webRequest, final HttpClientBuilder httpClientBuilder) throws URISyntaxException { - final Charset charset = webRequest.getCharset(); final HttpContext httpContext = getHttpContext(); + final Charset charset = webRequest.getCharset(); // Make sure that the URL is fully encoded. IE actually sends some Unicode chars in request // URLs; because of this we allow some Unicode chars in URLs. However, at this point we're // handing things over the HttpClient, and HttpClient will blow up if we leave these Unicode @@ -300,6 +301,7 @@ private HttpUriRequest makeHttpMethod(final WebRequest webRequest, final HttpCli } final HttpRequestBase httpMethod = buildHttpMethod(webRequest.getHttpMethod(), uri); setProxy(httpMethod, webRequest); + if (!(httpMethod instanceof HttpEntityEnclosingRequest)) { // this is the case for GET as well as TRACE, DELETE, OPTIONS and HEAD if (!webRequest.getRequestParameters().isEmpty()) { @@ -341,7 +343,7 @@ else if (FormEncodingType.MULTIPART == webRequest.getEncodingType()) { } else { builder.addTextBody(pair.getName(), pair.getValue(), - ContentType.create("text/plain", charset)); + ContentType.create(MimeType.TEXT_PLAIN, charset)); } } method.setEntity(builder.build()); @@ -381,7 +383,6 @@ else if (FormEncodingType.MULTIPART == webRequest.getEncodingType()) { httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider); httpContext.removeAttribute(HttpClientContext.CREDS_PROVIDER); httpContext.removeAttribute(HttpClientContext.TARGET_AUTH_STATE); - return httpMethod; } @@ -412,7 +413,7 @@ private static Charset getCharset(final Charset charset, final ListHttpClientBuilder that will be used by this WebConnection */ - protected HttpClientBuilder createHttpClient() { + protected HttpClientBuilder createHttpClientBuilder() { final HttpClientBuilder builder = HttpClientBuilder.create(); builder.setRedirectStrategy(new HtmlUnitRedirectStrategie()); configureTimeout(builder, getTimeout()); configureHttpsScheme(builder); builder.setMaxConnPerRoute(6); + + builder.setConnectionManagerShared(true); return builder; } @@ -605,6 +609,7 @@ private HttpClientBuilder reconfigureHttpClientIfNeeded(final HttpClientBuilder || options.getSSLClientProtocols() != usedOptions_.getSSLClientProtocols() || options.getProxyConfig() != usedOptions_.getProxyConfig()) { configureHttpsScheme(httpClientBuilder); + if (connectionManager_ != null) { connectionManager_.shutdown(); connectionManager_ = null; @@ -615,6 +620,12 @@ private HttpClientBuilder reconfigureHttpClientIfNeeded(final HttpClientBuilder if (timeout != usedOptions_.getTimeout()) { configureTimeout(httpClientBuilder, timeout); } + + if (connectionManager_ == null) { + connectionManager_ = createConnectionManager(httpClientBuilder); + } + httpClientBuilder.setConnectionManager(connectionManager_); + return httpClientBuilder; } @@ -726,7 +737,7 @@ public static DownloadedContent downloadContent(final InputStream is, final int // we have exceeded the max for memory, let's write everything to a temporary file final File file = File.createTempFile("htmlunit", ".tmp"); file.deleteOnExit(); - try (FileOutputStream fos = new FileOutputStream(file)) { + try (OutputStream fos = Files.newOutputStream(file.toPath())) { bos.writeTo(fos); // what we have already read IOUtils.copyLarge(is, fos); // what remains from the server response } @@ -775,6 +786,7 @@ private List getHttpRequestInterceptors(final WebRequest host.append(Integer.toString(port)); } + // make sure the headers are added in the right order final String userAgent = webClient_.getBrowserVersion().getUserAgent(); final String[] headerNames = webClient_.getBrowserVersion().getHeaderNamesOrdered(); if (headerNames != null) { @@ -785,20 +797,53 @@ private List getHttpRequestInterceptors(final WebRequest else if (HttpHeader.USER_AGENT.equals(header)) { list.add(new UserAgentHeaderHttpRequestInterceptor(userAgent)); } - else if (HttpHeader.ACCEPT.equals(header) && requestHeaders.get(header) != null) { - list.add(new AcceptHeaderHttpRequestInterceptor(requestHeaders.get(header))); + else if (HttpHeader.ACCEPT.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new AcceptHeaderHttpRequestInterceptor(headerValue)); + } + } + else if (HttpHeader.ACCEPT_LANGUAGE.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new AcceptLanguageHeaderHttpRequestInterceptor(headerValue)); + } } - else if (HttpHeader.ACCEPT_LANGUAGE.equals(header) && requestHeaders.get(header) != null) { - list.add(new AcceptLanguageHeaderHttpRequestInterceptor(requestHeaders.get(header))); + else if (HttpHeader.ACCEPT_ENCODING.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new AcceptEncodingHeaderHttpRequestInterceptor(headerValue)); + } } - else if (HttpHeader.ACCEPT_ENCODING.equals(header) && requestHeaders.get(header) != null) { - list.add(new AcceptEncodingHeaderHttpRequestInterceptor(requestHeaders.get(header))); + else if (HttpHeader.SEC_FETCH_MODE.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new SecFetchModeHeaderHttpRequestInterceptor(headerValue)); + } } - else if (HttpHeader.UPGRADE_INSECURE_REQUESTS.equals(header) && requestHeaders.get(header) != null) { - list.add(new UpgradeInsecureRequestHeaderHttpRequestInterceptor(requestHeaders.get(header))); + else if (HttpHeader.SEC_FETCH_SITE.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new SecFetchSiteHeaderHttpRequestInterceptor(headerValue)); + } } - else if (HttpHeader.REFERER.equals(header) && requestHeaders.get(header) != null) { - list.add(new RefererHeaderHttpRequestInterceptor(requestHeaders.get(header))); + else if (HttpHeader.SEC_FETCH_USER.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new SecFetchUserHeaderHttpRequestInterceptor(headerValue)); + } + } + else if (HttpHeader.UPGRADE_INSECURE_REQUESTS.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new UpgradeInsecureRequestHeaderHttpRequestInterceptor(headerValue)); + } + } + else if (HttpHeader.REFERER.equals(header)) { + final String headerValue = webRequest.getAdditionalHeader(header); + if (headerValue != null) { + list.add(new RefererHeaderHttpRequestInterceptor(headerValue)); + } } else if (HttpHeader.CONNECTION.equals(header)) { list.add(new RequestClientConnControl()); @@ -934,6 +979,45 @@ public void process(final HttpRequest request, final HttpContext context) throws } } + private static final class SecFetchModeHeaderHttpRequestInterceptor implements HttpRequestInterceptor { + private String value_; + + SecFetchModeHeaderHttpRequestInterceptor(final String value) { + value_ = value; + } + + @Override + public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException { + request.setHeader(HttpHeader.SEC_FETCH_MODE, value_); + } + } + + private static final class SecFetchSiteHeaderHttpRequestInterceptor implements HttpRequestInterceptor { + private String value_; + + SecFetchSiteHeaderHttpRequestInterceptor(final String value) { + value_ = value; + } + + @Override + public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException { + request.setHeader(HttpHeader.SEC_FETCH_SITE, value_); + } + } + + private static final class SecFetchUserHeaderHttpRequestInterceptor implements HttpRequestInterceptor { + private String value_; + + SecFetchUserHeaderHttpRequestInterceptor(final String value) { + value_ = value; + } + + @Override + public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException { + request.setHeader(HttpHeader.SEC_FETCH_USER, value_); + } + } + private static class MultiHttpRequestInterceptor implements HttpRequestInterceptor { private final Map map_; @@ -986,10 +1070,8 @@ public synchronized String toString() { */ @Override public void close() { - final Thread current = Thread.currentThread(); - if (httpClientBuilder_.get(current) != null) { - httpClientBuilder_.remove(current); - } + httpClientBuilder_.clear(); + if (connectionManager_ != null) { connectionManager_.shutdown(); connectionManager_ = null; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ImmediateRefreshHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/ImmediateRefreshHandler.java index 8a4085c7dbe..54e72e1837e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ImmediateRefreshHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ImmediateRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListener.java b/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListener.java index cb56db914a9..06639f0a2d4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListenerImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListenerImpl.java index 06c45fa2c05..ec1742c8559 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListenerImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/IncorrectnessListenerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/MockWebConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/MockWebConnection.java index ff1754ef976..64db6e22700 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/MockWebConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/MockWebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; +import com.gargoylesoftware.htmlunit.util.TextUtils; /** * A fake {@link WebConnection} designed to mock out the actual HTTP connections. @@ -44,6 +46,13 @@ public class MockWebConnection implements WebConnection { private static final Log LOG = LogFactory.getLog(MockWebConnection.class); + private final Map throwableMap_ = new HashMap<>(); + private final Map responseMap_ = new HashMap<>(); + private RawResponseData defaultResponse_; + private WebRequest lastRequest_; + private int requestCount_; + private final List requestedUrls_ = Collections.synchronizedList(new ArrayList()); + /** * Contains the raw data configured for a response. */ @@ -94,7 +103,7 @@ else if (stringContent_ == null) { content = new byte[] {}; } else { - content = TextUtil.stringToByteArray(stringContent_, charset_); + content = TextUtils.stringToByteArray(stringContent_, charset_); } return new WebResponseData(content, statusCode_, statusMessage_, headers_); } @@ -148,12 +157,6 @@ public Charset getCharset() { } } - private final Map responseMap_ = new HashMap<>(10); - private RawResponseData defaultResponse_; - private WebRequest lastRequest_; - private int requestCount_ = 0; - private final List requestedUrls_ = Collections.synchronizedList(new ArrayList()); - /** * {@inheritDoc} */ @@ -167,8 +170,9 @@ public WebResponse getResponse(final WebRequest request) throws IOException { * Gets the raw response configured for the request. * @param request the request * @return the raw response + * @throws IOException if defined */ - public RawResponseData getRawResponse(final WebRequest request) { + public RawResponseData getRawResponse(final WebRequest request) throws IOException { final URL url = request.getUrl(); if (LOG.isDebugEnabled()) { @@ -180,6 +184,11 @@ public RawResponseData getRawResponse(final WebRequest request) { requestedUrls_.add(url); String urlString = url.toExternalForm(); + final IOException throwable = throwableMap_.get(urlString); + if (throwable != null) { + throw throwable; + } + RawResponseData rawResponse = responseMap_.get(urlString); if (rawResponse == null) { // try to find without query params @@ -203,6 +212,14 @@ public RawResponseData getRawResponse(final WebRequest request) { return rawResponse; } + /** + * Gets the list of requested URLs. + * @return the list of relative URLs + */ + public List getRequestedUrls() { + return Collections.unmodifiableList(requestedUrls_); + } + /** * Gets the list of requested URLs relative to the provided URL. * @param relativeTo what should be removed from the requested URLs. @@ -219,7 +236,7 @@ public List getRequestedUrls(final URL relativeTo) { response.add(s); } - return response; + return Collections.unmodifiableList(response); } /** @@ -282,6 +299,15 @@ public void setResponse(final URL url, final String content, final int statusCod responseMap_.put(url.toExternalForm(), responseEntry); } + /** + * Sets the exception that will be thrown when the specified URL is requested. + * @param url the URL that will force the exception + * @param throwable the Throwable + */ + public void setThrowable(final URL url, final IOException throwable) { + throwableMap_.put(url.toExternalForm(), throwable); + } + /** * Sets the response that will be returned when the specified URL is requested. * @param url the URL that will return the given response @@ -323,7 +349,7 @@ private static RawResponseData buildRawResponseData(final String content, Charse * @param content the content to return */ public void setResponse(final URL url, final String content) { - setResponse(url, content, 200, "OK", "text/html", null); + setResponse(url, content, 200, "OK", MimeType.TEXT_HTML, null); } /** @@ -403,7 +429,7 @@ public void setDefaultResponse(final byte[] content, final int statusCode, * @param content the content to return */ public void setDefaultResponse(final String content) { - setDefaultResponse(content, 200, "OK", "text/html"); + setDefaultResponse(content, 200, "OK", MimeType.TEXT_HTML); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/NiceRefreshHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/NiceRefreshHandler.java index 2aa1ef377cc..d167a3df928 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/NiceRefreshHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/NiceRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/NicelyResynchronizingAjaxController.java b/src/main/java/com/gargoylesoftware/htmlunit/NicelyResynchronizingAjaxController.java index 5c3dc068d26..34ffcfee814 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/NicelyResynchronizingAjaxController.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/NicelyResynchronizingAjaxController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/annotations/BuildServerDiscrepancy.java b/src/main/java/com/gargoylesoftware/htmlunit/NotYetImplementedException.java similarity index 53% rename from src/test/java/com/gargoylesoftware/htmlunit/annotations/BuildServerDiscrepancy.java rename to src/main/java/com/gargoylesoftware/htmlunit/NotYetImplementedException.java index 18734bda4a3..90436117b1f 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/annotations/BuildServerDiscrepancy.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/NotYetImplementedException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,20 +12,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +package com.gargoylesoftware.htmlunit; /** - * An annotation to denote a test which behaves on the build server different than locally. + * Thrown if a method is not yet implemented for some reason + * but at least available from js. * - * @author Ahmed Ashour + * @author Ronald Brill */ -@Retention(RetentionPolicy.SOURCE) -@Target(ElementType.METHOD) -public @interface BuildServerDiscrepancy { +public class NotYetImplementedException extends RuntimeException { + /** + * Creates a new instance. + * @param method the not yet implemented method + */ + public NotYetImplementedException(final String method) { + super("Method '" + method + "' is not yet implemented."); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ObjectInstantiationException.java b/src/main/java/com/gargoylesoftware/htmlunit/ObjectInstantiationException.java index a2e0da5e52b..58ea1c56560 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ObjectInstantiationException.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ObjectInstantiationException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/OnbeforeunloadHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/OnbeforeunloadHandler.java index db1b25bd5d2..a843772c39f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/OnbeforeunloadHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/OnbeforeunloadHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,15 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.Serializable; + /** * A handler for onbeforeunload events. * * @author Ahmed Ashour + * @author Ronald Brill */ -public interface OnbeforeunloadHandler { +public interface OnbeforeunloadHandler extends Serializable { /** * Handles an onbeforeunload event for the specified page. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/Page.java b/src/main/java/com/gargoylesoftware/htmlunit/Page.java index 03ffd01962e..af6ae51eb00 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/Page.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/Page.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/PageCreator.java b/src/main/java/com/gargoylesoftware/htmlunit/PageCreator.java index 9900f77ab19..a9d40001d47 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/PageCreator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/PageCreator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ import java.io.IOException; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParser; + /** * Something that knows how to create a page object. It is also the responsibility * of the page creator to establish the relationship between the webWindow @@ -35,7 +37,13 @@ public interface PageCreator { * @exception IOException If an io problem occurs * @return the new page */ - Page createPage(WebResponse webResponse, WebWindow webWindow) - throws IOException; + Page createPage(WebResponse webResponse, WebWindow webWindow) throws IOException; + + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * @return the HTMLParser in use + */ + HTMLParser getHtmlParser(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/PluginConfiguration.java b/src/main/java/com/gargoylesoftware/htmlunit/PluginConfiguration.java index 818157709a9..08e0d5a258c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/PluginConfiguration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/PluginConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/PromptHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/PromptHandler.java index d69f43a16bf..28879de3710 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/PromptHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/PromptHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,17 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.Serializable; + /** * A handler for JavaScript window.prompt(). Prompts are triggered when the JavaScript * method Window.prompt() is called. * * @author Mike Bowler * @author Ahmed Ashour + * @author Ronald Brill */ -public interface PromptHandler { +public interface PromptHandler extends Serializable { /** * Handle a call to Window.prompt() for the given page. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ProxyAutoConfig.java b/src/main/java/com/gargoylesoftware/htmlunit/ProxyAutoConfig.java index 2c7e06341b9..28a8c02494f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ProxyAutoConfig.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ProxyAutoConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,8 +37,10 @@ * @see PAC file format * * @author Ahmed Ashour + * @author Ronald Brill */ public final class ProxyAutoConfig { + private static final String TIMEZONE_GMT = "GMT"; private ProxyAutoConfig() { } @@ -53,7 +55,7 @@ public static String evaluate(final String content, final URL url) { final Context cx = Context.enter(); try { final ProxyAutoConfig config = new ProxyAutoConfig(); - final Scriptable scope = cx.initStandardObjects(); + final Scriptable scope = cx.initSafeStandardObjects(); config.defineMethod("isPlainHostName", scope); config.defineMethod("dnsDomainIs", scope); @@ -212,10 +214,11 @@ public static boolean shExpMatch(final String str, final String shexp) { */ public static boolean weekdayRange(final String wd1, Object wd2, final Object gmt) { TimeZone timezone = TimeZone.getDefault(); - if ("GMT".equals(Context.toString(gmt)) || "GMT".equals(Context.toString(wd2))) { - timezone = TimeZone.getTimeZone("GMT"); + if (TIMEZONE_GMT.equals(Context.toString(gmt)) + || TIMEZONE_GMT.equals(Context.toString(wd2))) { + timezone = TimeZone.getTimeZone(TIMEZONE_GMT); } - if (wd2 == Undefined.instance || "GMT".equals(Context.toString(wd2))) { + if (Undefined.isUndefined(wd2) || TIMEZONE_GMT.equals(Context.toString(wd2))) { wd2 = wd1; } final Calendar calendar = Calendar.getInstance(timezone); @@ -252,17 +255,22 @@ public static boolean dateRange(final String value1, final Object value2, final //actual values length int length; for (length = values.length - 1; length >= 0; length--) { - if ("GMT".equals(Context.toString(values[length]))) { - timezone = TimeZone.getTimeZone("GMT"); + if (TIMEZONE_GMT.equals(Context.toString(values[length]))) { + timezone = TimeZone.getTimeZone(TIMEZONE_GMT); break; } - else if (values[length] != Undefined.instance) { + else if (!Undefined.isUndefined(values[length])) { length++; break; } } - final int day1, day2, month1, month2, year1, year2; + final int day1; + final int day2; + final int month1; + final int month2; + final int year1; + final int year2; final Calendar cal1; final Calendar cal2; switch (length) { @@ -397,17 +405,22 @@ public static boolean timeRange(final String value1, final Object value2, final //actual values length int length; for (length = values.length - 1; length >= 0; length--) { - if ("GMT".equals(Context.toString(values[length]))) { - timezone = TimeZone.getTimeZone("GMT"); + if (TIMEZONE_GMT.equals(Context.toString(values[length]))) { + timezone = TimeZone.getTimeZone(TIMEZONE_GMT); break; } - else if (values[length] != Undefined.instance) { + else if (!Undefined.isUndefined(values[length])) { length++; break; } } - final int hour1, hour2, min1, min2, second1, second2; + final int hour1; + final int hour2; + final int min1; + final int min2; + final int second1; + final int second2; final Calendar cal1; final Calendar cal2; switch (length) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ProxyConfig.java b/src/main/java/com/gargoylesoftware/htmlunit/ProxyConfig.java index 779c871fa40..a53ecf38d64 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ProxyConfig.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ProxyConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/RefreshHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/RefreshHandler.java index ab173824d7d..90dc3867003 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/RefreshHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/RefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ScriptException.java b/src/main/java/com/gargoylesoftware/htmlunit/ScriptException.java index 0b5a9f328ed..662a74e2f5c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ScriptException.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ScriptException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ScriptPreProcessor.java b/src/main/java/com/gargoylesoftware/htmlunit/ScriptPreProcessor.java index bb91a1018df..af04cf1c72f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ScriptPreProcessor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ScriptPreProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ScriptResult.java b/src/main/java/com/gargoylesoftware/htmlunit/ScriptResult.java index ada80d54073..1a1f8d3c4e0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ScriptResult.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ScriptResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,18 +27,13 @@ public final class ScriptResult { /** The object that was returned from the script engine. */ private final Object javaScriptResult_; - /** The page that is currently loaded at the end of the script execution. */ - private final Page newPage_; - /** * Creates a new instance. * * @param javaScriptResult the object that was returned from the script engine - * @param newPage the page that is currently loaded at the end of the script execution */ - public ScriptResult(final Object javaScriptResult, final Page newPage) { + public ScriptResult(final Object javaScriptResult) { javaScriptResult_ = javaScriptResult; - newPage_ = newPage; } /** @@ -49,20 +44,12 @@ public Object getJavaScriptResult() { return javaScriptResult_; } - /** - * Returns the page that is loaded at the end of the script execution. - * @return the new page - */ - public Page getNewPage() { - return newPage_; - } - /** * {@inheritDoc} */ @Override public String toString() { - return "ScriptResult[result=" + javaScriptResult_ + " page=" + newPage_ + "]"; + return "ScriptResult[result=" + javaScriptResult_ + "]"; } /** @@ -80,73 +67,6 @@ public static boolean isFalse(final ScriptResult scriptResult) { * @return {@code true} if scriptResult is undefined (there was no return value) */ public static boolean isUndefined(final ScriptResult scriptResult) { - return scriptResult != null && scriptResult.getJavaScriptResult() instanceof Undefined; + return scriptResult != null && Undefined.isUndefined(scriptResult.getJavaScriptResult()); } - - /** - * Creates and returns a composite {@link ScriptResult} based on the two input {@link ScriptResult}s. This - * method defines how the return values for multiple event handlers are combined during event capturing and - * bubbling. The behavior of this method varies based on whether or not we are emulating IE. - * - * @param newResult the new {@link ScriptResult} (may be {@code null}) - * @param originalResult the original {@link ScriptResult} (may be {@code null}) - * @param ie whether or not we are emulating IE - * @return a composite {@link ScriptResult}, based on the two input {@link ScriptResult}s - */ - public static ScriptResult combine(final ScriptResult newResult, final ScriptResult originalResult, - final boolean ie) { - - final Object jsResult; - final Page page; - - // If we're emulating IE, the overall JavaScript return value is the last return value. - // If we're emulating FF, the overall JavaScript return value is false if the return value - // was false at any level. - if (ie) { - if (newResult != null && !ScriptResult.isUndefined(newResult)) { - jsResult = newResult.getJavaScriptResult(); - } - else if (originalResult != null) { - jsResult = originalResult.getJavaScriptResult(); - } - else if (newResult != null) { - jsResult = newResult.getJavaScriptResult(); - } - else { - jsResult = null; - } - } - else { - if (ScriptResult.isFalse(newResult)) { - jsResult = newResult.getJavaScriptResult(); - } - else if (originalResult != null) { - jsResult = originalResult.getJavaScriptResult(); - } - else if (newResult != null) { - jsResult = newResult.getJavaScriptResult(); - } - else { - jsResult = null; - } - } - - // The new page is always the newest page. - if (newResult != null) { - page = newResult.getNewPage(); - } - else if (originalResult != null) { - page = originalResult.getNewPage(); - } - else { - page = null; - } - - // Build and return the composite script result. - if (jsResult == null && page == null) { - return null; - } - return new ScriptResult(jsResult, page); - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java b/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java index 190f566f94c..0e3aa04a934 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/SgmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit; -import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; import java.util.Comparator; @@ -88,14 +87,6 @@ public WebResponse getWebResponse() { return webResponse_; } - /** - * {@inheritDoc} - */ - @Override - public void initialize() throws IOException { - // nothing to do here - } - /** * Gets the name for the current node. * @return the node name @@ -111,7 +102,7 @@ public String getNodeName() { */ @Override public short getNodeType() { - return org.w3c.dom.Node.DOCUMENT_NODE; + return DOCUMENT_NODE; } /** @@ -277,6 +268,10 @@ public DomAttr createAttribute(final String name) { */ @Override public URL getUrl() { + final WebResponse wr = getWebResponse(); + if (null == wr) { + return WebClient.URL_ABOUT_BLANK; + } return getWebResponse().getWebRequest().getUrl(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/SilentCssErrorHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/SilentCssErrorHandler.java index 4c6a8e6dc5e..e279d79e136 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/SilentCssErrorHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/SilentCssErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/StatusHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/StatusHandler.java index c52666ba59c..e24e6ee53da 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/StatusHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/StatusHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,15 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.Serializable; + /** * A handler for changes to window.status. * * @author Mike Bowler + * @author Ronald Brill */ -public interface StatusHandler { +public interface StatusHandler extends Serializable { /** * Handles a change to window.status. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/StorageHolder.java b/src/main/java/com/gargoylesoftware/htmlunit/StorageHolder.java index ee8385d17cf..e730f3a0ccd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/StorageHolder.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/StorageHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/StringWebResponse.java b/src/main/java/com/gargoylesoftware/htmlunit/StringWebResponse.java index 1892446c15e..79133cdf7fe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/StringWebResponse.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/StringWebResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.apache.http.HttpStatus; import com.gargoylesoftware.htmlunit.util.NameValuePair; +import com.gargoylesoftware.htmlunit.util.TextUtils; /** * A simple WebResponse created from a string. Content is assumed to be of type text/html. @@ -67,7 +68,7 @@ public StringWebResponse(final String content, final Charset charset, final URL * @return a simple WebResponseData with defaults specified */ private static WebResponseData getWebResponseData(final String contentString, final Charset charset) { - final byte[] content = TextUtil.stringToByteArray(contentString, charset); + final byte[] content = TextUtils.stringToByteArray(contentString, charset); final List compiledHeaders = new ArrayList<>(); compiledHeaders.add(new NameValuePair(HttpHeader.CONTENT_TYPE, "text/html; charset=" + charset)); return new WebResponseData(content, HttpStatus.SC_OK, "OK", compiledHeaders); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/TextPage.java b/src/main/java/com/gargoylesoftware/htmlunit/TextPage.java index 19b44bf1932..57884c11049 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/TextPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/TextPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,12 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; + /** * A generic page that will be returned for any text related content. * Specifically any content types that start with {@code text/} @@ -43,4 +49,17 @@ public TextPage(final WebResponse webResponse, final WebWindow enclosingWindow) public String getContent() { return getWebResponse().getContentAsString(); } + + /** + * Saves the content of this page to a text file. + * + * @param file file to write this page into + * @throws IOException If an error occurs + */ + public void save(final File file) throws IOException { + final Path savePath = file.toPath(); + final String text = getContent(); + final Charset charset = getWebResponse().getContentCharset(); + Files.write(savePath, text.getBytes(charset)); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/ThreadedRefreshHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/ThreadedRefreshHandler.java index 281a6a8c9f3..cc68fd169b6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/ThreadedRefreshHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/ThreadedRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/TopLevelWindow.java b/src/main/java/com/gargoylesoftware/htmlunit/TopLevelWindow.java index 52c95f59d6b..3b3e1a1d94b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/TopLevelWindow.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/TopLevelWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/UnexpectedPage.java b/src/main/java/com/gargoylesoftware/htmlunit/UnexpectedPage.java index bad12e4bf43..8e4fcc41e4e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/UnexpectedPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/UnexpectedPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/Version.java b/src/main/java/com/gargoylesoftware/htmlunit/Version.java index 26eabcfc2e6..fc352c28c81 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/Version.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/Version.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,6 +78,6 @@ public static String getProductVersion() { * @return the copyright notice */ public static String getCopyright() { - return "Copyright (c) 2002-2018 Gargoyle Software Inc. All rights reserved."; + return "Copyright (c) 2002-2020 Gargoyle Software Inc. All rights reserved."; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WaitingRefreshHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/WaitingRefreshHandler.java index ec099b9e864..a672d3ac385 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WaitingRefreshHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WaitingRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebAssert.java b/src/main/java/com/gargoylesoftware/htmlunit/WebAssert.java index ae3a2bc2fa4..a76e04c6592 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebAssert.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebAssert.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java b/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java index 8d1e1c7f350..e390e66f1b2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.DIALOGWINDOW_REFERER; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTTP_HEADER_SEC_FETCH; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTTP_HEADER_UPGRADE_INSECURE_REQUEST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTTP_REDIRECT_308; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_SUPPORT_VIA_ACTIVEXOBJECT; @@ -25,7 +26,6 @@ import java.io.BufferedInputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; @@ -36,12 +36,11 @@ import java.net.URLConnection; import java.net.URLDecoder; import java.nio.charset.Charset; -import java.util.ArrayDeque; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Collections; import java.util.ConcurrentModificationException; import java.util.Date; -import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -68,15 +67,14 @@ import com.gargoylesoftware.css.parser.CSSErrorHandler; import com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLActiveXObjectFactory; -import com.gargoylesoftware.htmlunit.attachment.Attachment; import com.gargoylesoftware.htmlunit.attachment.AttachmentHandler; import com.gargoylesoftware.htmlunit.html.BaseFrameElement; import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.FrameWindow; -import com.gargoylesoftware.htmlunit.html.HTMLParserListener; import com.gargoylesoftware.htmlunit.html.HtmlInlineFrame; import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParserListener; import com.gargoylesoftware.htmlunit.httpclient.HtmlUnitBrowserCompatCookieSpec; import com.gargoylesoftware.htmlunit.javascript.AbstractJavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.DefaultJavaScriptErrorListener; @@ -93,7 +91,9 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLIFrameElement; import com.gargoylesoftware.htmlunit.protocol.data.DataURLConnection; import com.gargoylesoftware.htmlunit.util.Cookie; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; +import com.gargoylesoftware.htmlunit.util.TextUtils; import com.gargoylesoftware.htmlunit.util.UrlUtils; import com.gargoylesoftware.htmlunit.webstart.WebStartHandler; @@ -170,7 +170,8 @@ public class WebClient implements Serializable, AutoCloseable { private PageCreator pageCreator_ = new DefaultPageCreator(); private final Set webWindowListeners_ = new HashSet<>(5); - private final Deque topLevelWindows_ = new ArrayDeque<>(); // top-level windows + private final List topLevelWindows_ = + Collections.synchronizedList(new ArrayList()); // top-level windows private final List windows_ = Collections.synchronizedList(new ArrayList()); // all windows private transient List> jobManagers_ = Collections.synchronizedList(new ArrayList>()); @@ -205,7 +206,8 @@ public class WebClient implements Serializable, AutoCloseable { private JavaScriptErrorListener javaScriptErrorListener_ = new DefaultJavaScriptErrorListener(); private WebClientOptions options_ = new WebClientOptions(); - private WebClientInternals internals_ = new WebClientInternals(this); + private final boolean javaScriptEngineEnabled_; + private WebClientInternals internals_ = new WebClientInternals(); private final StorageHolder storageHolder_ = new StorageHolder(); private static final WebResponseData responseDataNoHttpResponse_ = new WebResponseData( @@ -234,9 +236,23 @@ public WebClient(final BrowserVersion browserVersion) { * @param proxyPort the port to use on the proxy server */ public WebClient(final BrowserVersion browserVersion, final String proxyHost, final int proxyPort) { + this(browserVersion, true, proxyHost, proxyPort); + } + + /** + * Creates an instance that will use the specified {@link BrowserVersion} and proxy server. + * @param browserVersion the browser version to simulate + * @param javaScriptEngineEnabled set to false if the simulated browser should not support javaScript + * @param proxyHost the server that will act as proxy or null for no proxy + * @param proxyPort the port to use on the proxy server + */ + public WebClient(final BrowserVersion browserVersion, final boolean javaScriptEngineEnabled, + final String proxyHost, final int proxyPort) { WebAssert.notNull("browserVersion", browserVersion); browserVersion_ = browserVersion; + javaScriptEngineEnabled_ = javaScriptEngineEnabled; + if (proxyHost == null) { getOptions().setProxyConfig(new ProxyConfig()); } @@ -245,16 +261,21 @@ public WebClient(final BrowserVersion browserVersion, final String proxyHost, fi } webConnection_ = new HttpWebConnection(this); // this has to be done after the browser version was set - scriptEngine_ = new JavaScriptEngine(this); + if (javaScriptEngineEnabled_) { + scriptEngine_ = new JavaScriptEngine(this); + } loadQueue_ = new ArrayList<>(); // The window must be constructed AFTER the script engine. addWebWindowListener(new CurrentWindowTracker(this)); currentWindow_ = new TopLevelWindow("", this); - fireWindowOpened(new WebWindowEvent(currentWindow_, WebWindowEvent.OPEN, null, null)); - if (getBrowserVersion().hasFeature(JS_XML_SUPPORT_VIA_ACTIVEXOBJECT)) { - initMSXMLActiveX(); + if (isJavaScriptEnabled()) { + fireWindowOpened(new WebWindowEvent(currentWindow_, WebWindowEvent.OPEN, null, null)); + + if (getBrowserVersion().hasFeature(JS_XML_SUPPORT_VIA_ACTIVEXOBJECT)) { + initMSXMLActiveX(); + } } } @@ -358,7 +379,7 @@

P getPage(final WebWindow webWindow, final WebRequest webReques webWindow.getHistory().addPage(page); } - final Window window = (Window) webWindow.getScriptableObject(); + final Window window = webWindow.getScriptableObject(); if (window != null) { // js enabled window.getLocation().setHash(current.getRef()); window.clearComputedStyles(); @@ -460,8 +481,11 @@ public

P getPage(final String url) throws IOException, FailingH */ @SuppressWarnings("unchecked") public

P getPage(final URL url) throws IOException, FailingHttpStatusCodeException { - return (P) getPage(getCurrentWindow().getTopWindow(), - new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader())); + final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader(), + getBrowserVersion().getAcceptEncodingHeader()); + request.setCharset(UTF_8); + + return (P) getPage(getCurrentWindow().getTopWindow(), request); } /** @@ -512,7 +536,7 @@ public Page loadWebResponseInto(final WebResponse webResponse, final WebWindow w return webWindow.getEnclosedPage(); } - if (attachmentHandler_ != null && Attachment.isAttachment(webResponse)) { + if (attachmentHandler_ != null && attachmentHandler_.isAttachment(webResponse)) { final WebWindow w = openWindow(null, null, webWindow); final Page page = pageCreator_.createPage(webResponse, w); attachmentHandler_.handleAttachment(page); @@ -536,7 +560,8 @@ public Page loadWebResponseInto(final WebResponse webResponse, final WebWindow w newPage.initialize(); // hack: onload should be fired the same way for all type of pages // here is a hack to handle non HTML pages - if (webWindow instanceof FrameWindow && !newPage.isHtmlPage()) { + if (isJavaScriptEnabled() + && webWindow instanceof FrameWindow && !newPage.isHtmlPage()) { final FrameWindow fw = (FrameWindow) webWindow; final BaseFrameElement frame = fw.getFrameElement(); if (frame.hasEventHandlers("onload")) { @@ -565,7 +590,7 @@ public void printContentIfNecessary(final WebResponse webResponse) { if (getOptions().isPrintContentOnFailingStatusCode()) { final int statusCode = webResponse.getStatusCode(); final boolean successful = statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES; - if (!successful) { + if (!successful && LOG.isInfoEnabled()) { final String contentType = webResponse.getContentType(); LOG.info("statusCode=[" + statusCode + "] contentType=[" + contentType + "]"); LOG.info(webResponse.getContentAsString()); @@ -804,10 +829,10 @@ public void setCurrentWindow(final WebWindow window) { //2. onFocus event is triggered for focusedElement of new current window final Page enclosedPage = currentWindow_.getEnclosedPage(); if (enclosedPage != null && enclosedPage.isHtmlPage()) { - final Object jsWindow = currentWindow_.getScriptableObject(); - if (jsWindow instanceof Window) { + final Window jsWindow = currentWindow_.getScriptableObject(); + if (jsWindow != null) { final HTMLElement activeElement = - ((HTMLDocument) ((Window) jsWindow).getDocument()).getActiveElement(); + ((HTMLDocument) jsWindow.getDocument()).getActiveElement(); if (activeElement != null) { ((HtmlPage) enclosedPage).setFocusedElement(activeElement.getDomNodeOrDie(), true); } @@ -877,12 +902,16 @@ public WebWindow openWindow(final URL url, final String windowName) { */ public WebWindow openWindow(final URL url, final String windowName, final WebWindow opener) { final WebWindow window = openTargetWindow(opener, windowName, TARGET_BLANK); - final HtmlPage openerPage = (HtmlPage) opener.getEnclosedPage(); if (url != null) { try { - final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader()); + final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader(), + getBrowserVersion().getAcceptEncodingHeader()); + request.setCharset(UTF_8); + + final Page openerPage = opener.getEnclosedPage(); if (getBrowserVersion().hasFeature(DIALOGWINDOW_REFERER) - && openerPage != null) { + && openerPage != null + && openerPage.getUrl() != null) { final String referer = openerPage.getUrl().toExternalForm(); request.setAdditionalHeader(HttpHeader.REFERER, referer); } @@ -1010,7 +1039,10 @@ public DialogWindow openDialogWindow(final URL url, final WebWindow opener, fina fireWindowOpened(new WebWindowEvent(window, WebWindowEvent.OPEN, null, null)); final HtmlPage openerPage = (HtmlPage) opener.getEnclosedPage(); - final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader()); + final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader(), + getBrowserVersion().getAcceptEncodingHeader()); + request.setCharset(UTF_8); + if (getBrowserVersion().hasFeature(DIALOGWINDOW_REFERER) && openerPage != null) { final String referer = openerPage.getUrl().toExternalForm(); request.setAdditionalHeader(HttpHeader.REFERER, referer); @@ -1070,7 +1102,10 @@ public WebWindow getWebWindowByName(final String name) throws WebWindowNotFoundE */ public void initialize(final WebWindow webWindow) { WebAssert.notNull("webWindow", webWindow); - scriptEngine_.initialize(webWindow); + + if (isJavaScriptEngineEnabled()) { + scriptEngine_.initialize(webWindow); + } } /** @@ -1081,9 +1116,10 @@ public void initialize(final WebWindow webWindow) { */ public void initialize(final Page newPage) { WebAssert.notNull("newPage", newPage); - final WebWindow webWindow = newPage.getEnclosingWindow(); - if (webWindow.getScriptableObject() instanceof Window) { - ((Window) webWindow.getScriptableObject()).initialize(newPage); + + if (isJavaScriptEngineEnabled()) { + final Window window = newPage.getEnclosingWindow().getScriptableObject(); + window.initialize(newPage); } } @@ -1096,8 +1132,11 @@ public void initialize(final Page newPage) { */ public void initializeEmptyWindow(final WebWindow webWindow) { WebAssert.notNull("webWindow", webWindow); - initialize(webWindow); - ((Window) webWindow.getScriptableObject()).initialize(); + + if (isJavaScriptEngineEnabled()) { + initialize(webWindow); + ((Window) webWindow.getScriptableObject()).initialize(); + } } /** @@ -1166,10 +1205,11 @@ private WebResponse makeWebResponseForDataUrl(final WebRequest webRequest) throw } } - private static WebResponse makeWebResponseForAboutUrl(final URL url) { + private static WebResponse makeWebResponseForAboutUrl(final WebRequest webRequest) throws MalformedURLException { + final URL url = webRequest.getUrl(); final String urlWithoutQuery = StringUtils.substringBefore(url.toExternalForm(), "?"); if (!"blank".equalsIgnoreCase(StringUtils.substringAfter(urlWithoutQuery, WebClient.ABOUT_SCHEME))) { - throw new IllegalArgumentException(url + " is not supported, only about:blank is supported now."); + throw new MalformedURLException(url + " is not supported, only about:blank is supported now."); } return new StringWebResponse("", URL_ABOUT_BLANK); } @@ -1205,10 +1245,10 @@ private WebResponse makeWebResponseForFileUrl(final WebRequest webRequest) throw if (!file.exists()) { // construct 404 final List compiledHeaders = new ArrayList<>(); - compiledHeaders.add(new NameValuePair(HttpHeader.CONTENT_TYPE, "text/html")); + compiledHeaders.add(new NameValuePair(HttpHeader.CONTENT_TYPE, MimeType.TEXT_HTML)); final WebResponseData responseData = new WebResponseData( - TextUtil.stringToByteArray("File: " + file.getAbsolutePath(), UTF_8), + TextUtils.stringToByteArray("File: " + file.getAbsolutePath(), UTF_8), 404, "Not Found", compiledHeaders); return new WebResponse(responseData, webRequest, 0); } @@ -1238,20 +1278,20 @@ public String guessContentType(final File file) { final String fileName = file.getName(); if (fileName.endsWith(".xhtml")) { // Java's mime type map returns application/xml in JDK8. - return "application/xhtml+xml"; + return MimeType.APPLICATION_XHTML; } // Java's mime type map does not know these in JDK8. if (fileName.endsWith(".js")) { - return "application/javascript"; + return MimeType.APPLICATION_JAVASCRIPT; } if (fileName.toLowerCase(Locale.ROOT).endsWith(".css")) { - return "text/css"; + return MimeType.TEXT_CSS; } String contentType = URLConnection.guessContentTypeFromName(fileName); if (contentType == null) { - try (InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) { + try (InputStream inputStream = new BufferedInputStream(Files.newInputStream(file.toPath()))) { contentType = URLConnection.guessContentTypeFromStream(inputStream); } catch (final IOException e) { @@ -1259,7 +1299,7 @@ public String guessContentType(final File file) { } } if (contentType == null) { - contentType = "application/octet-stream"; + contentType = MimeType.APPLICATION_OCTET_STREAM; } return contentType; } @@ -1280,7 +1320,7 @@ private WebResponse makeWebResponseForJavaScriptUrl(final WebWindow webWindow, f } if (page == null) { - page = getPage(webWindow, new WebRequest(WebClient.URL_ABOUT_BLANK)); + page = getPage(webWindow, WebRequest.newAboutBlankRequest()); } final ScriptResult r = page.executeJavaScript(url.toExternalForm(), "JavaScript URL", 1); if (r.getJavaScriptResult() == null || ScriptResult.isUndefined(r)) { @@ -1303,7 +1343,7 @@ private WebResponse makeWebResponseForJavaScriptUrl(final WebWindow webWindow, f public WebResponse loadWebResponse(final WebRequest webRequest) throws IOException { switch (webRequest.getUrl().getProtocol()) { case "about": - return makeWebResponseForAboutUrl(webRequest.getUrl()); + return makeWebResponseForAboutUrl(webRequest); case "file": return makeWebResponseForFileUrl(webRequest); @@ -1312,8 +1352,7 @@ public WebResponse loadWebResponse(final WebRequest webRequest) throws IOExcepti return makeWebResponseForDataUrl(webRequest); default: - return loadWebResponseFromWebConnection(webRequest, ALLOWED_REDIRECTIONS_SAME_URL, - webRequest.getCharset()); + return loadWebResponseFromWebConnection(webRequest, ALLOWED_REDIRECTIONS_SAME_URL); } } @@ -1321,12 +1360,11 @@ public WebResponse loadWebResponse(final WebRequest webRequest) throws IOExcepti * Loads a {@link WebResponse} from the server through the WebConnection. * @param webRequest the request * @param allowedRedirects the number of allowed redirects remaining - * @param charset the charset to use * @throws IOException if an IO problem occurs * @return the resultant {@link WebResponse} */ private WebResponse loadWebResponseFromWebConnection(final WebRequest webRequest, - final int allowedRedirects, final Charset charset) throws IOException { + final int allowedRedirects) throws IOException { URL url = webRequest.getUrl(); final HttpMethod method = webRequest.getHttpMethod(); @@ -1336,7 +1374,8 @@ private WebResponse loadWebResponseFromWebConnection(final WebRequest webRequest WebAssert.notNull("method", method); WebAssert.notNull("parameters", parameters); - url = UrlUtils.encodeUrl(url, getBrowserVersion().hasFeature(URL_MINIMAL_QUERY_ENCODING), charset); + url = UrlUtils.encodeUrl(url, getBrowserVersion().hasFeature(URL_MINIMAL_QUERY_ENCODING), + webRequest.getCharset()); webRequest.setUrl(url); if (LOG.isDebugEnabled()) { @@ -1399,7 +1438,6 @@ else if (!proxyConfig.shouldBypassProxy(webRequest.getUrl().getHost())) { catch (final NoHttpResponseException e) { return new WebResponse(responseDataNoHttpResponse_, webRequest, 0); } - getCache().cacheIfPossible(webRequest, webResponse, null); } // Continue according to the HTTP status code. @@ -1445,25 +1483,32 @@ && getOptions().isRedirectEnabled()) { || status == HttpStatus.SC_MOVED_TEMPORARILY || status == HttpStatus.SC_SEE_OTHER) { final WebRequest wrs = new WebRequest(newUrl, HttpMethod.GET); + wrs.setCharset(webRequest.getCharset()); + if (HttpMethod.HEAD == webRequest.getHttpMethod()) { wrs.setHttpMethod(HttpMethod.HEAD); } for (final Map.Entry entry : webRequest.getAdditionalHeaders().entrySet()) { wrs.setAdditionalHeader(entry.getKey(), entry.getValue()); } - return loadWebResponseFromWebConnection(wrs, allowedRedirects - 1, UTF_8); + return loadWebResponseFromWebConnection(wrs, allowedRedirects - 1); } else if (status == HttpStatus.SC_TEMPORARY_REDIRECT || status == 308) { final WebRequest wrs = new WebRequest(newUrl, webRequest.getHttpMethod()); + wrs.setCharset(webRequest.getCharset()); + wrs.setRequestParameters(parameters); for (final Map.Entry entry : webRequest.getAdditionalHeaders().entrySet()) { wrs.setAdditionalHeader(entry.getKey(), entry.getValue()); } - return loadWebResponseFromWebConnection(wrs, allowedRedirects - 1, UTF_8); + return loadWebResponseFromWebConnection(wrs, allowedRedirects - 1); } } + if (fromCache == null) { + getCache().cacheIfPossible(webRequest, webResponse, null); + } return webResponse; } @@ -1472,21 +1517,42 @@ else if (status == HttpStatus.SC_TEMPORARY_REDIRECT * @param wrs the WebRequestSettings instance to modify */ private void addDefaultHeaders(final WebRequest wrs) { - // Add standard HtmlUnit headers. + // Add user-specified headers to the web request if not present there yet. + requestHeaders_.forEach((name, value) -> { + if (!wrs.isAdditionalHeader(name)) { + wrs.setAdditionalHeader(name, value); + } + }); + + // Add standard HtmlUnit headers to the web request if still not present there yet. if (!wrs.isAdditionalHeader(HttpHeader.ACCEPT_LANGUAGE)) { wrs.setAdditionalHeader(HttpHeader.ACCEPT_LANGUAGE, getBrowserVersion().getBrowserLanguage()); } + + if (getBrowserVersion().hasFeature(HTTP_HEADER_SEC_FETCH) + && !wrs.isAdditionalHeader(HttpHeader.SEC_FETCH_MODE)) { + wrs.setAdditionalHeader(HttpHeader.SEC_FETCH_MODE, "navigate"); + } + if (getBrowserVersion().hasFeature(HTTP_HEADER_SEC_FETCH) + && !wrs.isAdditionalHeader(HttpHeader.SEC_FETCH_SITE)) { + wrs.setAdditionalHeader(HttpHeader.SEC_FETCH_SITE, "same-origin"); + } + if (getBrowserVersion().hasFeature(HTTP_HEADER_SEC_FETCH) + && !wrs.isAdditionalHeader(HttpHeader.SEC_FETCH_USER)) { + wrs.setAdditionalHeader(HttpHeader.SEC_FETCH_USER, "?1"); + } + if (getBrowserVersion().hasFeature(HTTP_HEADER_UPGRADE_INSECURE_REQUEST) && !wrs.isAdditionalHeader(HttpHeader.UPGRADE_INSECURE_REQUESTS)) { wrs.setAdditionalHeader(HttpHeader.UPGRADE_INSECURE_REQUESTS, "1"); } - // Add user-specified headers last so that they can override HtmlUnit defaults. - wrs.getAdditionalHeaders().putAll(requestHeaders_); } /** * Returns an immutable list of open web windows (whether they are top level windows or not). * This is a snapshot; future changes are not reflected by this list. + *

+ * The list is ordered by age, the oldest one first. * * @return an immutable list of open web windows (whether they are top level windows or not) * @see #getWebWindowByName(String) @@ -1513,6 +1579,8 @@ public boolean containsWebWindow(final WebWindow webWindow) { /** * Returns an immutable list of open top level windows. * This is a snapshot; future changes are not reflected by this list. + *

+ * The list is ordered by age, the oldest one first. * * @return an immutable list of open top level windows * @see #getWebWindowByName(String) @@ -1661,7 +1729,7 @@ public IncorrectnessListener getIncorrectnessListener() { */ public void setIncorrectnessListener(final IncorrectnessListener listener) { if (listener == null) { - throw new NullPointerException("Null incorrectness listener."); + throw new IllegalArgumentException("Null is not a valid IncorrectnessListener"); } incorrectnessListener_ = listener; } @@ -1691,7 +1759,7 @@ public AjaxController getAjaxController() { */ public void setAjaxController(final AjaxController newValue) { if (newValue == null) { - throw new NullPointerException(); + throw new IllegalArgumentException("Null is not a valid AjaxController"); } ajaxController_ = newValue; } @@ -1801,18 +1869,25 @@ public void webWindowClosed(final WebWindowEvent event) { if (webClient_.topLevelWindows_.isEmpty()) { // Must always have at least window, and there are no top-level windows left; must create one. final TopLevelWindow newWindow = new TopLevelWindow("", webClient_); - webClient_.topLevelWindows_.push(newWindow); + webClient_.topLevelWindows_.add(newWindow); webClient_.setCurrentWindow(newWindow); } else { // The current window is now the previous top-level window. - webClient_.setCurrentWindow(webClient_.topLevelWindows_.peek()); + webClient_.setCurrentWindow( + webClient_.topLevelWindows_.get(webClient_.topLevelWindows_.size() - 1)); } } } else if (window == webClient_.getCurrentWindow()) { // The current window is now the last top-level window. - webClient_.setCurrentWindow(webClient_.topLevelWindows_.peek()); + if (webClient_.topLevelWindows_.isEmpty()) { + webClient_.setCurrentWindow(null); + } + else { + webClient_.setCurrentWindow( + webClient_.topLevelWindows_.get(webClient_.topLevelWindows_.size() - 1)); + } } } @@ -1839,7 +1914,7 @@ else if (window instanceof FrameWindow) { // now looks at the visibility of the frame window final BaseFrameElement frameElement = fw.getFrameElement(); - if (frameElement.isDisplayed()) { + if (webClient_.isJavaScriptEnabled() && frameElement.isDisplayed()) { final Object element = frameElement.getScriptableObject(); final HTMLElement htmlElement = (HTMLElement) element; final ComputedCSSStyleDeclaration style = @@ -1861,7 +1936,7 @@ public void webWindowOpened(final WebWindowEvent event) { final WebWindow window = event.getWebWindow(); if (window instanceof TopLevelWindow) { final TopLevelWindow tlw = (TopLevelWindow) window; - webClient_.topLevelWindows_.push(tlw); + webClient_.topLevelWindows_.add(tlw); } // Page is not loaded yet, don't set it now as current window. } @@ -2201,7 +2276,9 @@ public void loadDownloadedResponses() throws FailingHttpStatusCodeException, IOE for (int i = queue.size() - 1; i >= 0; --i) { final LoadJob loadJob = queue.get(i); if (loadJob.isOutdated()) { - LOG.info("No usage of download: " + loadJob); + if (LOG.isInfoEnabled()) { + LOG.info("No usage of download: " + loadJob); + } continue; } @@ -2217,7 +2294,7 @@ public void loadDownloadedResponses() throws FailingHttpStatusCodeException, IOE req.setUrl(loadJob.urlWithOnlyHashChange_); // update location.hash - final Window jsWindow = (Window) win.getScriptableObject(); + final Window jsWindow = win.getScriptableObject(); if (null != jsWindow) { final Location location = jsWindow.getLocation(); location.setHash(oldURL, loadJob.urlWithOnlyHashChange_.getRef()); @@ -2244,7 +2321,9 @@ public void loadDownloadedResponses() throws FailingHttpStatusCodeException, IOE } } else { - LOG.info("No usage of download: " + loadJob); + if (LOG.isInfoEnabled()) { + LOG.info("No usage of download: " + loadJob); + } } } } @@ -2363,4 +2442,25 @@ else if (LOG.isDebugEnabled()) { LOG.debug("Skipped adding cookie: '" + cookieString + "'"); } } + + /** + * Returns true if the javaScript support is enabled. + * To disable the javascript support (eg. temporary) + * you have to use the {@link WebClientOptions#setJavaScriptEnabled(boolean)} setter. + * @see #isJavaScriptEngineEnabled() + * @return true if the javaScript engine and the javaScript support is enabled. + */ + public boolean isJavaScriptEnabled() { + return javaScriptEngineEnabled_ && getOptions().isJavaScriptEnabled(); + } + + /** + * Returns true if the javaScript engine is enabled. + * To disable the javascript engine you have to use the + * {@link WebClient#WebClient(BrowserVersion, boolean, String, int)} constructor. + * @return true if the javaScript engine is enabled. + */ + public boolean isJavaScriptEngineEnabled() { + return javaScriptEngineEnabled_; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebClientInternals.java b/src/main/java/com/gargoylesoftware/htmlunit/WebClientInternals.java index 601e396bfcc..34d7fe19fb5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebClientInternals.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebClientInternals.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,14 +27,13 @@ * Represents a ways to get notified about internal objects. * * @author Ahmed Ashour + * @author Ronald Brill */ public class WebClientInternals implements Serializable { - private final WebClient webClient_; private Collection listeners_; - WebClientInternals(final WebClient webClient) { - webClient_ = webClient; + WebClientInternals() { } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebClientOptions.java b/src/main/java/com/gargoylesoftware/htmlunit/WebClientOptions.java index b9642d7d285..bd14811a7f7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebClientOptions.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebClientOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -335,20 +335,6 @@ public void setPrintContentOnFailingStatusCode(final boolean enabled) { printContentOnFailingStatusCode_ = enabled; } - /** - * Returns {@code true} if the content of the resulting document will be printed to - * the console in the event of a failing response code. - * - * @return {@code true} if the content of the resulting document will be printed to - * the console in the event of a failing response code - * @see #setPrintContentOnFailingStatusCode - * @deprecated as of 2.27, please use {@link #isPrintContentOnFailingStatusCode()} - */ - @Deprecated - public boolean getPrintContentOnFailingStatusCode() { - return printContentOnFailingStatusCode_; - } - /** * Returns {@code true} if the content of the resulting document will be printed to * the console in the event of a failing response code. @@ -562,7 +548,7 @@ public int getHistorySizeLimit() { /** * Sets the History size limit. HtmlUnit uses SoftReferences<Page> for * storing the pages that are part of the history. If you like to fine tune this - * you can use {@link #getHistoryPageCacheLimit()} to limit the number of page references + * you can use {@link #setHistoryPageCacheLimit(int)} to limit the number of page references * stored by the history. * @param historySizeLimit maximum number of pages in history */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/WebConnection.java index ce1887b2d8c..bfc1cb73fa4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,4 +34,6 @@ public interface WebConnection extends AutoCloseable { */ WebResponse getResponse(WebRequest request) throws IOException; + @Override + void close() throws IOException; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebConsole.java b/src/main/java/com/gargoylesoftware/htmlunit/WebConsole.java index f16cb905770..e751d6fcf05 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebConsole.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebConsole.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,9 @@ */ public class WebConsole implements Serializable { + private Formatter formatter_ = new DefaultFormatter(); + private Logger logger_ = new DefaultLogger(); + /** * A simple logging interface abstracting logging APIs. */ @@ -167,9 +170,6 @@ public interface Formatter { String parameterAsFloat(Object o); } - private Formatter formatter_ = new DefaultFormatter(); - private Logger logger_ = new DefaultLogger(); - /** * Sets the Formatter. * @param formatter the formatter diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/WebRequest.java index 2e65ae17f77..a10517a562d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,11 +72,34 @@ public class WebRequest implements Serializable { * Instantiates a {@link WebRequest} for the specified URL. * @param url the target URL * @param acceptHeader the accept header to use + * @param acceptEncodingHeader the accept encoding header to use */ - public WebRequest(final URL url, final String acceptHeader) { + public WebRequest(final URL url, final String acceptHeader, final String acceptEncodingHeader) { setUrl(url); - setAdditionalHeader(HttpHeader.ACCEPT, acceptHeader); - setAdditionalHeader(HttpHeader.ACCEPT_ENCODING, "gzip, deflate"); + if (acceptHeader != null) { + setAdditionalHeader(HttpHeader.ACCEPT, acceptHeader); + } + if (acceptEncodingHeader != null) { + setAdditionalHeader(HttpHeader.ACCEPT_ENCODING, acceptEncodingHeader); + } + } + + /** + * Instantiates a {@link WebRequest} for the specified URL. + * @param url the target URL + * @param acceptHeader the accept header to use + * @deprecated as of 2.36.0, use {@link #WebRequest(URL, String, String)} instead + */ + @Deprecated + public WebRequest(final URL url, final String acceptHeader) { + this(url, acceptHeader, "gzip, deflate"); + } + + /** + * @return a new request for about:blank + */ + public static WebRequest newAboutBlankRequest() { + return new WebRequest(WebClient.URL_ABOUT_BLANK, "*/*", "gzip, deflate"); } /** @@ -84,7 +107,7 @@ public WebRequest(final URL url, final String acceptHeader) { * @param url the target URL */ public WebRequest(final URL url) { - this(url, "*/*"); + this(url, "*/*", "gzip, deflate"); } /** @@ -359,19 +382,36 @@ public boolean isAdditionalHeader(final String name) { return false; } + /** + * Returns the header value associated with this name. + * @param name the name of the additional HTTP header + * @return the value or null + */ + public String getAdditionalHeader(final String name) { + String newKey = name; + for (final String key : additionalHeaders_.keySet()) { + if (name.equalsIgnoreCase(key)) { + newKey = key; + break; + } + } + return additionalHeaders_.get(newKey); + } + /** * Sets the specified name/value pair in the additional HTTP headers. * @param name the name of the additional HTTP header * @param value the value of the additional HTTP header */ - public void setAdditionalHeader(String name, final String value) { + public void setAdditionalHeader(final String name, final String value) { + String newKey = name; for (final String key : additionalHeaders_.keySet()) { if (name.equalsIgnoreCase(key)) { - name = key; + newKey = key; break; } } - additionalHeaders_.put(name, value); + additionalHeaders_.put(newKey, value); } /** @@ -435,16 +475,15 @@ public void setCharset(final Charset charset) { */ @Override public String toString() { - final StringBuilder builder = new StringBuilder(); + final StringBuilder builder = new StringBuilder(100); builder.append(getClass().getSimpleName()); - builder.append("[<"); - builder.append("url=\"" + url_ + '"'); - builder.append(", " + httpMethod_); - builder.append(", " + encodingType_); - builder.append(", " + requestParameters_); - builder.append(", " + additionalHeaders_); - builder.append(", " + credentials_); - builder.append(">]"); + builder.append("[]"); return builder.toString(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebResponse.java b/src/main/java/com/gargoylesoftware/htmlunit/WebResponse.java index 43002178b38..ca6dd2d2735 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebResponse.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,7 @@ public class WebResponse implements Serializable { private long loadTime_; private WebResponseData responseData_; private WebRequest request_; + private boolean defaultCharsetUtf8_; /** * Constructs with all data. @@ -180,12 +181,12 @@ public Charset getContentCharset() { // xml pages are using a different content type if (null != contentType - && PageType.XML == DefaultPageCreator.determinePageType(contentType)) { + && (defaultCharsetUtf8_ + || PageType.XML == DefaultPageCreator.determinePageType(contentType))) { return UTF_8; } - - charset = getWebRequest().getCharset(); } + if (charset == null) { charset = ISO_8859_1; } @@ -245,7 +246,7 @@ public String getContentAsString(final Charset encoding, final boolean ignoreUtf } } catch (final IOException e) { - LOG.warn(e); + LOG.warn(e.getMessage(), e); } } return null; @@ -287,4 +288,11 @@ public void cleanUp() { responseData_.cleanUp(); } } + + /** + * Mark this response for using UTF-8 as default charset. + */ + public void defaultCharsetUtf8() { + defaultCharsetUtf8_ = true; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebResponseData.java b/src/main/java/com/gargoylesoftware/htmlunit/WebResponseData.java index 00daa588e94..cc31d30e63a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebResponseData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebResponseData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,9 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.brotli.dec.BrotliInputStream; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -91,7 +93,6 @@ public WebResponseData(final DownloadedContent downloadedContent, final int stat private InputStream getStream(final DownloadedContent downloadedContent, final List headers) throws IOException { - InputStream stream = downloadedContent_.getInputStream(); if (downloadedContent.isEmpty()) { return stream; @@ -99,7 +100,11 @@ private InputStream getStream(final DownloadedContent downloadedContent, final String encoding = getHeader(headers, "content-encoding"); if (encoding != null) { - if (StringUtils.contains(encoding, "gzip")) { + boolean isGzip = StringUtils.contains(encoding, "gzip") && !"no-gzip".equals(encoding); + if ("gzip-only-text/html".equals(encoding)) { + isGzip = MimeType.TEXT_HTML.equals(getHeader(headers, "content-type")); + } + if (isGzip) { try { stream = new GZIPInputStream(stream); } @@ -117,6 +122,24 @@ private InputStream getStream(final DownloadedContent downloadedContent, + "", ISO_8859_1); } } + else if ("br".equals(encoding)) { + try { + stream = new BrotliInputStream(stream); + } + catch (final IOException e) { + LOG.error("Reading Brotli encodec content failed.", e); + stream.close(); + stream = IOUtils.toInputStream( + "\n" + + "Problem loading page\n" + + "\n" + + "

Content Encoding Error

\n" + + "

The page you are trying to view cannot be shown because" + + " it uses an invalid or unsupported form of compression.

\n" + + "\n" + + "", ISO_8859_1); + } + } else if (StringUtils.contains(encoding, "deflate")) { boolean zlibHeader = false; if (stream.markSupported()) { // should be always the case as the content is in a byte[] or in a file diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebResponseFromCache.java b/src/main/java/com/gargoylesoftware/htmlunit/WebResponseFromCache.java index 62e0dc59010..12aafefa49c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebResponseFromCache.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebResponseFromCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebWindow.java b/src/main/java/com/gargoylesoftware/htmlunit/WebWindow.java index e99ed6d4689..1de1a6a76c3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebWindow.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ import java.io.Serializable; -import javax.script.ScriptContext; - import com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManager; /** @@ -179,34 +177,4 @@ public interface WebWindow extends Serializable { * @param outerHeight the outer height */ void setOuterHeight(int outerHeight); - - /** - * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
- * - * Returns the {@link ScriptContext} - * - * @return the {@link ScriptContext} - */ - ScriptContext getScriptContext(); - - /** - * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
- * - * Returns a thread local object. - * - * @param key the object key - * - * @return the thread local object - */ - Object getThreadLocal(Object key); - - /** - * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
- * - * Puts a thread local object by {@code key}. - * - * @param key the object key - * @param value the object value - */ - void putThreadLocal(Object key, Object value); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowAdapter.java b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowAdapter.java index 9d15623bb18..80e4fcfdc3e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowAdapter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowEvent.java index 4f77b5ad3df..21088270c94 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java index 275870aa887..7f993e3729e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,14 @@ package com.gargoylesoftware.htmlunit; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_63; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_132; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_94; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_86; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_92; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; - -import javax.script.ScriptContext; -import javax.script.SimpleScriptContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -57,13 +52,11 @@ public abstract class WebWindowImpl implements WebWindow { private WebClient webClient_; private Page enclosedPage_; private transient Object scriptObject_; - private transient ScriptContext scriptContext_ = new SimpleScriptContext(); private JavaScriptJobManager jobManager_; private final List childWindows_ = new ArrayList<>(); private String name_ = ""; private final History history_ = new History(this); private boolean closed_; - private Map threadLocalMap_; private int innerHeight_; private int outerHeight_; @@ -80,27 +73,22 @@ public WebWindowImpl(final WebClient webClient) { webClient_ = webClient; jobManager_ = BackgroundJavaScriptFactory.theFactory().createJavaScriptJobManager(this); - boolean plus16 = false; innerHeight_ = 605; + innerWidth_ = 1256; if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_63)) { outerHeight_ = innerHeight_ + 63; - plus16 = true; - } - else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_94)) { - outerHeight_ = innerHeight_ + 94; - } - else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_132)) { - outerHeight_ = innerHeight_ + 132; - plus16 = true; + outerWidth_ = innerWidth_ + 16; } - else { - outerHeight_ = innerHeight_ + 115; + else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_86)) { + outerHeight_ = innerHeight_ + 86; + outerWidth_ = innerWidth_ + 14; } - innerWidth_ = 1256; - if (plus16) { + else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_92)) { + outerHeight_ = innerHeight_ + 92; outerWidth_ = innerWidth_ + 16; } else { + outerHeight_ = innerHeight_ + 115; outerWidth_ = innerWidth_ + 14; } } @@ -346,30 +334,6 @@ public void setOuterHeight(final int outerHeight) { outerHeight_ = outerHeight; } - /** - * {@inheritDoc} - */ - @Override - public ScriptContext getScriptContext() { - return scriptContext_; - } - - @Override - public final Object getThreadLocal(final Object key) { - if (threadLocalMap_ == null) { - return null; - } - return threadLocalMap_.get(key); - } - - @Override - public final synchronized void putThreadLocal(final Object key, final Object value) { - if (threadLocalMap_ == null) { - threadLocalMap_ = new HashMap<>(); - } - threadLocalMap_.put(key, value); - } - private void writeObject(final ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); oos.writeObject(scriptObject_ instanceof Scriptable ? scriptObject_ : null); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowListener.java b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowListener.java index de2aa274d40..c17dce2f995 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowNotFoundException.java b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowNotFoundException.java index 64a29678fea..52332ba1fd9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/WebWindowNotFoundException.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/WebWindowNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLActiveXObjectFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLActiveXObjectFactory.java index 0d8041d790a..69c120ee014 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLActiveXObjectFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLActiveXObjectFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLConfiguration.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLConfiguration.java index 06dc346a674..49e0b6f3927 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLConfiguration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLJavaScriptEnvironment.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLJavaScriptEnvironment.java index 7c880fb213a..fe7aba798d5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLJavaScriptEnvironment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLJavaScriptEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,10 +78,6 @@ public MSXMLJavaScriptEnvironment(final BrowserVersion browserVersion) throws Ex final Scriptable parentPrototype = prototypesPerJSName.get(config.getExtendedClassName()); prototype.setPrototype(parentPrototype); } - else { -// prototype.setPrototype(objectPrototype); -// prototype.setPrototype(fallbackCaller); - } } prototypes_ = prototypes; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLScriptable.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLScriptable.java index dc367c8f788..b1ffa52ef19 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLScriptable.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/MSXMLScriptable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMAttribute.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMAttribute.java index 502279cdd01..caa25e6fdbb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMAttribute.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,8 @@ public class XMLDOMAttribute extends XMLDOMNode { /** * Creates an instance. */ - public XMLDOMAttribute() { } + public XMLDOMAttribute() { + } /** * Returns a node list containing the child nodes. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCDATASection.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCDATASection.java index 9e402187d86..30152e51bbd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCDATASection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCDATASection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCharacterData.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCharacterData.java index 262d2751b74..cb1acb17df1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCharacterData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMCharacterData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMComment.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMComment.java index d2d92d8453f..7636b39aee8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMComment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMComment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument.java index 94188e9602b..f6bca1efa46 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomProcessingInstruction; import com.gargoylesoftware.htmlunit.html.DomText; -import com.gargoylesoftware.htmlunit.html.HTMLParser; +import com.gargoylesoftware.htmlunit.html.Html; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -439,8 +439,8 @@ private Object createElementNS(final String namespaceURI, final String qualified if ("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul".equals(namespaceURI)) { throw Context.reportRuntimeError("XUL not available"); } - else if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI) - || HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { + else if (Html.XHTML_NAMESPACE.equals(namespaceURI) + || Html.SVG_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragment.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragment.java index 652607ff035..5e44c50abcf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentType.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentType.java index 66f4ff94a05..7ff9bd69a54 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentType.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElement.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElement.java index dcc77e9b091..b426043d34d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementation.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementation.java index fa2889be83f..d9ca5dd3498 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMap.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMap.java index b55f912baaa..9348a80e3fb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public class XMLDOMNamedNodeMap extends MSXMLScriptable { private final org.w3c.dom.NamedNodeMap attributes_; - private int currentIndex_ = 0; + private int currentIndex_; /** * Creates an instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNode.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNode.java index bf26fa91da8..274dc19dd22 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -443,7 +443,7 @@ protected Object insertBeforeImpl(final Object[] args) { } final DomNode refChildNode; // IE accepts non standard calls with only one arg - if (refChildObject == Undefined.instance) { + if (Undefined.isUndefined(refChildObject)) { if (args.length > 1) { throw Context.reportRuntimeError("Invalid argument."); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeList.java index bb329f3211e..5f5381f16a9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ protected enum EffectOnCache { /** * IE provides a way of enumerating through some element collections; this counter supports that functionality. */ - private int currentIndex_ = 0; + private int currentIndex_; /** * Creates an instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseError.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseError.java index c5a002ae8f6..32f1692d1ec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstruction.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstruction.java index 9700aae700c..df62d321067 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstruction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstruction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMSelection.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMSelection.java index ecc1c031228..e93ca20c6f8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMSelection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMSelection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMText.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMText.java index 496833b5a06..dd93a8c3596 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequest.java index 20123dad499..60e75821def 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.Window; import com.gargoylesoftware.htmlunit.javascript.host.xml.FormData; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; import com.gargoylesoftware.htmlunit.xml.XmlPage; @@ -246,8 +247,10 @@ public Object getResponseXML() { return doc; } catch (final IOException e) { - LOG.warn("Failed parsing XML document " + webResponse_.getWebRequest().getUrl() + ": " - + e.getMessage()); + if (LOG.isWarnEnabled()) { + LOG.warn("Failed parsing XML document " + webResponse_.getWebRequest().getUrl() + ": " + + e.getMessage()); + } return null; } } @@ -271,8 +274,10 @@ public int getStatus() { return webResponse_.getStatusCode(); } - LOG.error("XMLHTTPRequest.status was retrieved without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHTTPRequest.status was retrieved without a response available (readyState: " + + state_ + ")."); + } return 0; } @@ -289,8 +294,10 @@ public String getStatusText() { return webResponse_.getStatusMessage(); } - LOG.error("XMLHTTPRequest.statusText was retrieved without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHTTPRequest.statusText was retrieved without a response available (readyState: " + + state_ + ")."); + } return null; } @@ -320,8 +327,10 @@ public String getAllResponseHeaders() { return builder.append("\r\n").toString(); } - LOG.error("XMLHTTPRequest.getAllResponseHeaders() was called without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHTTPRequest.getAllResponseHeaders() was called without a response available (readyState: " + + state_ + ")."); + } return null; } @@ -349,8 +358,10 @@ public String getResponseHeader(final String header) { return value; } - LOG.error("XMLHTTPRequest.getResponseHeader(..) was called without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHTTPRequest.getResponseHeader(..) was called without a response available (readyState: " + + state_ + ")."); + } return null; } @@ -388,7 +399,7 @@ public void open(final String method, final Object url, final Object asyncParam, // defaults to true if not specified boolean async = true; - if (asyncParam != Undefined.instance) { + if (!Undefined.isUndefined(asyncParam)) { async = ScriptRuntime.toBoolean(asyncParam); } @@ -407,11 +418,11 @@ public void open(final String method, final Object url, final Object asyncParam, request.setHttpMethod(HttpMethod.valueOf(method.toUpperCase(Locale.ROOT))); // password is ignored if no user defined - if (user != null && user != Undefined.instance) { + if (user != null && !Undefined.isUndefined(user)) { final String userCred = user.toString(); String passwordCred = ""; - if (password != null && password != Undefined.instance) { + if (password != null && !Undefined.isUndefined(password)) { passwordCred = password.toString(); } @@ -420,11 +431,15 @@ public void open(final String method, final Object url, final Object asyncParam, webRequest_ = request; } catch (final MalformedURLException e) { - LOG.error("Unable to initialize XMLHTTPRequest using malformed URL '" + urlAsString + "'."); + if (LOG.isErrorEnabled()) { + LOG.error("Unable to initialize XMLHTTPRequest using malformed URL '" + urlAsString + "'."); + } return; } catch (final IllegalArgumentException e) { - LOG.error("Unable to initialize XMLHTTPRequest using illegal argument '" + e.getMessage() + "'."); + if (LOG.isErrorEnabled()) { + LOG.error("Unable to initialize XMLHTTPRequest using illegal argument '" + e.getMessage() + "'."); + } webRequest_ = null; } // Async stays a boolean. @@ -465,7 +480,7 @@ public void send(final Object body) { // Create and start a thread in which to execute the request. final Scriptable startingScope = w; final ContextFactory cf = ((JavaScriptEngine) client.getJavaScriptEngine()).getContextFactory(); - final ContextAction action = new ContextAction() { + final ContextAction action = new ContextAction() { @Override public Object run(final Context cx) { // KEY_STARTING_SCOPE maintains a stack of scopes @@ -501,7 +516,7 @@ public Object run(final Context cx) { * @param content the content to send */ private void prepareRequest(final Object content) { - if (content != null && content != Undefined.instance) { + if (content != null && !Undefined.isUndefined(content)) { if (!"".equals(content) && HttpMethod.GET == webRequest_.getHttpMethod()) { webRequest_.setHttpMethod(HttpMethod.POST); } @@ -574,6 +589,9 @@ private void doSend(final Context context) { if (LOG.isDebugEnabled()) { LOG.debug("Web response loaded successfully."); } + // this kind of web responses using UTF-8 as default encoding + webResponse.defaultCharsetUtf8(); + boolean allowOriginResponse = true; if (originHeaderValue != null) { final String value = webResponse.getResponseHeaderValue(HttpHeader.ACCESS_CONTROL_ALLOW_ORIGIN); @@ -654,7 +672,7 @@ private static boolean isPreflightHeader(final String name, final String value) final String lcValue = value.toLowerCase(Locale.ROOT); return !(lcValue.startsWith(FormEncodingType.URL_ENCODED.getName()) || lcValue.startsWith(FormEncodingType.MULTIPART.getName()) - || lcValue.startsWith("text/plain")); + || lcValue.startsWith(MimeType.TEXT_PLAIN)); } return !(HttpHeader.ACCEPT_LC.equals(name) @@ -686,8 +704,10 @@ public void setRequestHeader(final String name, final String value) { return; } if (!isAuthorizedHeader(name)) { - LOG.warn("Ignoring XMLHTTPRequest.setRequestHeader for " + name - + ": it is a restricted header"); + if (LOG.isWarnEnabled()) { + LOG.warn("Ignoring XMLHTTPRequest.setRequestHeader for " + name + + ": it is a restricted header"); + } return; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializer.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializer.java index 9b718429125..75d5d835d1b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor.java index 785fe3dfe47..869a0a3a635 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; -import com.gargoylesoftware.htmlunit.xml.XmlUtil; +import com.gargoylesoftware.htmlunit.util.XmlUtils; import net.sourceforge.htmlunit.corejs.javascript.Context; @@ -210,7 +210,7 @@ private void transform(final XMLDOMNode source, final DomNode parent) { final SgmlPage parentPage = parent.getPage(); final NodeList children = ((org.w3c.dom.Node) result).getChildNodes(); for (int i = 0; i < children.getLength(); i++) { - XmlUtil.appendChild(parentPage, parent, children.item(i), false); + XmlUtils.appendChild(parentPage, parent, children.item(i), false); } } else { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLTemplate.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLTemplate.java index 7e0c923a8e3..455d7dd81e3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLTemplate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/package-info.java index 0b12177168f..856787efb8f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/attachment/Attachment.java b/src/main/java/com/gargoylesoftware/htmlunit/attachment/Attachment.java index c0f45434245..174105dd4b8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/attachment/Attachment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/attachment/Attachment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.attachment; +import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.WebResponse; @@ -24,6 +25,7 @@ * @author Bruce Chapman * @author Sudhan Moghe * @author Daniel Gredler + * @author Ronald Brill */ public class Attachment { @@ -53,7 +55,7 @@ public Page getPage() { */ public String getSuggestedFilename() { final WebResponse response = page_.getWebResponse(); - final String disp = response.getResponseHeaderValue("Content-Disposition"); + final String disp = response.getResponseHeaderValue(HttpHeader.CONTENT_DISPOSITION); int start = disp.indexOf("filename="); if (start == -1) { return null; @@ -73,19 +75,4 @@ public String getSuggestedFilename() { } return disp.substring(start, end); } - - /** - * Returns {@code true} if the specified response represents an attachment. - * @param response the response to check - * @return {@code true} if the specified response represents an attachment, {@code false} otherwise - * @see RFC 2183 - */ - public static boolean isAttachment(final WebResponse response) { - final String disp = response.getResponseHeaderValue("Content-Disposition"); - if (disp == null) { - return false; - } - return disp.startsWith("attachment"); - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.java index afb43ecb36e..7bee2836225 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,11 @@ */ package com.gargoylesoftware.htmlunit.attachment; +import java.io.Serializable; + +import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.Page; +import com.gargoylesoftware.htmlunit.WebResponse; /** *

A handler for attachments, which represent pages received from the server which contain @@ -34,11 +38,12 @@ * @author Bruce Chapman * @author Sudhan Moghe * @author Daniel Gredler + * @author Ronald Brill * @see com.gargoylesoftware.htmlunit.WebClient#setAttachmentHandler(AttachmentHandler) * @see com.gargoylesoftware.htmlunit.WebClient#getAttachmentHandler() * @see RFC 2183 */ -public interface AttachmentHandler { +public interface AttachmentHandler extends Serializable { /** * Handles the specified attached page. @@ -46,4 +51,17 @@ public interface AttachmentHandler { */ void handleAttachment(Page page); + /** + * Returns {@code true} if the specified response represents an attachment. + * @param response the response to check + * @return {@code true} if the specified response represents an attachment, {@code false} otherwise + * @see RFC 2183 + */ + default boolean isAttachment(final WebResponse response) { + final String disp = response.getResponseHeaderValue(HttpHeader.CONTENT_DISPOSITION); + if (disp == null) { + return false; + } + return disp.startsWith("attachment"); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/attachment/CollectingAttachmentHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/attachment/CollectingAttachmentHandler.java index 50d262a19be..060521acadd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/attachment/CollectingAttachmentHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/attachment/CollectingAttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ * @author Bruce Chapman * @author Sudhan Moghe * @author Daniel Gredler + * @author Ronald Brill */ public class CollectingAttachmentHandler implements AttachmentHandler { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/attachment/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/attachment/package-info.java index 15635131495..24d47dcf139 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/attachment/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/attachment/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/css/StyleElement.java b/src/main/java/com/gargoylesoftware/htmlunit/css/StyleElement.java index efe41f4e0bd..5900dcdc2fa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/css/StyleElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/css/StyleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.css; import java.io.Serializable; +import java.util.concurrent.atomic.AtomicLong; import com.gargoylesoftware.css.parser.selector.SelectorSpecificity; @@ -39,7 +40,7 @@ public class StyleElement implements Comparable, Serializable { public static final String PRIORITY_IMPORTANT = "important"; /** The current style element index. */ - private static long ElementIndex_ = 0; + private static final AtomicLong ElementIndex_ = new AtomicLong(); private final String name_; private final String value_; @@ -73,7 +74,7 @@ public StyleElement(final String name, final String value, final String priority */ public StyleElement(final String name, final String value, final String priority, final SelectorSpecificity specificity) { - this(name, value, priority, specificity, ElementIndex_++); + this(name, value, priority, specificity, StyleElement.ElementIndex_.incrementAndGet()); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/css/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/css/package-info.java index b4e06fee490..f3c6c080095 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/css/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/css/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/AbstractDomNodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/AbstractDomNodeList.java index e885711b39e..ba6b6acb374 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/AbstractDomNodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/AbstractDomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement.java index 5e71fedc24c..5b81e4bf8a6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,12 @@ */ package com.gargoylesoftware.htmlunit.html; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.URL_MINIMAL_QUERY_ENCODING; + import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.nio.charset.Charset; import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -55,9 +58,9 @@ public abstract class BaseFrameElement extends HtmlElement { private static final Log LOG = LogFactory.getLog(BaseFrameElement.class); private FrameWindow enclosedWindow_; - private boolean contentLoaded_ = false; - private boolean createdByJavascript_ = false; - private boolean loadSrcWhenAddedToPage_ = false; + private boolean contentLoaded_; + private boolean createdByJavascript_; + private boolean loadSrcWhenAddedToPage_; /** * Creates an instance of BaseFrame. @@ -91,8 +94,7 @@ private void init() { // put about:blank in the window to allow JS to run on this frame before the // real content is loaded final WebClient webClient = htmlPage.getWebClient(); - final HtmlPage temporaryPage = webClient.getPage(enclosedWindow, - new WebRequest(WebClient.URL_ABOUT_BLANK)); + final HtmlPage temporaryPage = webClient.getPage(enclosedWindow, WebRequest.newAboutBlankRequest()); temporaryPage.setReadyState(READY_STATE_LOADING); } } @@ -123,8 +125,9 @@ public void loadInnerPage() throws FailingHttpStatusCodeException { final Page enclosedPage = getEnclosedPage(); if (enclosedPage != null && enclosedPage.isHtmlPage()) { final HtmlPage htmlPage = (HtmlPage) enclosedPage; + final AbstractJavaScriptEngine jsEngine = getPage().getWebClient().getJavaScriptEngine(); - if (jsEngine.isScriptRunning()) { + if (jsEngine != null && jsEngine.isScriptRunning()) { final PostponedAction action = new PostponedAction(getPage()) { @Override public void execute() throws Exception { @@ -173,17 +176,22 @@ private void loadInnerPageIfPossible(final String src) throws FailingHttpStatusC notifyIncorrectness("Invalid src attribute of " + getTagName() + ": url=[" + src + "]. Ignored."); return; } - if (isAlreadyLoadedByAncestor(url)) { + + final WebRequest request = new WebRequest(url); + request.setCharset(getPage().getCharset()); + request.setAdditionalHeader(HttpHeader.REFERER, getPage().getUrl().toExternalForm()); + + if (isAlreadyLoadedByAncestor(url, request.getCharset())) { notifyIncorrectness("Recursive src attribute of " + getTagName() + ": url=[" + src + "]. Ignored."); return; } try { - final WebRequest request = new WebRequest(url); - request.setAdditionalHeader(HttpHeader.REFERER, getPage().getUrl().toExternalForm()); getPage().getEnclosingWindow().getWebClient().getPage(enclosedWindow_, request); } catch (final IOException e) { - LOG.error("IOException when getting content for " + getTagName() + ": url=[" + url + "]", e); + if (LOG.isErrorEnabled()) { + LOG.error("IOException when getting content for " + getTagName() + ": url=[" + url + "]", e); + } } } } @@ -191,14 +199,19 @@ private void loadInnerPageIfPossible(final String src) throws FailingHttpStatusC /** * Test if the provided URL is the one of one of the parents which would cause an infinite loop. * @param url the URL to test + * @param charset the request charset * @return {@code false} if no parent has already this URL */ - private boolean isAlreadyLoadedByAncestor(final URL url) { + private boolean isAlreadyLoadedByAncestor(final URL url, final Charset charset) { WebWindow window = getPage().getEnclosingWindow(); while (window != null) { - if (UrlUtils.sameFile(url, window.getEnclosedPage().getUrl())) { + final URL encUrl = UrlUtils.encodeUrl(url, + window.getWebClient().getBrowserVersion().hasFeature(URL_MINIMAL_QUERY_ENCODING), + charset); + if (UrlUtils.sameFile(encUrl, window.getEnclosedPage().getUrl())) { return true; } + if (window == window.getParentWindow()) { // TODO: should getParentWindow() return null on top windows? window = null; @@ -341,7 +354,7 @@ public FrameWindow getEnclosedWindow() { * @param attribute the new value of the {@code src} attribute */ public final void setSrcAttribute(final String attribute) { - setAttribute("src", attribute); + setAttribute(SRC_ATTRIBUTE, attribute); } /** @@ -350,14 +363,14 @@ public final void setSrcAttribute(final String attribute) { @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObserver) { - if (null != attributeValue && "src".equals(qualifiedName)) { + if (null != attributeValue && SRC_ATTRIBUTE.equals(qualifiedName)) { attributeValue = attributeValue.trim(); } super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObserver); - if ("src".equals(qualifiedName) && WebClient.ABOUT_BLANK != attributeValue) { + if (SRC_ATTRIBUTE.equals(qualifiedName) && WebClient.ABOUT_BLANK != attributeValue) { if (isAttachedToPage()) { loadSrc(); } @@ -374,13 +387,13 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN public Attr setAttributeNode(final Attr attribute) { final String qualifiedName = attribute.getName(); String attributeValue = null; - if ("src".equals(qualifiedName)) { + if (SRC_ATTRIBUTE.equals(qualifiedName)) { attributeValue = attribute.getValue().trim(); } final Attr result = super.setAttributeNode(attribute); - if ("src".equals(qualifiedName) && !WebClient.ABOUT_BLANK.equals(attributeValue)) { + if (SRC_ATTRIBUTE.equals(qualifiedName) && !WebClient.ABOUT_BLANK.equals(attributeValue)) { if (isAttachedToPage()) { loadSrc(); } @@ -400,7 +413,8 @@ private void loadSrc() { // When src is set from a script, loading is postponed until script finishes // in fact this implementation is probably wrong: JavaScript URL should be // first evaluated and only loading, when any, should be postponed. - if (!jsEngine.isScriptRunning() || src.startsWith(JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { + if (jsEngine == null || !jsEngine.isScriptRunning() + || src.startsWith(JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { loadInnerPageIfPossible(src); } else { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeEvent.java index 55b5a088bc1..7cf4d0acd57 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeListener.java b/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeListener.java index 1fa405ed221..a816be51a73 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/CharacterDataChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java index 32a3ea24ee4..1f8eba84a60 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import java.util.Locale; import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.xml.sax.Attributes; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -30,6 +32,8 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration; /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Element factory which creates elements by calling the constructor on a * given {@link HtmlElement} subclass. * The constructor is expected to take 2 arguments of type @@ -38,19 +42,25 @@ * holding the initial attributes for the element. * * @author Christian Sell + * @author Marc Guillemot * @author Ahmed Ashour * @author David K. Taylor + * @author Dmitri Zoubkov * @author Ronald Brill * @author Frank Danek */ -class DefaultElementFactory implements ElementFactory { +public class DefaultElementFactory implements ElementFactory { + + /** Logging support. */ + private static final Log LOG = LogFactory.getLog(DefaultElementFactory.class); private static final String KEYGEN_ = "keygen"; - /* - * You can generate your own test cases by looking into ElementTestSource.generateTestForHtmlElements + /** + * You can generate your own test cases by looking into ElementTestSource.generateTestForHtmlElements. */ - static final List SUPPORTED_TAGS_ = Arrays.asList(KEYGEN_, HtmlAbbreviated.TAG_NAME, HtmlAcronym.TAG_NAME, + public static final List SUPPORTED_TAGS_ = Arrays.asList( + KEYGEN_, HtmlAbbreviated.TAG_NAME, HtmlAcronym.TAG_NAME, HtmlAnchor.TAG_NAME, HtmlAddress.TAG_NAME, HtmlApplet.TAG_NAME, HtmlArea.TAG_NAME, HtmlArticle.TAG_NAME, HtmlAside.TAG_NAME, HtmlAudio.TAG_NAME, HtmlBackgroundSound.TAG_NAME, HtmlBase.TAG_NAME, HtmlBaseFont.TAG_NAME, @@ -72,7 +82,9 @@ class DefaultElementFactory implements ElementFactory { HtmlHeading4.TAG_NAME, HtmlHeading5.TAG_NAME, HtmlHeading6.TAG_NAME, HtmlHorizontalRule.TAG_NAME, HtmlHtml.TAG_NAME, HtmlInlineFrame.TAG_NAME, HtmlInlineQuotation.TAG_NAME, - HtmlImage.TAG_NAME, HtmlImage.TAG_NAME2, HtmlInsertedText.TAG_NAME, HtmlIsIndex.TAG_NAME, + HtmlImage.TAG_NAME, HtmlImage.TAG_NAME2, + HtmlInput.TAG_NAME, + HtmlInsertedText.TAG_NAME, HtmlIsIndex.TAG_NAME, HtmlItalic.TAG_NAME, HtmlKeyboard.TAG_NAME, HtmlLabel.TAG_NAME, HtmlLayer.TAG_NAME, HtmlLegend.TAG_NAME, HtmlListing.TAG_NAME, HtmlListItem.TAG_NAME, @@ -148,6 +160,7 @@ public HtmlElement createElementNS(final SgmlPage page, final String namespaceUR tagName = qualifiedName.substring(colonIndex + 1).toLowerCase(Locale.ROOT); } + boolean doBrowserCompatibilityCheck = checkBrowserCompatibility; switch (tagName) { case KEYGEN_: final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); @@ -232,6 +245,12 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { case HtmlBody.TAG_NAME: element = new HtmlBody(qualifiedName, page, attributeMap, false); + // Force script object creation now to forward onXXX handlers to window. + if (page instanceof HtmlPage) { + if (page.getWebClient().isJavaScriptEngineEnabled()) { + element.getScriptableObject(); + } + } break; case HtmlBold.TAG_NAME: @@ -356,7 +375,7 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { case HtmlFrame.TAG_NAME: if (attributeMap != null) { - final DomAttr srcAttribute = attributeMap.get("src"); + final DomAttr srcAttribute = attributeMap.get(DomElement.SRC_ATTRIBUTE); if (srcAttribute != null) { srcAttribute.setValue(srcAttribute.getValue().trim()); } @@ -415,7 +434,7 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { case HtmlInlineFrame.TAG_NAME: if (attributeMap != null) { - final DomAttr srcAttribute = attributeMap.get("src"); + final DomAttr srcAttribute = attributeMap.get(DomElement.SRC_ATTRIBUTE); if (srcAttribute != null) { srcAttribute.setValue(srcAttribute.getValue().trim()); } @@ -427,6 +446,11 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { element = new HtmlInlineQuotation(qualifiedName, page, attributeMap); break; + case HtmlInput.TAG_NAME: + element = createInputElement(qualifiedName, page, attributeMap); + doBrowserCompatibilityCheck = false; + break; + case HtmlInsertedText.TAG_NAME: element = new HtmlInsertedText(qualifiedName, page, attributeMap); break; @@ -669,6 +693,7 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { case HtmlTableDataCell.TAG_NAME: element = new HtmlTableDataCell(qualifiedName, page, attributeMap); + doBrowserCompatibilityCheck = false; break; case HtmlTableFooter.TAG_NAME: @@ -681,6 +706,7 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { case HtmlTableHeaderCell.TAG_NAME: element = new HtmlTableHeaderCell(qualifiedName, page, attributeMap); + doBrowserCompatibilityCheck = false; break; case HtmlTableRow.TAG_NAME: @@ -735,10 +761,12 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { throw new IllegalStateException("Cannot find HtmlElement for " + qualifiedName); } - final JavaScriptConfiguration config = page.getWebClient().getJavaScriptEngine().getJavaScriptConfiguration(); - if (config != null && !"td".equals(tagName) && !"th".equals(tagName) - && checkBrowserCompatibility && config.getDomJavaScriptMapping().get(element.getClass()) == null) { - return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + if (doBrowserCompatibilityCheck) { + final JavaScriptConfiguration config = + JavaScriptConfiguration.getInstance(page.getWebClient().getBrowserVersion()); + if (config != null && config.getDomJavaScriptMapping().get(element.getClass()) == null) { + return UnknownElementFactory.instance.createElementNS(page, namespaceURI, qualifiedName, attributes); + } } return element; } @@ -751,22 +779,138 @@ else if (browserVersion.hasFeature(KEYGEN_AS_SELECT)) { * @return the map of attribute values for {@link HtmlElement}s */ static Map toMap(final SgmlPage page, final Attributes attributes) { - Map attributeMap = null; - if (attributes != null) { - attributeMap = new LinkedHashMap<>(attributes.getLength()); - for (int i = 0; i < attributes.getLength(); i++) { - final String qName = attributes.getQName(i); - // browsers consider only first attribute (ex:

...
) - if (!attributeMap.containsKey(qName)) { - String namespaceURI = attributes.getURI(i); - if (namespaceURI != null && namespaceURI.isEmpty()) { - namespaceURI = null; - } - final DomAttr newAttr = new DomAttr(page, namespaceURI, qName, attributes.getValue(i), true); - attributeMap.put(qName, newAttr); + if (attributes == null) { + return null; + } + + final Map attributeMap = new LinkedHashMap<>(attributes.getLength()); + for (int i = 0; i < attributes.getLength(); i++) { + final String qName = attributes.getQName(i); + // browsers consider only first attribute (ex:
...
) + if (!attributeMap.containsKey(qName)) { + String namespaceURI = attributes.getURI(i); + if (namespaceURI != null && namespaceURI.isEmpty()) { + namespaceURI = null; } + final DomAttr newAttr = new DomAttr(page, namespaceURI, qName, attributes.getValue(i), true); + attributeMap.put(qName, newAttr); } } return attributeMap; } + + private HtmlElement createInputElement(final String qualifiedName, final SgmlPage page, + final Map attributeMap) { + String type = ""; + if (attributeMap != null) { + for (final Map.Entry entry : attributeMap.entrySet()) { + if ("type".equalsIgnoreCase(entry.getKey())) { + type = entry.getValue().getValue(); + } + } + } + + final HtmlInput result; + switch (type.toLowerCase(Locale.ROOT)) { + case "": + // This not an illegal value, as it defaults to "text" + // cf http://www.w3.org/TR/REC-html40/interact/forms.html#adef-type-INPUT + // and the common browsers seem to treat it as a "text" input so we will as well. + case "text": + result = new HtmlTextInput(qualifiedName, page, attributeMap); + break; + + case "submit": + result = new HtmlSubmitInput(qualifiedName, page, attributeMap); + break; + + case "checkbox": + result = new HtmlCheckBoxInput(qualifiedName, page, attributeMap); + break; + + case "radio": + result = new HtmlRadioButtonInput(qualifiedName, page, attributeMap); + break; + + case "hidden": + result = new HtmlHiddenInput(qualifiedName, page, attributeMap); + break; + + case "password": + result = new HtmlPasswordInput(qualifiedName, page, attributeMap); + break; + + case "image": + result = new HtmlImageInput(qualifiedName, page, attributeMap); + break; + + case "reset": + result = new HtmlResetInput(qualifiedName, page, attributeMap); + break; + + case "button": + result = new HtmlButtonInput(qualifiedName, page, attributeMap); + break; + + case "file": + result = new HtmlFileInput(qualifiedName, page, attributeMap); + break; + + case "color": + result = new HtmlColorInput(qualifiedName, page, attributeMap); + break; + + case "date": + result = new HtmlDateInput(qualifiedName, page, attributeMap); + break; + + case "datetime-local": + result = new HtmlDateTimeLocalInput(qualifiedName, page, attributeMap); + break; + + case "email": + result = new HtmlEmailInput(qualifiedName, page, attributeMap); + break; + + case "month": + result = new HtmlMonthInput(qualifiedName, page, attributeMap); + break; + + case "number": + result = new HtmlNumberInput(qualifiedName, page, attributeMap); + break; + + case "range": + result = new HtmlRangeInput(qualifiedName, page, attributeMap); + break; + + case "search": + result = new HtmlSearchInput(qualifiedName, page, attributeMap); + break; + + case "tel": + result = new HtmlTelInput(qualifiedName, page, attributeMap); + break; + + case "time": + result = new HtmlTimeInput(qualifiedName, page, attributeMap); + break; + + case "url": + result = new HtmlUrlInput(qualifiedName, page, attributeMap); + break; + + case "week": + result = new HtmlWeekInput(qualifiedName, page, attributeMap); + break; + + default: + if (LOG.isInfoEnabled()) { + LOG.info("Bad input type: \"" + type + "\", creating a text input"); + } + result = new HtmlTextInput(qualifiedName, page, attributeMap); + break; + } + return result; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DisabledElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DisabledElement.java index e76b6780eee..f713804063c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DisabledElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DisabledElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DoTypeProcessor.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DoTypeProcessor.java index bd7fe93e86d..71985f6e6f7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DoTypeProcessor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DoTypeProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,8 @@ import com.gargoylesoftware.htmlunit.html.impl.SelectionDelegate; /** - * The process for {@link HtmlElement#doType(char, boolean, boolean)}. + * The processor for {@link HtmlElement#doType(char, boolean)} + * and {@link HtmlElement#doType(int, boolean)}. * * @author Marc Guillemot * @author Ronald Brill diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomAttr.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomAttr.java index 569e169f14a..cb8f0e67b2d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomAttr.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomCDataSection.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomCDataSection.java index 83083ec23e9..2f1800a5e4e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomCDataSection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomCDataSection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeEvent.java index 269ae705480..42d3278469c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeListener.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeListener.java index 160803d0c38..a4b0e8e4c6c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomCharacterData.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomCharacterData.java index 63e153be965..ac85484bc62 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomCharacterData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomCharacterData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomComment.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomComment.java index 36afa0ce995..7e0ba394b92 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomComment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomComment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,4 +81,12 @@ protected void printXml(final String indent, final PrintWriter printWriter) { public String toString() { return asXml(); } + + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragment.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragment.java index 2c6ebc66e2f..65fe789c2a5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,4 +75,20 @@ public String asXml() { public boolean isAttachedToPage() { return false; } + + /** + * {@inheritDoc} + */ + @Override + public void setNodeValue(final String value) { + // Default behavior is to do nothing, overridden in some subclasses + } + + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentType.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentType.java index 9416865ffe7..3508fb33a04 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentType.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomDocumentType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,4 +107,20 @@ public String getPublicId() { public String getSystemId() { return systemId_; } + + /** + * {@inheritDoc} + */ + @Override + public void setNodeValue(final String value) { + // Default behavior is to do nothing, overridden in some subclasses + } + + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java index 177a5f96e05..e630aaa5a92 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import java.io.PrintWriter; import java.io.Serializable; import java.io.StringWriter; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -54,6 +53,7 @@ import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.css.StyleElement; import com.gargoylesoftware.htmlunit.javascript.AbstractJavaScriptEngine; +import com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory; import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet; @@ -64,10 +64,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import com.gargoylesoftware.htmlunit.util.StringUtils; -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.ContextAction; -import net.sourceforge.htmlunit.corejs.javascript.ContextFactory; - /** * @author Ahmed Ashour * @author Marc Guillemot @@ -78,6 +74,9 @@ public class DomElement extends DomNamespaceNode implements Element { private static final Log LOG = LogFactory.getLog(DomElement.class); + /** src. */ + public static final String SRC_ATTRIBUTE = "src"; + /** Constant meaning that the specified attribute was not defined. */ public static final String ATTRIBUTE_NOT_DEFINED = new String(""); @@ -569,7 +568,7 @@ public void writeStyleToElement(final Map styleMap) { final SortedSet sortedValues = new TreeSet<>(styleMap.values()); for (final StyleElement e : sortedValues) { if (builder.length() != 0) { - builder.append(" "); + builder.append(' '); } builder.append(e.getName()); builder.append(": "); @@ -580,7 +579,7 @@ public void writeStyleToElement(final Map styleMap) { builder.append(" !"); builder.append(prio); } - builder.append(";"); + builder.append(';'); } final String value = builder.toString(); setAttribute("style", value); @@ -596,7 +595,7 @@ public DomNodeList getElementsByTagName(final String tagName) { /** * This should be {@link #getElementsByTagName(String)}, but is separate because of the type erasure in Java. - * @param name The name of the tag to match on + * @param tagName The name of the tag to match on * @return A list of matching elements. */ DomNodeList getElementsByTagNameImpl(final String tagName) { @@ -897,6 +896,13 @@ public

P click(final boolean shiftKey, final boolean ctrlKey, f return click(shiftKey, ctrlKey, altKey, triggerMouseEvents, false, false); } + /** + * @return true if this is an {@link DisabledElement} and disabled + */ + protected boolean isDisabledElementAndDisabled() { + return this instanceof DisabledElement && ((DisabledElement) this).isDisabled(); + } + /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
* @@ -924,10 +930,25 @@ public

P click(final boolean shiftKey, final boolean ctrlKey, f final SgmlPage page = getPage(); page.getWebClient().setCurrentWindow(page.getEnclosingWindow()); - if ((!ignoreVisibility && !isDisplayed()) - || !(page instanceof HtmlPage) - || this instanceof DisabledElement && ((DisabledElement) this).isDisabled()) { - return (P) page; + if (!ignoreVisibility) { + if (!(page instanceof HtmlPage)) { + return (P) page; + } + + if (!isDisplayed()) { + if (LOG.isWarnEnabled()) { + LOG.warn("Calling click() ignored because the target element '" + toString() + + "' is not displayed."); + } + return (P) page; + } + + if (isDisabledElementAndDisabled()) { + if (LOG.isWarnEnabled()) { + LOG.warn("Calling click() ignored because the target element '" + toString() + "' is disabled."); + } + return (P) page; + } } synchronized (page) { @@ -951,20 +972,22 @@ else if (this instanceof HtmlOption) { mouseUp(shiftKey, ctrlKey, altKey, MouseEvent.BUTTON_LEFT); } - final MouseEvent event; - if (getPage().getWebClient().getBrowserVersion().hasFeature(EVENT_ONCLICK_USES_POINTEREVENT)) { - event = new PointerEvent(getEventTargetElement(), MouseEvent.TYPE_CLICK, shiftKey, - ctrlKey, altKey, MouseEvent.BUTTON_LEFT); - } - else { - event = new MouseEvent(getEventTargetElement(), MouseEvent.TYPE_CLICK, shiftKey, - ctrlKey, altKey, MouseEvent.BUTTON_LEFT); - } + MouseEvent event = null; + if (page.getWebClient().isJavaScriptEnabled()) { + if (page.getWebClient().getBrowserVersion().hasFeature(EVENT_ONCLICK_USES_POINTEREVENT)) { + event = new PointerEvent(getEventTargetElement(), MouseEvent.TYPE_CLICK, shiftKey, + ctrlKey, altKey, MouseEvent.BUTTON_LEFT); + } + else { + event = new MouseEvent(getEventTargetElement(), MouseEvent.TYPE_CLICK, shiftKey, + ctrlKey, altKey, MouseEvent.BUTTON_LEFT); + } - if (disableProcessLabelAfterBubbling) { - event.disableProcessLabelAfterBubbling(); + if (disableProcessLabelAfterBubbling) { + event.disableProcessLabelAfterBubbling(); + } } - return click(event, ignoreVisibility); + return click(event, shiftKey, ctrlKey, altKey, ignoreVisibility); } } @@ -986,20 +1009,30 @@ protected DomNode getEventTargetElement() { * action listeners, etc. * * @param event the click event used + * @param shiftKey {@code true} if SHIFT is pressed during the click + * @param ctrlKey {@code true} if CTRL is pressed during the click + * @param altKey {@code true} if ALT is pressed during the click * @param ignoreVisibility whether to ignore visibility or not * @param

the page type * @return the page contained in the current window as returned by {@link WebClient#getCurrentWindow()} * @exception IOException if an IO error occurs */ @SuppressWarnings("unchecked") - public

P click(final Event event, final boolean ignoreVisibility) throws IOException { + public

P click(final Event event, + final boolean shiftKey, final boolean ctrlKey, final boolean altKey, + final boolean ignoreVisibility) throws IOException { final SgmlPage page = getPage(); - if ((!ignoreVisibility && !isDisplayed()) - || (this instanceof DisabledElement && ((DisabledElement) this).isDisabled())) { + if ((!ignoreVisibility && !isDisplayed()) || isDisabledElementAndDisabled()) { return (P) page; } + if (!page.getWebClient().isJavaScriptEnabled()) { + doClickStateUpdate(shiftKey, ctrlKey); + page.getWebClient().loadDownloadedResponses(); + return (P) getPage().getWebClient().getCurrentWindow().getEnclosedPage(); + } + // may be different from page when working with "orphaned pages" // (ex: clicking a link in a page that is not active anymore) final Page contentPage = page.getEnclosingWindow().getEnclosedPage(); @@ -1007,7 +1040,7 @@ public

P click(final Event event, final boolean ignoreVisibilit boolean stateUpdated = false; boolean changed = false; if (isStateUpdateFirst()) { - changed = doClickStateUpdate(event.isShiftKey(), event.isCtrlKey()); + changed = doClickStateUpdate(shiftKey, ctrlKey); stateUpdated = true; } @@ -1019,7 +1052,7 @@ public

P click(final Event event, final boolean ignoreVisibilit final boolean pageAlreadyChanged = contentPage != page.getEnclosingWindow().getEnclosedPage(); if (!pageAlreadyChanged && !stateUpdated && !eventIsAborted) { - changed = doClickStateUpdate(event.isShiftKey(), event.isCtrlKey()); + changed = doClickStateUpdate(shiftKey, ctrlKey); } } finally { @@ -1117,7 +1150,7 @@ public

P dblClick() throws IOException { @SuppressWarnings("unchecked") public

P dblClick(final boolean shiftKey, final boolean ctrlKey, final boolean altKey) throws IOException { - if (this instanceof DisabledElement && ((DisabledElement) this).isDisabled()) { + if (isDisabledElementAndDisabled()) { return (P) getPage(); } @@ -1152,7 +1185,7 @@ public

P dblClick(final boolean shiftKey, final boolean ctrlKey if (scriptResult == null) { return clickPage; } - return (P) scriptResult.getNewPage(); + return (P) getPage().getWebClient().getCurrentWindow().getEnclosedPage(); } /** @@ -1344,6 +1377,9 @@ public Page rightClick(final boolean shiftKey, final boolean ctrlKey, final bool private Page doMouseEvent(final String eventType, final boolean shiftKey, final boolean ctrlKey, final boolean altKey, final int button) { final SgmlPage page = getPage(); + if (!page.getWebClient().isJavaScriptEnabled()) { + return page; + } final ScriptResult scriptResult; final Event event; @@ -1361,7 +1397,7 @@ && getPage().getWebClient().getBrowserVersion().hasFeature(EVENT_ONCLICK_USES_PO currentPage = page; } else { - currentPage = scriptResult.getNewPage(); + currentPage = page.getWebClient().getCurrentWindow().getEnclosedPage(); } final boolean mouseOver = !MouseEvent.TYPE_MOUSE_OUT.equals(eventType); @@ -1383,7 +1419,10 @@ && getPage().getWebClient().getBrowserVersion().hasFeature(EVENT_ONCLICK_USES_PO * @return the execution result, or {@code null} if nothing is executed */ public ScriptResult fireEvent(final String eventType) { - return fireEvent(new Event(this, eventType)); + if (getPage().getWebClient().isJavaScriptEnabled()) { + return fireEvent(new Event(this, eventType)); + } + return null; } /** @@ -1395,7 +1434,7 @@ public ScriptResult fireEvent(final String eventType) { */ public ScriptResult fireEvent(final Event event) { final WebClient client = getPage().getWebClient(); - if (!client.getOptions().isJavaScriptEnabled()) { + if (!client.isJavaScriptEnabled()) { return null; } @@ -1406,16 +1445,10 @@ public ScriptResult fireEvent(final Event event) { if (LOG.isDebugEnabled()) { LOG.debug("Firing " + event); } - final EventTarget jsElt = getScriptableObject(); - final ContextAction action = new ContextAction() { - @Override - public Object run(final Context cx) { - return jsElt.fireEvent(event); - } - }; - final ContextFactory cf = ((JavaScriptEngine) client.getJavaScriptEngine()).getContextFactory(); - final ScriptResult result = (ScriptResult) cf.call(action); + final EventTarget jsElt = getScriptableObject(); + final HtmlUnitContextFactory cf = ((JavaScriptEngine) client.getJavaScriptEngine()).getContextFactory(); + final ScriptResult result = cf.callSecured(cx -> jsElt.fireEvent(event), getHtmlPageOrNull()); if (event.isAborted(result)) { preventDefault(); } @@ -1438,9 +1471,12 @@ protected void preventDefault() { public void focus() { final HtmlPage page = (HtmlPage) getPage(); page.setFocusedElement(this); - final Object o = getScriptableObject(); - if (o instanceof HTMLElement) { - ((HTMLElement) o).setActive(); + + if (page.getWebClient().isJavaScriptEnabled()) { + final Object o = getScriptableObject(); + if (o instanceof HTMLElement) { + ((HTMLElement) o).setActive(); + } } } @@ -1509,6 +1545,14 @@ public boolean matches(final String selectorString) { throw new CSSException("Error parsing CSS selectors from '" + selectorString + "': " + e.getMessage()); } } + + /** + * {@inheritDoc} + */ + @Override + public void setNodeValue(final String value) { + // Default behavior is to do nothing, overridden in some subclasses + } } /** @@ -1516,9 +1560,11 @@ public boolean matches(final String selectorString) { */ class NamedAttrNodeMapImpl implements Map, NamedNodeMap, Serializable { protected static final NamedAttrNodeMapImpl EMPTY_MAP = new NamedAttrNodeMapImpl(); + private static final DomAttr[] EMPTY_ARRAY = new DomAttr[0]; private final Map map_ = new LinkedHashMap<>(); - private final List attrPositions_ = new ArrayList<>(); + private boolean dirty_ = false; + private DomAttr[] attrPositions_ = EMPTY_ARRAY; private final DomElement domNode_; private final boolean caseSensitive_; @@ -1582,10 +1628,14 @@ public Node getNamedItemNS(final String namespaceURI, final String localName) { */ @Override public Node item(final int index) { - if (index < 0 || index >= attrPositions_.size()) { + if (index < 0 || index >= map_.size()) { return null; } - return map_.get(attrPositions_.get(index)); + if (dirty_) { + attrPositions_ = map_.values().toArray(attrPositions_); + dirty_ = false; + } + return attrPositions_[index]; } /** @@ -1629,11 +1679,8 @@ public Node setNamedItemNS(final Node node) throws DOMException { @Override public DomAttr put(final String key, final DomAttr value) { final String name = fixName(key); - final DomAttr previous = map_.put(name, value); - if (null == previous) { - attrPositions_.add(name); - } - return previous; + dirty_ = true; + return map_.put(name, value); } /** @@ -1643,7 +1690,7 @@ public DomAttr put(final String key, final DomAttr value) { public DomAttr remove(final Object key) { if (key instanceof String) { final String name = fixName((String) key); - attrPositions_.remove(name); + dirty_ = true; return map_.remove(name); } return null; @@ -1654,7 +1701,7 @@ public DomAttr remove(final Object key) { */ @Override public void clear() { - attrPositions_.clear(); + dirty_ = true; map_.clear(); } @@ -1695,7 +1742,7 @@ public DomAttr get(final Object key) { /** * Fast access. - * @param the key + * @param key the key */ protected DomAttr getDirect(final String key) { return map_.get(key); @@ -1713,7 +1760,7 @@ public boolean containsValue(final Object value) { * {@inheritDoc} */ @Override - public Set> entrySet() { + public Set> entrySet() { return map_.entrySet(); } @@ -1748,5 +1795,4 @@ public int size() { public Collection values() { return map_.values(); } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java index fa428070224..9985a960b97 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.WebAssert; -import com.gargoylesoftware.htmlunit.html.xpath.XPathUtils; +import com.gargoylesoftware.htmlunit.html.xpath.XPathHelper; import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; /** @@ -70,8 +70,8 @@ protected DomNamespaceNode(final String namespaceURI, final String qualifiedName @Override public String getNamespaceURI() { if (getPage().isHtmlPage() && !(getPage() instanceof XHtmlPage) - && HTMLParser.XHTML_NAMESPACE.equals(namespaceURI_) - && XPathUtils.isProcessingXPath()) { + && 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 // the elements by XPath without needing to add the namespace to it return null; @@ -85,7 +85,7 @@ public String getNamespaceURI() { @Override public String getLocalName() { final boolean caseSensitive = getPage().hasCaseSensitiveTagNames(); - if (!caseSensitive && XPathUtils.isProcessingXPath()) { // and this method was called from Xalan + if (!caseSensitive && XPathHelper.isProcessingXPath()) { // and this method was called from Xalan return localNameLC_; } return localName_; @@ -137,7 +137,7 @@ public void processImportNode(final Document doc) { // we have to drop the XHtmlNamespace because we did this already // for the HTML document itself final SgmlPage page = (SgmlPage) doc.getDomNodeOrDie(); - if (page.isHtmlPage() && !(page instanceof XHtmlPage) && HTMLParser.XHTML_NAMESPACE.equals(namespaceURI_)) { + if (page.isHtmlPage() && !(page instanceof XHtmlPage) && Html.XHTML_NAMESPACE.equals(namespaceURI_)) { namespaceURI_ = null; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java index 418f050476c..a6b47662bbc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,13 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.DOM_NORMALIZE_REMOVE_CHILDREN; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.QUERYSELECTORALL_NOT_IN_QUIRKS; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XPATH_ATTRIBUTE_CASE_SENSITIVE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XPATH_SELECTION_NAMESPACES; import java.io.IOException; +import java.io.ObjectInputStream; import java.io.PrintWriter; import java.io.Serializable; -import java.io.StringReader; import java.io.StringWriter; import java.nio.charset.Charset; import java.util.ArrayList; @@ -44,7 +45,6 @@ import com.gargoylesoftware.css.parser.CSSException; import com.gargoylesoftware.css.parser.CSSOMParser; import com.gargoylesoftware.css.parser.CSSParseException; -import com.gargoylesoftware.css.parser.InputSource; import com.gargoylesoftware.css.parser.javacc.CSS3Parser; import com.gargoylesoftware.css.parser.selector.Selector; import com.gargoylesoftware.css.parser.selector.SelectorList; @@ -56,7 +56,7 @@ import com.gargoylesoftware.htmlunit.WebAssert; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlElement.DisplayStyle; -import com.gargoylesoftware.htmlunit.html.xpath.XPathUtils; +import com.gargoylesoftware.htmlunit.html.xpath.XPathHelper; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration; import com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet; @@ -170,7 +170,7 @@ public abstract class DomNode implements Cloneable, Serializable, Node { private boolean attachedToPage_; - private final Object listeners_lock_ = new Serializable() { }; + private transient Object listeners_lock_ = new Object(); /** The listeners which are to be notified of characterData change. */ private Collection characterDataListeners_; @@ -195,7 +195,7 @@ protected DomNode(final SgmlPage page) { * @param startLineNumber the line number where the DOM node starts * @param startColumnNumber the column number where the DOM node starts */ - void setStartLocation(final int startLineNumber, final int startColumnNumber) { + public void setStartLocation(final int startLineNumber, final int startColumnNumber) { startLineNumber_ = startLineNumber; startColumnNumber_ = startColumnNumber; } @@ -206,7 +206,7 @@ void setStartLocation(final int startLineNumber, final int startColumnNumber) { * @param endLineNumber the line number where the DOM node ends * @param endColumnNumber the column number where the DOM node ends */ - void setEndLocation(final int endLineNumber, final int endColumnNumber) { + public void setEndLocation(final int endLineNumber, final int endColumnNumber) { endLineNumber_ = endLineNumber; endColumnNumber_ = endColumnNumber; } @@ -388,8 +388,12 @@ protected void setPreviousSibling(final DomNode previous) { previousSibling_ = previous; } - /** @param next set the nextSibling field value */ - protected void setNextSibling(final DomNode next) { + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * @param next set the nextSibling field value + */ + public void setNextSibling(final DomNode next) { nextSibling_ = next; } @@ -431,14 +435,6 @@ public String getPrefix() { return null; } - /** - * {@inheritDoc} - */ - @Override - public void setPrefix(final String prefix) { - // Empty. - } - /** * {@inheritDoc} */ @@ -559,10 +555,12 @@ public short compareDocumentPosition(final Node other) { } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Gets the ancestors of the node. * @return a list of the ancestors with the root at the first position */ - protected List getAncestors() { + public List getAncestors() { final List list = new ArrayList<>(); list.add(this); @@ -739,20 +737,22 @@ public boolean isDisplayed() { return false; } - final HtmlPage htmlPage = getHtmlPageOrNull(); - if (htmlPage != null && htmlPage.getEnclosingWindow().getWebClient().getOptions().isCssEnabled()) { + final Page page = getPage(); + final WebClient webClient = page.getEnclosingWindow().getWebClient(); + if (webClient.getOptions().isCssEnabled() && webClient.isJavaScriptEnabled()) { // display: iterate top to bottom, because if a parent is display:none, // there's nothing that a child can do to override it final List ancestors = getAncestors(); final ArrayList styles = new ArrayList<>(ancestors.size()); for (final Node node : ancestors) { + if (node instanceof HtmlElement && ((HtmlElement) node).isHidden()) { + return false; + } + final Object scriptableObject = ((DomNode) node).getScriptableObject(); if (scriptableObject instanceof HTMLElement) { final HTMLElement elem = (HTMLElement) scriptableObject; - if (elem.isHidden()) { - return false; - } final CSSStyleDeclaration style = elem.getWindow().getComputedStyle(elem, null); if (DisplayStyle.NONE.value().equals(style.getDisplay())) { return false; @@ -808,6 +808,21 @@ public String asText() { return ser.asText(this); } + /** + * Returns a textual representation of this element in the same way as + * the selenium/WebDriver WebElement#getText() property does.
+ * see https://w3c.github.io/webdriver/#get-element-text and + * https://w3c.github.io/webdriver/#dfn-bot-dom-getvisibletext + * Note: this is different from asText + * + * @return a textual representation of this element that represents what would + * be visible to the user if this page was shown in a web browser + */ + public String getVisibleText() { + final HtmlSerializerVisibleText ser = new HtmlSerializerVisibleText(); + return ser.asText(this); + } + /** * Returns a string representation of the XML document from this element and all it's children (recursively). * The charset used is the current page encoding. @@ -867,14 +882,6 @@ public String getNodeValue() { return null; } - /** - * {@inheritDoc} - */ - @Override - public void setNodeValue(final String value) { - // Default behavior is to do nothing, overridden in some subclasses - } - /** * {@inheritDoc} */ @@ -925,7 +932,7 @@ public T getScriptableObject() { // because this is a strange case we like to provide as many info as possible msg.append(" class: '"); msg.append(page.getClass().getName()); - msg.append("'"); + msg.append('\''); try { msg.append(" url: '").append(page.getUrl()).append('\''); msg.append(" content: "); @@ -1185,6 +1192,10 @@ else if (previousSibling_ != null && previousSibling_.nextSibling_ == this) { nextSibling_ = null; previousSibling_ = null; parent_ = null; + attachedToPage_ = false; + for (DomNode descendant : getDescendants()) { + descendant.attachedToPage_ = false; + } } private void fireRemoval(final DomNode exParent) { @@ -1234,13 +1245,15 @@ public void replace(final DomNode newNode) { } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Quietly removes this node and moves its children to the specified destination. "Quietly" means * that no node events are fired. This method is not appropriate for most use cases. It should * only be used in specific cases for HTML parsing hackery. * * @param destination the node to which this node's children should be moved before this node is removed */ - void quietlyRemoveAndMoveChildrenTo(final DomNode destination) { + public void quietlyRemoveAndMoveChildrenTo(final DomNode destination) { if (destination.getPage() != getPage()) { throw new RuntimeException("Cannot perform quiet move on nodes from different pages."); } @@ -1301,7 +1314,7 @@ protected void onAddedToPage() { * super.onAllChildrenAddedToPage() if you implement this method. * @param postponed whether to use {@link com.gargoylesoftware.htmlunit.javascript.PostponedAction} or no */ - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { // Empty by default. } @@ -1332,7 +1345,7 @@ public final Iterable getChildren() { protected class ChildIterator implements Iterator { private DomNode nextNode_ = firstChild_; - private DomNode currentNode_ = null; + private DomNode currentNode_; /** {@inheritDoc} */ @Override @@ -1543,6 +1556,11 @@ else if (tok.startsWith("xmlns:")) { /** * Evaluates the specified XPath expression from this node, returning the matching elements. + *
+ * Note: This implies that the ',' point to this node but the general axis like '//' are still + * looking at the whole document. E.g. if you like to get all child h1 nodes from the current one + * you have to use './/h1' instead of '//h1' because the later matches all h1 nodes of the# + * whole document. * * @param the expected type * @param xpathExpr the XPath expression to evaluate @@ -1592,7 +1610,7 @@ public boolean handlesNullPrefixes() { } } } - return XPathUtils.getByXPath(this, xpathExpr, prefixResolver); + return XPathHelper.getByXPath(this, xpathExpr, prefixResolver, hasFeature(XPATH_ATTRIBUTE_CASE_SENSITIVE)); } /** @@ -1605,7 +1623,7 @@ public boolean handlesNullPrefixes() { * @see #getCanonicalXPath() */ public List getByXPath(final String xpathExpr, final PrefixResolver resolver) { - return XPathUtils.getByXPath(this, xpathExpr, resolver); + return XPathHelper.getByXPath(this, xpathExpr, resolver, hasFeature(XPATH_ATTRIBUTE_CASE_SENSITIVE)); } /** @@ -1866,7 +1884,7 @@ protected SelectorList getSelectorList(final String selectors, final BrowserVers final CheckErrorHandler errorHandler = new CheckErrorHandler(); parser.setErrorHandler(errorHandler); - final SelectorList selectorList = parser.parseSelectors(new InputSource(new StringReader(selectors))); + final SelectorList selectorList = parser.parseSelectors(selectors); // in case of error parseSelectors returns null if (errorHandler.errorDetected()) { throw new CSSException("Invalid selectors: " + selectors); @@ -1921,7 +1939,7 @@ public boolean isAttachedToPage() { * @see HtmlScript#processImportNode(com.gargoylesoftware.htmlunit.javascript.host.dom.Document) */ public void processImportNode(final com.gargoylesoftware.htmlunit.javascript.host.dom.Document doc) { - // empty default impl + page_ = (SgmlPage) doc.getDomNodeOrDie(); } /** @@ -2000,4 +2018,8 @@ public DomElement getNextElementSibling() { return (DomElement) node; } + private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { + in.defaultReadObject(); + listeners_lock_ = new Object(); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator.java index a0b70063076..2ea9385b6c4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -191,12 +191,12 @@ private boolean isAccepted(final Node node) { * traversal) from the given node. */ private DomNode getFirstUncleNode(final DomNode node) { - if (node == root_ || node == null) { + if (node == null || node == root_) { return null; } final DomNode parent = node.getParentNode(); - if (parent == null) { + if (parent == null || parent == root_) { return null; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeList.java index baee57ba2fd..bd29e5a11be 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomProcessingInstruction.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomProcessingInstruction.java index b1bc57a1947..bca4d2c3452 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomProcessingInstruction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomProcessingInstruction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -121,4 +121,11 @@ protected void printXml(final String indent, final PrintWriter printWriter) { printWriter.print("?>"); } + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomText.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomText.java index 308f0dbc3b0..f1ba47b7a9e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,16 +168,11 @@ protected boolean isTrimmedText() { /** * Performs the effective type action, called after the keyPress event and before the keyUp event. * @param c the character you with to simulate typing - * @param startAtEnd whether typing should start at the text end or not * @param htmlElement the element in which typing occurs * @param lastType is this the last character to type */ - protected void doType(final char c, final boolean startAtEnd, final HtmlElement htmlElement, - final boolean lastType) { + protected void doType(final char c, final HtmlElement htmlElement, final boolean lastType) { initDoTypeProcessor(); - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getData().length()); - } doTypeProcessor_.doType(getData(), selectionDelegate_, c, htmlElement, lastType); } @@ -185,16 +180,11 @@ protected void doType(final char c, final boolean startAtEnd, final HtmlElement * Performs the effective type action, called after the keyPress event and before the keyUp event. * * @param keyCode the key code wish to simulate typing - * @param startAtEnd whether typing should start at the text end or not * @param htmlElement the element in which typing occurs * @param lastType is this the last character to type */ - protected void doType(final int keyCode, final boolean startAtEnd, final HtmlElement htmlElement, - final boolean lastType) { + protected void doType(final int keyCode, final HtmlElement htmlElement, final boolean lastType) { initDoTypeProcessor(); - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getData().length()); - } doTypeProcessor_.doType(getData(), selectionDelegate_, keyCode, htmlElement, lastType); } @@ -227,4 +217,20 @@ public DomNode cloneNode(final boolean deep) { return newnode; } + + /** + * Moves the selection to the end. + */ + public void moveSelectionToEnd() { + initDoTypeProcessor(); + selectionDelegate_.setSelectionStart(getData().length()); + } + + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/DomTreeWalker.java b/src/main/java/com/gargoylesoftware/htmlunit/html/DomTreeWalker.java index 55e463eaecb..04c097f2713 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/DomTreeWalker.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/DomTreeWalker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFactory.java index cbbbc775f21..b66689b1b60 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFromPointHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFromPointHandler.java index 9b433213d06..d09c5f46fcf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFromPointHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/ElementFromPointHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/FormFieldWithNameHistory.java b/src/main/java/com/gargoylesoftware/htmlunit/html/FormFieldWithNameHistory.java index 15c6c0b3a3b..dad9b4487b0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/FormFieldWithNameHistory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/FormFieldWithNameHistory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/FrameWindow.java b/src/main/java/com/gargoylesoftware/htmlunit/html/FrameWindow.java index 33d04398041..4fca6e1d724 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/FrameWindow.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/FrameWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,8 +37,9 @@ public class FrameWindow extends WebWindowImpl { FrameWindow(final BaseFrameElement frame) { super(frame.getPage().getWebClient()); frame_ = frame; - final WebWindowImpl parent = (WebWindowImpl) getParentWindow(); performRegistration(); + + final WebWindowImpl parent = (WebWindowImpl) frame_.getPage().getEnclosingWindow(); parent.addChildWindow(this); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java deleted file mode 100644 index 422fdb872fa..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParser.java +++ /dev/null @@ -1,1058 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.html; - -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_ATTRIBUTE_LOWER_CASE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COMMAND_TAG; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_ISINDEX_TAG; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_MAIN_TAG; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.KEYGEN_AS_SELECT; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.META_X_UA_COMPATIBLE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.PAGE_WAIT_LOAD_BEFORE_BODY; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.lang.reflect.InvocationTargetException; -import java.net.URL; -import java.nio.charset.Charset; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Deque; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.xerces.parsers.AbstractSAXParser; -import org.apache.xerces.util.DefaultErrorHandler; -import org.apache.xerces.xni.Augmentations; -import org.apache.xerces.xni.QName; -import org.apache.xerces.xni.XMLAttributes; -import org.apache.xerces.xni.XNIException; -import org.apache.xerces.xni.parser.XMLInputSource; -import org.apache.xerces.xni.parser.XMLParseException; -import org.apache.xerces.xni.parser.XMLParserConfiguration; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.ext.LexicalHandler; - -import com.gargoylesoftware.htmlunit.BrowserVersion; -import com.gargoylesoftware.htmlunit.ObjectInstantiationException; -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.SgmlPage; -import com.gargoylesoftware.htmlunit.WebAssert; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.WebResponse; -import com.gargoylesoftware.htmlunit.WebWindow; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLBodyElement; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; -import com.gargoylesoftware.htmlunit.svg.SvgElementFactory; - -import net.sourceforge.htmlunit.cyberneko.HTMLConfiguration; -import net.sourceforge.htmlunit.cyberneko.HTMLElements; -import net.sourceforge.htmlunit.cyberneko.HTMLEventInfo; -import net.sourceforge.htmlunit.cyberneko.HTMLScanner; -import net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer; -import net.sourceforge.htmlunit.cyberneko.HTMLTagBalancingListener; - -/** - *

SAX parser implementation that uses the NekoHTML {@link net.sourceforge.htmlunit.cyberneko.HTMLConfiguration} - * to parse HTML into a HtmlUnit-specific DOM (HU-DOM) tree.

- * - * @author Christian Sell - * @author David K. Taylor - * @author Chris Erskine - * @author Ahmed Ashour - * @author Marc Guillemot - * @author Ethan Glasser-Camp - * @author Sudhan Moghe - * @author Ronald Brill - * @author Frank Danek - * @author Carsten Steul - */ -public final class HTMLParser { - - /** XHTML namespace. */ - public static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; - - /** SVG namespace. */ - public static final String SVG_NAMESPACE = "http://www.w3.org/2000/svg"; - - /** - * The SVG factory. - */ - public static final SvgElementFactory SVG_FACTORY = new SvgElementFactory(); - - private static final Map ELEMENT_FACTORIES = new HashMap<>(); - - static { - ELEMENT_FACTORIES.put(HtmlInput.TAG_NAME, InputElementFactory.instance); - - final DefaultElementFactory defaultElementFactory = new DefaultElementFactory(); - for (final String tagName : DefaultElementFactory.SUPPORTED_TAGS_) { - ELEMENT_FACTORIES.put(tagName, defaultElementFactory); - } - } - - /** - * You should never need to create one of these! - */ - private HTMLParser() { - // Empty. - } - - /** - * Parses the HTML content from the given string into an object tree representation. - * - * @param parent the parent for the new nodes - * @param source the (X)HTML to be parsed - * @throws SAXException if a SAX error occurs - * @throws IOException if an IO error occurs - */ - public static void parseFragment(final DomNode parent, final String source) throws SAXException, IOException { - parseFragment(parent, parent, source); - } - - /** - * Parses the HTML content from the given string into an object tree representation. - * - * @param parent where the new parsed nodes will be added to - * @param context the context to build the fragment context stack - * @param source the (X)HTML to be parsed - * @throws SAXException if a SAX error occurs - * @throws IOException if an IO error occurs - */ - public static void parseFragment(final DomNode parent, final DomNode context, final String source) - throws SAXException, IOException { - final Page page = parent.getPage(); - if (!(page instanceof HtmlPage)) { - return; - } - final HtmlPage htmlPage = (HtmlPage) page; - final URL url = htmlPage.getUrl(); - - final HtmlUnitDOMBuilder domBuilder = new HtmlUnitDOMBuilder(parent, url, source); - domBuilder.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment", true); - // build fragment context stack - DomNode node = context; - final List ancestors = new ArrayList<>(); - while (node != null && node.getNodeType() != Node.DOCUMENT_NODE) { - ancestors.add(0, new QName(null, node.getNodeName(), null, null)); - node = node.getParentNode(); - } - if (ancestors.isEmpty() || !"html".equals(ancestors.get(0).localpart)) { - ancestors.add(0, new QName(null, "html", null, null)); - } - if (ancestors.size() == 1 || !"body".equals(ancestors.get(1).localpart)) { - ancestors.add(1, new QName(null, "body", null, null)); - } - - domBuilder.setFeature(HTMLScanner.ALLOW_SELFCLOSING_TAGS, true); - domBuilder.setProperty(HTMLTagBalancer.FRAGMENT_CONTEXT_STACK, ancestors.toArray(new QName[] {})); - - final XMLInputSource in = new XMLInputSource(null, url.toString(), null, new StringReader(source), null); - - htmlPage.registerParsingStart(); - htmlPage.registerSnippetParsingStart(); - try { - domBuilder.parse(in); - } - finally { - htmlPage.registerParsingEnd(); - htmlPage.registerSnippetParsingEnd(); - } - } - - /** - * Parses the HTML content from the specified WebResponse into an object tree representation. - * - * @param webResponse the response data - * @param webWindow the web window into which the page is to be loaded - * @return the page object which is the root of the DOM tree - * @throws IOException if there is an IO error - */ - public static HtmlPage parseHtml(final WebResponse webResponse, final WebWindow webWindow) throws IOException { - final HtmlPage page = new HtmlPage(webResponse, webWindow); - parse(webResponse, webWindow, page, false); - return page; - } - - /** - * Parses the XHTML content from the specified WebResponse into an object tree representation. - * - * @param webResponse the response data - * @param webWindow the web window into which the page is to be loaded - * @return the page object which is the root of the DOM tree - * @throws IOException if there is an IO error - */ - public static XHtmlPage parseXHtml(final WebResponse webResponse, final WebWindow webWindow) throws IOException { - final XHtmlPage page = new XHtmlPage(webResponse, webWindow); - parse(webResponse, webWindow, page, true); - return page; - } - - private static void parse(final WebResponse webResponse, final WebWindow webWindow, final HtmlPage page, - final boolean xhtml) - throws IOException { - - webWindow.setEnclosedPage(page); - - final URL url = webResponse.getWebRequest().getUrl(); - final HtmlUnitDOMBuilder domBuilder = new HtmlUnitDOMBuilder(page, url, null); - - Charset charset = webResponse.getContentCharsetOrNull(); - try { - // handle charset - if (charset == null) { - final Charset specifiedCharset = webResponse.getWebRequest().getCharset(); - if (specifiedCharset != null) { - charset = specifiedCharset; - } - } - else { - domBuilder.setFeature(HTMLScanner.IGNORE_SPECIFIED_CHARSET, true); - } - - // xml content is different - if (xhtml) { - domBuilder.setFeature(HTMLScanner.ALLOW_SELFCLOSING_TAGS, true); - } - } - catch (final Exception e) { - throw new ObjectInstantiationException("Error setting HTML parser feature", e); - } - - try (InputStream content = webResponse.getContentAsStream()) { - String encoding = null; - if (charset != null) { - encoding = charset.name(); - } - final XMLInputSource in = new XMLInputSource(null, url.toString(), null, content, encoding); - - page.registerParsingStart(); - try { - domBuilder.parse(in); - } - catch (final XNIException e) { - // extract enclosed exception - final Throwable origin = extractNestedException(e); - throw new RuntimeException("Failed parsing content from " + url, origin); - } - } - finally { - page.registerParsingEnd(); - } - - addBodyToPageIfNecessary(page, true, domBuilder.body_ != null); - } - - /** - * Adds a body element to the current page, if necessary. Strictly speaking, this should - * probably be done by NekoHTML. See the bug linked below. If and when that bug is fixed, - * we may be able to get rid of this code. - * - * http://sourceforge.net/p/nekohtml/bugs/15/ - * @param page - * @param originalCall - * @param checkInsideFrameOnly true if the original page had body that was removed by JavaScript - */ - private static void addBodyToPageIfNecessary( - final HtmlPage page, final boolean originalCall, final boolean checkInsideFrameOnly) { - // IE waits for the whole page to load before initializing bodies for frames. - final boolean waitToLoad = page.hasFeature(PAGE_WAIT_LOAD_BEFORE_BODY); - if (page.getEnclosingWindow() instanceof FrameWindow && originalCall && waitToLoad) { - return; - } - - // Find out if the document already has a body element (or frameset). - final Element doc = page.getDocumentElement(); - boolean hasBody = false; - for (Node child = doc.getFirstChild(); child != null; child = child.getNextSibling()) { - if (child instanceof HtmlBody || child instanceof HtmlFrameSet) { - hasBody = true; - break; - } - } - - // If the document does not have a body, add it. - if (!hasBody && !checkInsideFrameOnly) { - final HtmlBody body = new HtmlBody("body", page, null, false); - doc.appendChild(body); - } - - // If this is IE, we need to initialize the bodies of any frames, as well. - // This will already have been done when emulating FF (see above). - if (waitToLoad) { - for (final FrameWindow frame : page.getFrames()) { - final Page containedPage = frame.getEnclosedPage(); - if (containedPage != null && containedPage.isHtmlPage()) { - addBodyToPageIfNecessary((HtmlPage) containedPage, false, false); - } - } - } - } - - /** - * Extract nested exception within an XNIException (Nekohtml uses reflection and generated - * exceptions are wrapped many times within XNIException and InvocationTargetException) - * - * @param e the original XNIException - * @return the cause exception - */ - static Throwable extractNestedException(final Throwable e) { - Throwable originalException = e; - Throwable cause = ((XNIException) e).getException(); - while (cause != null) { - originalException = cause; - if (cause instanceof XNIException) { - cause = ((XNIException) cause).getException(); - } - else if (cause instanceof InvocationTargetException) { - cause = cause.getCause(); - } - else { - cause = null; - } - } - return originalException; - } - - /** - * @param tagName an HTML element tag name - * @return a factory for creating HtmlElements representing the given tag - */ - public static ElementFactory getFactory(final String tagName) { - final ElementFactory result = ELEMENT_FACTORIES.get(tagName); - - if (result != null) { - return result; - } - return UnknownElementFactory.instance; - } - - /** - * Returns the pre-registered element factory corresponding to the specified tag, or an UnknownElementFactory. - * @param page the page - * @param namespaceURI the namespace URI - * @param qualifiedName the qualified name - * @param insideSvg is the node inside an SVG node or not - * @param svgSupport true if called from javascript createElementNS - * @return the pre-registered element factory corresponding to the specified tag, or an UnknownElementFactory - */ - static ElementFactory getElementFactory(final SgmlPage page, final String namespaceURI, - final String qualifiedName, final boolean insideSvg, final boolean svgSupport) { - if (insideSvg) { - return SVG_FACTORY; - } - - if (namespaceURI == null || namespaceURI.isEmpty() - || XHTML_NAMESPACE.equals(namespaceURI) - || SVG_NAMESPACE.equals(namespaceURI) - || !qualifiedName.contains(":")) { - - String tagName = qualifiedName; - final int index = tagName.indexOf(':'); - if (index == -1) { - tagName = tagName.toLowerCase(Locale.ROOT); - } - else { - tagName = tagName.substring(index + 1); - } - final ElementFactory factory; - if (svgSupport && !"svg".equals(tagName) && SVG_NAMESPACE.equals(namespaceURI)) { - factory = SVG_FACTORY; - } - else { - factory = ELEMENT_FACTORIES.get(tagName); - } - - if (factory != null) { - return factory; - } - } - return UnknownElementFactory.instance; - } - - /** - * The parser and DOM builder. This class subclasses Xerces's AbstractSAXParser and implements - * the ContentHandler interface. Thus all parser APIs are kept private. The ContentHandler methods - * consume SAX events to build the page DOM - */ - static final class HtmlUnitDOMBuilder extends AbstractSAXParser - implements ContentHandler, LexicalHandler, HTMLTagBalancingListener { - - private enum HeadParsed { YES, SYNTHESIZED, NO } - - private final HtmlPage page_; - - private Locator locator_; - private final Deque stack_ = new ArrayDeque<>(); - - /** Did the snippet tried to overwrite the start node? */ - private boolean snippetStartNodeOverwritten_; - private final int initialSize_; - private DomNode currentNode_; - private StringBuilder characters_; - private HeadParsed headParsed_ = HeadParsed.NO; - private HtmlElement body_; - private boolean lastTagWasSynthesized_; - private HtmlForm formWaitingForLostChildren_; - private boolean insideSvg_; - - private static final String FEATURE_AUGMENTATIONS = "http://cyberneko.org/html/features/augmentations"; - private static final String FEATURE_PARSE_NOSCRIPT - = "http://cyberneko.org/html/features/parse-noscript-content"; - - /** - * Parses and then inserts the specified HTML content into the HTML content currently being parsed. - * @param html the HTML content to push - */ - public void pushInputString(final String html) { - page_.registerParsingStart(); - page_.registerInlineSnippetParsingStart(); - try { - final WebResponse webResponse = page_.getWebResponse(); - final Charset charset = webResponse.getContentCharset(); - final String url = webResponse.getWebRequest().getUrl().toString(); - final XMLInputSource in = new XMLInputSource(null, url, null, new StringReader(html), charset.name()); - ((HTMLConfiguration) fConfiguration).evaluateInputSource(in); - } - finally { - page_.registerParsingEnd(); - page_.registerInlineSnippetParsingEnd(); - } - } - - /** - * Creates a new builder for parsing the specified response contents. - * @param node the location at which to insert the new content - * @param url the page's URL - */ - private HtmlUnitDOMBuilder(final DomNode node, final URL url, final String htmlContent) { - super(createConfiguration(node.getPage().getWebClient().getBrowserVersion())); - - page_ = (HtmlPage) node.getPage(); - - currentNode_ = node; - for (final Node ancestor : currentNode_.getAncestors()) { - stack_.push((DomNode) ancestor); - } - - final WebClient webClient = page_.getWebClient(); - final HTMLParserListener listener = webClient.getHTMLParserListener(); - final boolean reportErrors = listener != null; - if (reportErrors) { - fConfiguration.setErrorHandler(new HTMLErrorHandler(listener, url, htmlContent)); - } - - try { - setFeature(FEATURE_AUGMENTATIONS, true); - setProperty("http://cyberneko.org/html/properties/names/elems", "default"); - if (!webClient.getBrowserVersion().hasFeature(HTML_ATTRIBUTE_LOWER_CASE)) { - setProperty("http://cyberneko.org/html/properties/names/attrs", "no-change"); - } - setFeature("http://cyberneko.org/html/features/report-errors", reportErrors); - setFeature(FEATURE_PARSE_NOSCRIPT, !webClient.getOptions().isJavaScriptEnabled()); - setFeature(HTMLScanner.ALLOW_SELFCLOSING_IFRAME, false); - - setContentHandler(this); - setLexicalHandler(this); //comments and CDATA - } - catch (final SAXException e) { - throw new ObjectInstantiationException("unable to create HTML parser", e); - } - initialSize_ = stack_.size(); - } - - /** - * Create the configuration depending on the simulated browser - * @param webClient the current WebClient - * @return the configuration - */ - private static XMLParserConfiguration createConfiguration(final BrowserVersion browserVersion) { - final HTMLConfiguration configuration = new HTMLConfiguration(); - if (browserVersion.hasFeature(HTML_COMMAND_TAG)) { - configuration.htmlElements_.setElement(new HTMLElements.Element(HTMLElements.COMMAND, "COMMAND", - HTMLElements.Element.EMPTY, HTMLElements.BODY, null)); - } - if (browserVersion.hasFeature(HTML_ISINDEX_TAG)) { - configuration.htmlElements_.setElement(new HTMLElements.Element(HTMLElements.ISINDEX, "ISINDEX", - HTMLElements.Element.INLINE, HTMLElements.BODY, null)); - } - if (browserVersion.hasFeature(HTML_MAIN_TAG)) { - configuration.htmlElements_.setElement(new HTMLElements.Element(HTMLElements.MAIN, "MAIN", - HTMLElements.Element.INLINE, HTMLElements.BODY, null)); - } - - return configuration; - } - - /** - * @return the document locator - */ - public Locator getLocator() { - return locator_; - } - - /** {@inheritDoc ContentHandler#setDocumentLocator} */ - @Override - public void setDocumentLocator(final Locator locator) { - locator_ = locator; - } - - /** {@inheritDoc ContentHandler#startDocument()} */ - @Override - public void startDocument() throws SAXException { - } - - /** {@inheritDoc} */ - @Override - public void startElement(final QName element, final XMLAttributes attributes, final Augmentations augs) - throws XNIException { - // augs might change so we store only the interesting part - lastTagWasSynthesized_ = isSynthesized(augs); - super.startElement(element, attributes, augs); - } - - /** {@inheritDoc ContentHandler#startElement(String,String,String,Attributes)} */ - @Override - public void startElement(String namespaceURI, final String localName, String qName, final Attributes atts) - throws SAXException { - - if (snippetStartNodeOverwritten_) { - snippetStartNodeOverwritten_ = false; - return; - } - handleCharacters(); - - String tagLower = localName.toLowerCase(Locale.ROOT); - if (page_.isParsingHtmlSnippet() && ("html".equals(tagLower) || "body".equals(tagLower))) { - return; - } - - if ("head".equals(tagLower)) { - if (headParsed_ == HeadParsed.YES || page_.isParsingHtmlSnippet()) { - return; - } - - headParsed_ = lastTagWasSynthesized_ ? HeadParsed.SYNTHESIZED : HeadParsed.YES; - } - - if (namespaceURI != null) { - namespaceURI = namespaceURI.trim(); - } - - // add a head if none was there - else if (headParsed_ == HeadParsed.NO && ("body".equals(tagLower) || "frameset".equals(tagLower))) { - final ElementFactory factory = getElementFactory(page_, namespaceURI, "head", insideSvg_, false); - final DomElement newElement = factory.createElement(page_, "head", null); - currentNode_.appendChild(newElement); - headParsed_ = HeadParsed.SYNTHESIZED; - } - - // If we're adding a body element, keep track of any temporary synthetic ones - // that we may have had to create earlier (for document.write(), for example). - HtmlBody oldBody = null; - if ("body".equals(qName) && page_.getBody() instanceof HtmlBody) { - oldBody = (HtmlBody) page_.getBody(); - } - - // Need to reset this at each starting form tag because it could be set from a synthesized - // end tag. - if ("form".equals(tagLower)) { - formWaitingForLostChildren_ = null; - } - - // Add the new node. - if (!(page_ instanceof XHtmlPage) && XHTML_NAMESPACE.equals(namespaceURI)) { - namespaceURI = null; - } - - final boolean keyGenAsSelect = "keygen".equals(tagLower) && page_.hasFeature(KEYGEN_AS_SELECT); - if (keyGenAsSelect) { - tagLower = "select"; - qName = "select"; - } - - final ElementFactory factory = getElementFactory(page_, namespaceURI, qName, insideSvg_, false); - if (factory == SVG_FACTORY) { - namespaceURI = SVG_NAMESPACE; - } - final DomElement newElement = factory.createElementNS(page_, namespaceURI, qName, atts, true); - newElement.setStartLocation(locator_.getLineNumber(), locator_.getColumnNumber()); - - // parse can't replace everything as it does not buffer elements while parsing - addNodeToRightParent(currentNode_, newElement); - - if ("svg".equals(tagLower)) { - insideSvg_ = true; - } - - // If we had an old synthetic body and we just added a real body element, quietly - // remove the old body and move its children to the real body element we just added. - if (oldBody != null) { - oldBody.quietlyRemoveAndMoveChildrenTo(newElement); - } - - if ("body".equals(tagLower)) { - body_ = (HtmlElement) newElement; - } - else if ("meta".equals(tagLower) && page_.hasFeature(META_X_UA_COMPATIBLE)) { - final HtmlMeta meta = (HtmlMeta) newElement; - if ("X-UA-Compatible".equals(meta.getHttpEquivAttribute())) { - final String content = meta.getContentAttribute(); - if (content.startsWith("IE=")) { - final String mode = content.substring(3).trim(); - final int version = page_.getWebClient().getBrowserVersion().getBrowserVersionNumeric(); - if ("edge".equals(mode)) { - ((HTMLDocument) page_.getScriptableObject()).forceDocumentMode(version); - } - else { - try { - int value = Integer.parseInt(mode); - if (value > version) { - value = version; - } - ((HTMLDocument) page_.getScriptableObject()).forceDocumentMode(value); - } - catch (final Exception e) { - // ignore - } - } - } - } - } - if (keyGenAsSelect) { - DomElement option = factory.createElementNS(page_, namespaceURI, "option", null, true); - option.appendChild(new DomText(page_, "High Grade")); - newElement.appendChild(option); - - option = factory.createElementNS(page_, namespaceURI, "option", null, true); - option.appendChild(new DomText(page_, "Medium Grade")); - newElement.appendChild(option); - } - currentNode_ = newElement; - stack_.push(currentNode_); - } - - /** - * Adds the new node to the right parent that is not necessary the currentNode in case of - * malformed HTML code. The method tries to emulate the behavior of Firefox. - */ - private void addNodeToRightParent(final DomNode currentNode, final DomElement newElement) { - final String currentNodeName = currentNode.getNodeName(); - final String newNodeName = newElement.getNodeName(); - - DomNode parent = currentNode; - - // If the new node is a table element and the current node isn't one search the stack for the - // correct parent. - if ("tr".equals(newNodeName) && !isTableChild(currentNodeName)) { - parent = findElementOnStack("tbody", "thead", "tfoot"); - } - else if (isTableChild(newNodeName) && !"table".equals(currentNodeName)) { - parent = findElementOnStack("table"); - } - else if (isTableCell(newNodeName) && !"tr".equals(currentNodeName)) { - parent = findElementOnStack("tr"); - } - - // If the parent changed and the old parent was a form it is now waiting for lost children. - if (parent != currentNode && "form".equals(currentNodeName)) { - formWaitingForLostChildren_ = (HtmlForm) currentNode; - } - - final String parentNodeName = parent.getNodeName(); - - if (("table".equals(parentNodeName) && !isTableChild(newNodeName)) - || (isTableChild(parentNodeName) && !"caption".equals(parentNodeName) - && !"colgroup".equals(parentNodeName) && !"tr".equals(newNodeName)) - || ("colgroup".equals(parentNodeName) && !"col".equals(newNodeName)) - || ("tr".equals(parentNodeName) && !isTableCell(newNodeName))) { - // If its a form or submittable just add it even though the resulting DOM is incorrect. - // Otherwise insert the element before the table. - if ("form".equals(newNodeName)) { - formWaitingForLostChildren_ = (HtmlForm) newElement; - parent.appendChild(newElement); - } - else if (newElement instanceof SubmittableElement) { - if (formWaitingForLostChildren_ != null) { - formWaitingForLostChildren_.addLostChild((HtmlElement) newElement); - } - parent.appendChild(newElement); - } - else { - parent = findElementOnStack("table"); - parent.insertBefore(newElement); - } - } - else if (formWaitingForLostChildren_ != null && "form".equals(parentNodeName)) { - // Do not append any children to invalid form. Submittable are inserted after the form, - // everything else before the table. - if (newElement instanceof SubmittableElement) { - formWaitingForLostChildren_.addLostChild((HtmlElement) newElement); - parent.getParentNode().appendChild(newElement); - } - else { - parent = findElementOnStack("table"); - parent.insertBefore(newElement); - } - } - else if (formWaitingForLostChildren_ != null && newElement instanceof SubmittableElement) { - formWaitingForLostChildren_.addLostChild((HtmlElement) newElement); - parent.appendChild(newElement); - } - else { - parent.appendChild(newElement); - } - } - - private DomNode findElementOnStack(final String... searchedElementNames) { - DomNode searchedNode = null; - for (final DomNode node : stack_) { - if (ArrayUtils.contains(searchedElementNames, node.getNodeName())) { - searchedNode = node; - break; - } - } - - if (searchedNode == null) { - searchedNode = stack_.peek(); // this is surely wrong but at least it won't throw a NPE - } - - return searchedNode; - } - - private static boolean isTableChild(final String nodeName) { - return "thead".equals(nodeName) || "tbody".equals(nodeName) - || "tfoot".equals(nodeName) || "caption".equals(nodeName) - || "colgroup".equals(nodeName); - } - - private static boolean isTableCell(final String nodeName) { - return "td".equals(nodeName) || "th".equals(nodeName); - } - - /** {@inheritDoc} */ - @Override - public void endElement(final QName element, final Augmentations augs) - throws XNIException { - // augs might change so we store only the interesting part - lastTagWasSynthesized_ = isSynthesized(augs); - super.endElement(element, augs); - } - - /** {@inheritDoc ContentHandler@endElement(String,String,String)} */ - @Override - public void endElement(final String namespaceURI, final String localName, final String qName) - throws SAXException { - - handleCharacters(); - - final String tagLower = localName.toLowerCase(Locale.ROOT); - - if (page_.isParsingHtmlSnippet()) { - if ("html".equals(tagLower) || "body".equals(tagLower)) { - return; - } - if (stack_.size() == initialSize_) { - snippetStartNodeOverwritten_ = true; - return; - } - } - - if ("svg".equals(tagLower)) { - insideSvg_ = false; - } - - // Need to reset this at each closing form tag because a valid form could start afterwards. - if ("form".equals(tagLower)) { - formWaitingForLostChildren_ = null; - } - - final DomNode previousNode = stack_.pop(); //remove currentElement from stack - previousNode.setEndLocation(locator_.getLineNumber(), locator_.getColumnNumber()); - - // special handling for form lost children (malformed HTML code where is synthesized) - if (previousNode instanceof HtmlForm && lastTagWasSynthesized_) { - formWaitingForLostChildren_ = (HtmlForm) previousNode; - } - - if (!stack_.isEmpty()) { - currentNode_ = stack_.peek(); - } - - final boolean postponed = page_.isParsingInlineHtmlSnippet(); - previousNode.onAllChildrenAddedToPage(postponed); - } - - /** {@inheritDoc} */ - @Override - public void characters(final char[] ch, final int start, final int length) throws SAXException { - if (characters_ == null) { - characters_ = new StringBuilder(); - } - characters_.append(ch, start, length); - } - - /** {@inheritDoc} */ - @Override - public void ignorableWhitespace(final char[] ch, final int start, final int length) throws SAXException { - if (characters_ == null) { - characters_ = new StringBuilder(); - } - characters_.append(ch, start, length); - } - - /** - * Picks up the character data accumulated so far and add it to the current element as a text node. - */ - private void handleCharacters() { - if (characters_ != null && characters_.length() != 0) { - if (currentNode_ instanceof HtmlHtml) { - // In HTML, the node only has two possible children: - // the and the ; any text is ignored. - characters_.setLength(0); - } - else { - // Use the normal behavior: append a text node for the accumulated text. - final String textValue = characters_.toString(); - final DomText text = new DomText(page_, textValue); - characters_.setLength(0); - - if (StringUtils.isNotBlank(textValue)) { - // malformed HTML: some text => text comes before the table - if (currentNode_ instanceof HtmlTableRow) { - final HtmlTableRow row = (HtmlTableRow) currentNode_; - final HtmlTable enclosingTable = row.getEnclosingTable(); - if (enclosingTable != null) { // may be null when called from Range.createContextualFragment - if (enclosingTable.getPreviousSibling() instanceof DomText) { - final DomText domText = (DomText) enclosingTable.getPreviousSibling(); - domText.setTextContent(domText + textValue); - } - else { - enclosingTable.insertBefore(text); - } - } - } - else if (currentNode_ instanceof HtmlTable) { - final HtmlTable enclosingTable = (HtmlTable) currentNode_; - if (enclosingTable.getPreviousSibling() instanceof DomText) { - final DomText domText = (DomText) enclosingTable.getPreviousSibling(); - domText.setTextContent(domText + textValue); - } - else { - enclosingTable.insertBefore(text); - } - } - else if (currentNode_ instanceof HtmlImage) { - currentNode_.setNextSibling(text); - } - else { - currentNode_.appendChild(text); - } - } - else { - currentNode_.appendChild(text); - } - } - } - } - - /** {@inheritDoc} */ - @Override - public void endDocument() throws SAXException { - handleCharacters(); - final DomNode currentPage = page_; - currentPage.setEndLocation(locator_.getLineNumber(), locator_.getColumnNumber()); - } - - /** {@inheritDoc} */ - @Override - public void startPrefixMapping(final String prefix, final String uri) throws SAXException { - } - - /** {@inheritDoc} */ - @Override - public void endPrefixMapping(final String prefix) throws SAXException { - } - - /** {@inheritDoc} */ - @Override - public void processingInstruction(final String target, final String data) throws SAXException { - } - - /** {@inheritDoc} */ - @Override - public void skippedEntity(final String name) throws SAXException { - } - - // LexicalHandler methods - - /** {@inheritDoc} */ - @Override - public void comment(final char[] ch, final int start, final int length) { - handleCharacters(); - final String data = new String(ch, start, length); - final DomComment comment = new DomComment(page_, data); - currentNode_.appendChild(comment); - } - - /** {@inheritDoc} */ - @Override - public void endCDATA() { - } - - /** {@inheritDoc} */ - @Override - public void endDTD() { - } - - /** {@inheritDoc} */ - @Override - public void endEntity(final String name) { - } - - /** {@inheritDoc} */ - @Override - public void startCDATA() { - } - - /** {@inheritDoc} */ - @Override - public void startDTD(final String name, final String publicId, final String systemId) { - final DomDocumentType type = new DomDocumentType(page_, name, publicId, systemId); - page_.setDocumentType(type); - - final Node child; - child = type; - page_.appendChild(child); - } - - /** {@inheritDoc} */ - @Override - public void startEntity(final String name) { - } - - /** - * {@inheritDoc} - */ - @Override - public void ignoredEndElement(final QName element, final Augmentations augs) { - // if real is reached, don't accept fields anymore as lost children - if ("form".equals(element.localpart)) { - formWaitingForLostChildren_ = null; - } - } - - /** - * {@inheritDoc} - */ - @Override - public void ignoredStartElement(final QName elem, final XMLAttributes attrs, final Augmentations augs) { - // when multiple body elements are encountered, the attributes of the discarded - // elements are used when not previously defined - if (body_ != null && "body".equalsIgnoreCase(elem.localpart) && attrs != null) { - copyAttributes(body_, attrs); - } - if (body_ != null && "html".equalsIgnoreCase(elem.localpart) && attrs != null) { - copyAttributes((DomElement) body_.getParentNode(), attrs); - } - } - - private static void copyAttributes(final DomElement to, final XMLAttributes attrs) { - final int length = attrs.getLength(); - for (int i = 0; i < length; i++) { - final String attrName = attrs.getLocalName(i).toLowerCase(Locale.ROOT); - if (to.getAttributes().getNamedItem(attrName) == null) { - to.setAttribute(attrName, attrs.getValue(i)); - if (attrName.startsWith("on") && to.getScriptableObject() instanceof HTMLBodyElement) { - final HTMLBodyElement jsBody = to.getScriptableObject(); - jsBody.createEventHandlerFromAttribute(attrName, attrs.getValue(i)); - } - } - } - } - - /** - * {@inheritDoc} - */ - @Override - public void parse(final XMLInputSource inputSource) throws XNIException, IOException { - final HtmlUnitDOMBuilder oldBuilder = page_.getBuilder(); - page_.setBuilder(this); - try { - super.parse(inputSource); - } - finally { - page_.setBuilder(oldBuilder); - } - } - - private static boolean isSynthesized(final Augmentations augs) { - final HTMLEventInfo info = (augs == null) ? null - : (HTMLEventInfo) augs.getItem(FEATURE_AUGMENTATIONS); - return info != null && info.isSynthesized(); - } - } -} - -/** - * Utility to transmit parsing errors to a {@link HTMLParserListener}. - */ -class HTMLErrorHandler extends DefaultErrorHandler { - private final HTMLParserListener listener_; - private final URL url_; - private String html_; - - HTMLErrorHandler(final HTMLParserListener listener, final URL url, final String htmlContent) { - WebAssert.notNull("listener", listener); - WebAssert.notNull("url", url); - listener_ = listener; - url_ = url; - html_ = htmlContent; - } - - /** @see DefaultErrorHandler#error(String,String,XMLParseException) */ - @Override - public void error(final String domain, final String key, - final XMLParseException exception) throws XNIException { - listener_.error(exception.getMessage(), - url_, - html_, - exception.getLineNumber(), - exception.getColumnNumber(), - key); - } - - /** @see DefaultErrorHandler#warning(String,String,XMLParseException) */ - @Override - public void warning(final String domain, final String key, - final XMLParseException exception) throws XNIException { - listener_.warning(exception.getMessage(), - url_, - html_, - exception.getLineNumber(), - exception.getColumnNumber(), - key); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MozCSSKeyframesRule.java b/src/main/java/com/gargoylesoftware/htmlunit/html/Html.java similarity index 57% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MozCSSKeyframesRule.java rename to src/main/java/com/gargoylesoftware/htmlunit/html/Html.java index 4b60b44f9b4..b4d9ba8f432 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MozCSSKeyframesRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/Html.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,17 +12,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.javascript.host.css; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +package com.gargoylesoftware.htmlunit.html; /** - * A JavaScript object for {@code MozCSSKeyframesRule}. + * Html constants. * - * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF45) -public class MozCSSKeyframesRule extends CSSRule { +public final class Html { + + /** XHTML namespace. */ + public static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; + + /** SVG namespace. */ + public static final String SVG_NAMESPACE = "http://www.w3.org/2000/svg"; + + private Html() { + } + } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAbbreviated.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAbbreviated.java index 475ba50fc82..87f65f4adb6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAbbreviated.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAbbreviated.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAcronym.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAcronym.java index a749f9c3fc6..4ef26f6dfc0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAcronym.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAcronym.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAddress.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAddress.java index 07b0715d93b..4c8836e03f6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAddress.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAnchor.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAnchor.java index 239f992b30c..86e2a6c6dbc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAnchor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAnchor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.ANCHOR_EMPTY_HREF_NO_FILENAME; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.ANCHOR_IGNORE_TARGET_FOR_JS_HREF; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.ANCHOR_SEND_PING_REQUEST; import java.io.IOException; import java.net.MalformedURLException; @@ -31,7 +31,6 @@ import com.gargoylesoftware.htmlunit.HttpMethod; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.SgmlPage; -import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebWindow; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; @@ -74,17 +73,18 @@ public class HtmlAnchor extends HtmlElement { */ @Override @SuppressWarnings("unchecked") - public

P click(final Event event, final boolean ignoreVisibility) throws IOException { - final boolean ctrl = event.isCtrlKey(); + public

P click(final Event event, + final boolean shiftKey, final boolean ctrlKey, final boolean altKey, + final boolean ignoreVisibility) throws IOException { WebWindow oldWebWindow = null; - if (ctrl) { + if (ctrlKey) { oldWebWindow = ((HTMLElement) event.getSrcElement()).getDomNodeOrDie() .getPage().getWebClient().getCurrentWindow(); } - P page = super.click(event, ignoreVisibility); + P page = super.click(event, shiftKey, ctrlKey, altKey, ignoreVisibility); - if (ctrl) { + if (ctrlKey) { page.getEnclosingWindow().getWebClient().setCurrentWindow(oldWebWindow); page = (P) oldWebWindow.getEnclosedPage(); } @@ -131,27 +131,22 @@ protected void doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey, builder.append(ch); } - if (hasFeature(ANCHOR_IGNORE_TARGET_FOR_JS_HREF) && !shiftKey && !ctrlKey) { - page.executeJavaScript(builder.toString(), "javascript url", getStartLineNumber()); + final String target; + if (shiftKey || ctrlKey) { + target = "_blank"; } else { - final String target; - if (shiftKey || ctrlKey) { - target = "_blank"; - } - else { - target = page.getResolvedTarget(getTargetAttribute()); - } - final WebWindow win = page.getWebClient().openTargetWindow(page.getEnclosingWindow(), target, "_self"); - Page enclosedPage = win.getEnclosedPage(); - if (enclosedPage == null) { - win.getWebClient().getPage(win, new WebRequest(WebClient.URL_ABOUT_BLANK)); - enclosedPage = win.getEnclosedPage(); - } - if (enclosedPage != null && enclosedPage.isHtmlPage()) { - page = (HtmlPage) enclosedPage; - page.executeJavaScript(builder.toString(), "javascript url", getStartLineNumber()); - } + target = page.getResolvedTarget(getTargetAttribute()); + } + final WebWindow win = page.getWebClient().openTargetWindow(page.getEnclosingWindow(), target, "_self"); + Page enclosedPage = win.getEnclosedPage(); + if (enclosedPage == null) { + win.getWebClient().getPage(win, WebRequest.newAboutBlankRequest()); + enclosedPage = win.getEnclosedPage(); + } + if (enclosedPage != null && enclosedPage.isHtmlPage()) { + page = (HtmlPage) enclosedPage; + page.executeJavaScript(builder.toString(), "javascript url", getStartLineNumber()); } return; } @@ -159,7 +154,7 @@ protected void doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey, final URL url = getTargetUrl(href, page); final BrowserVersion browser = page.getWebClient().getBrowserVersion(); - if (ATTRIBUTE_NOT_DEFINED != getPingAttribute() && browser.hasFeature(ANCHOR_IGNORE_TARGET_FOR_JS_HREF)) { + if (ATTRIBUTE_NOT_DEFINED != getPingAttribute() && browser.hasFeature(ANCHOR_SEND_PING_REQUEST)) { final URL pingUrl = getTargetUrl(getPingAttribute(), page); final WebRequest pingRequest = new WebRequest(pingUrl, HttpMethod.POST); pingRequest.setAdditionalHeader(HttpHeader.PING_FROM, page.getUrl().toExternalForm()); @@ -168,8 +163,11 @@ protected void doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey, page.getWebClient().loadWebResponse(pingRequest); } - final WebRequest webRequest = new WebRequest(url, browser.getHtmlAcceptHeader()); + final WebRequest webRequest = new WebRequest(url, browser.getHtmlAcceptHeader(), + browser.getAcceptEncodingHeader()); + // use the page encoding even if this is a GET requests webRequest.setCharset(page.getCharset()); + webRequest.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); if (LOG.isDebugEnabled()) { LOG.debug( diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java index 981a6517279..dfd2eee87be 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlApplet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.APPLET_INLINE_BLOCK; - import java.applet.Applet; import java.io.IOException; import java.net.URL; @@ -63,7 +61,6 @@ public class HtmlApplet extends HtmlElement { public static final String TAG_NAME = "applet"; private Applet applet_; - private AppletClassLoader appletClassLoader_; private List archiveUrls_; /** @@ -261,76 +258,78 @@ private synchronized void setupAppletIfNeeded() throws IOException { appletClassName = appletClassName.substring(0, appletClassName.length() - 6); } - appletClassLoader_ = new AppletClassLoader((Window) getPage().getEnclosingWindow().getScriptableObject(), - Thread.currentThread().getContextClassLoader()); - - final String documentUrl = page.getUrl().toExternalForm(); - String baseUrl = UrlUtils.resolveUrl(documentUrl, "."); - if (StringUtils.isNotEmpty(codebaseProperty)) { - // codebase can be relative to the page - baseUrl = UrlUtils.resolveUrl(baseUrl, codebaseProperty); - } - if (!baseUrl.endsWith("/")) { - baseUrl = baseUrl + "/"; - } + try (AppletClassLoader appletClassLoader = + new AppletClassLoader((Window) getPage().getEnclosingWindow().getScriptableObject(), + Thread.currentThread().getContextClassLoader())) { - // check archive - final List archiveUrls = new LinkedList<>(); - String[] archives = StringUtils.split(params.get(ARCHIVE), ','); - if (null != archives) { - for (int i = 0; i < archives.length; i++) { - final String tmpArchive = archives[i].trim(); - final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive); - final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); - - appletClassLoader_.addArchiveToClassPath(archiveUrl); - archiveUrls.add(archiveUrl); + final String documentUrl = page.getUrl().toExternalForm(); + String baseUrl = UrlUtils.resolveUrl(documentUrl, "."); + if (StringUtils.isNotEmpty(codebaseProperty)) { + // codebase can be relative to the page + baseUrl = UrlUtils.resolveUrl(baseUrl, codebaseProperty); } - } - archives = StringUtils.split(params.get(CACHE_ARCHIVE), ','); - if (null != archives) { - for (int i = 0; i < archives.length; i++) { - final String tmpArchive = archives[i].trim(); - final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive); - final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); - - appletClassLoader_.addArchiveToClassPath(archiveUrl); - archiveUrls.add(archiveUrl); + if (!baseUrl.endsWith("/")) { + baseUrl = baseUrl + "/"; } - } - archiveUrls_ = Collections.unmodifiableList(archiveUrls); - // no archive attribute, single class - if (archiveUrls_.isEmpty()) { - final String tempUrl = UrlUtils.resolveUrl(baseUrl, getCodeAttribute()); - final URL classUrl = UrlUtils.toUrlUnsafe(tempUrl); + // check archive + final List archiveUrls = new LinkedList<>(); + String[] archives = StringUtils.split(params.get(ARCHIVE), ','); + if (null != archives) { + for (String tmpArchive : archives) { + final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive.trim()); + final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); + + appletClassLoader.addArchiveToClassPath(archiveUrl); + archiveUrls.add(archiveUrl); + } + } + archives = StringUtils.split(params.get(CACHE_ARCHIVE), ','); + if (null != archives) { + for (String tmpArchive : archives) { + final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive.trim()); + final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); + + appletClassLoader.addArchiveToClassPath(archiveUrl); + archiveUrls.add(archiveUrl); + } + } + archiveUrls_ = Collections.unmodifiableList(archiveUrls); + + // no archive attribute, single class + if (archiveUrls_.isEmpty()) { + final String tempUrl = UrlUtils.resolveUrl(baseUrl, getCodeAttribute()); + final URL classUrl = UrlUtils.toUrlUnsafe(tempUrl); + + final WebResponse response = webclient.loadWebResponse(new WebRequest(classUrl)); + try { + webclient.throwFailingHttpStatusCodeExceptionIfNecessary(response); + appletClassLoader.addClassToClassPath(appletClassName, response); + } + catch (final FailingHttpStatusCodeException e) { + // that is what the browser does, the applet only fails, if + // the main class is not loadable + LOG.error(e.getMessage(), e); + } + } - final WebResponse response = webclient.loadWebResponse(new WebRequest(classUrl)); try { - webclient.throwFailingHttpStatusCodeExceptionIfNecessary(response); - appletClassLoader_.addClassToClassPath(appletClassName, response); + final Class appletClass = (Class) appletClassLoader.loadClass(appletClassName); + applet_ = appletClass.newInstance(); + applet_.setStub(new AppletStubImpl(getHtmlPageOrNull(), params, + UrlUtils.toUrlUnsafe(baseUrl), UrlUtils.toUrlUnsafe(documentUrl))); + applet_.init(); + applet_.start(); } - catch (final FailingHttpStatusCodeException e) { - // that is what the browser does, the applet only fails, if - // the main class is not loadable - LOG.error(e.getMessage(), e); + catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) { + if (LOG.isErrorEnabled()) { + LOG.error("Loading applet '" + appletClassName + "' failed\n" + + " " + e.toString() + + "\n Classpath:\n" + appletClassLoader.info()); + } + throw new RuntimeException(e); } } - - try { - final Class appletClass = (Class) appletClassLoader_.loadClass(appletClassName); - applet_ = appletClass.newInstance(); - applet_.setStub(new AppletStubImpl(getHtmlPageOrNull(), params, - UrlUtils.toUrlUnsafe(baseUrl), UrlUtils.toUrlUnsafe(documentUrl))); - applet_.init(); - applet_.start(); - } - catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) { - LOG.error("Loading applet '" + appletClassName + "' failed\n" - + " " + e.toString() - + "\n Classpath:\n" + appletClassLoader_.info()); - throw new RuntimeException(e); - } } /** @@ -348,9 +347,6 @@ public List getArchiveUrls() { */ @Override public DisplayStyle getDefaultStyleDisplay() { - if (getPage().getWebClient().getBrowserVersion().hasFeature(APPLET_INLINE_BLOCK)) { - return DisplayStyle.INLINE_BLOCK; - } return DisplayStyle.INLINE; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArea.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArea.java index 9001a30691b..7d0df825d55 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArea.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ * @author Marc Guillemot * @author Ahmed Ashour * @author Frank Danek + * @author Ronald Brill */ public class HtmlArea extends HtmlElement { private static final Log LOG = LogFactory.getLog(HtmlArea.class); @@ -54,6 +55,10 @@ public class HtmlArea extends HtmlElement { /** The HTML tag represented by this element. */ public static final String TAG_NAME = "area"; + private static final String SHAPE_RECT = "rect"; + private static final String SHAPE_CIRCLE = "circle"; + private static final String SHAPE_POLY = "poly"; + /** * Creates a new instance. * @@ -91,6 +96,7 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK "Not a valid url: " + getHrefAttribute()); } final WebRequest request = new WebRequest(url); + request.setCharset(page.getCharset()); request.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); final WebWindow webWindow = enclosingPage.getEnclosingWindow(); webClient.getPage( @@ -218,23 +224,23 @@ public final String getTargetAttribute() { * @return {@code true} if the point is contained in this area */ boolean containsPoint(final int x, final int y) { - final String shape = StringUtils.defaultIfEmpty(getShapeAttribute(), "rect").toLowerCase(Locale.ROOT); + final String shape = StringUtils.defaultIfEmpty(getShapeAttribute(), SHAPE_RECT).toLowerCase(Locale.ROOT); if ("default".equals(shape) && getCoordsAttribute() != null) { return true; } - if ("rect".equals(shape) && getCoordsAttribute() != null) { + if (SHAPE_RECT.equals(shape) && getCoordsAttribute() != null) { final Rectangle2D rectangle = parseRect(); return rectangle.contains(x, y); } - if ("circle".equals(shape) && getCoordsAttribute() != null) { + if (SHAPE_CIRCLE.equals(shape) && getCoordsAttribute() != null) { final Ellipse2D ellipse = parseCircle(); return ellipse.contains(x, y); } - if ("poly".equals(shape) && getCoordsAttribute() != null) { + if (SHAPE_POLY.equals(shape) && getCoordsAttribute() != null) { final GeneralPath path = parsePoly(); return path.contains(x, y); } @@ -289,7 +295,9 @@ private Rectangle2D parseRect() { } } catch (final NumberFormatException e) { - LOG.warn("Invalid rect coords '" + Arrays.toString(coords) + "'", e); + if (LOG.isWarnEnabled()) { + LOG.warn("Invalid rect coords '" + Arrays.toString(coords) + "'", e); + } } final Rectangle2D rectangle = new Rectangle2D.Double(leftX, topY, @@ -333,7 +341,9 @@ private GeneralPath parsePoly() { } } catch (final NumberFormatException e) { - LOG.warn("Invalid poly coords '" + Arrays.toString(coords) + "'", e); + if (LOG.isWarnEnabled()) { + LOG.warn("Invalid poly coords '" + Arrays.toString(coords) + "'", e); + } } path.closePath(); @@ -341,23 +351,23 @@ private GeneralPath parsePoly() { } private boolean isEmpty() { - final String shape = StringUtils.defaultIfEmpty(getShapeAttribute(), "rect").toLowerCase(Locale.ROOT); + final String shape = StringUtils.defaultIfEmpty(getShapeAttribute(), SHAPE_RECT).toLowerCase(Locale.ROOT); if ("default".equals(shape) && getCoordsAttribute() != null) { return false; } - if ("rect".equals(shape) && getCoordsAttribute() != null) { + if (SHAPE_RECT.equals(shape) && getCoordsAttribute() != null) { final Rectangle2D rectangle = parseRect(); return rectangle.isEmpty(); } - if ("circle".equals(shape) && getCoordsAttribute() != null) { + if (SHAPE_CIRCLE.equals(shape) && getCoordsAttribute() != null) { final Ellipse2D ellipse = parseCircle(); return ellipse.isEmpty(); } - if ("poly".equals(shape) && getCoordsAttribute() != null) { + if (SHAPE_POLY.equals(shape) && getCoordsAttribute() != null) { return false; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java index 64ee79c8794..fb183174071 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlArticle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java index eb7881be78b..930ccc7a4c8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAside.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeEvent.java index fcae6772e7f..f82c14cc06a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeListener.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeListener.java index aaeace1d3b9..245afd1ca8a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAttributeChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAudio.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAudio.java index 9edbbd11151..b37ea946288 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAudio.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlAudio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,11 @@ import com.gargoylesoftware.htmlunit.SgmlPage; /** - * Wrapper for the HTML element "audio". + * Wrapper for the HTML element "Audio". * * @author Ahmed Ashour * @author Frank Danek + * @author Ronald Brill */ public class HtmlAudio extends HtmlMedia { @@ -30,7 +31,7 @@ public class HtmlAudio extends HtmlMedia { public static final String TAG_NAME = "audio"; /** - * Creates an instance of HtmlAudio + * Creates an instance of HtmlAudio. * * @param qualifiedName the qualified name of the element type to instantiate * @param page the HtmlPage that contains this element diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBackgroundSound.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBackgroundSound.java index 8152b91860d..24fcdb97753 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBackgroundSound.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBackgroundSound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBase.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBase.java index 598ca9a2d8d..1a0b4e73a4b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBase.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBaseFont.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBaseFont.java index 3ab9db8c325..b80b707a2f6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBaseFont.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBaseFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalIsolation.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalIsolation.java index 7f71dfbd2ef..ddf5b4f6e0c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalIsolation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalIsolation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalOverride.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalOverride.java index 7e651e0c8e8..c74166ca9ad 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalOverride.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBidirectionalOverride.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBig.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBig.java index 30a8a02a490..a6bbc145b41 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBig.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlink.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlink.java index 81c3ff7b9c2..d1ccaf3ca01 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlink.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlockQuote.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlockQuote.java index 1bb3c7ac6d3..791def6b331 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlockQuote.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBlockQuote.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBody.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBody.java index d6009464839..832c288aa08 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBody.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,11 +50,6 @@ public HtmlBody(final String qualifiedName, final SgmlPage page, super(qualifiedName, page, attributes); temporary_ = temporary; - - // Force script object creation now to forward onXXX handlers to window. - if (getOwnerDocument() instanceof HtmlPage) { - getScriptableObject(); - } } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBold.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBold.java index f82ff707e34..e5d13a87c2a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBold.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBreak.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBreak.java index 137b602e716..52ba9f521b9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBreak.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlBreak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButton.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButton.java index 3a4e5d7b963..fdb83485455 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButton.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,15 +85,13 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK HtmlForm form = null; final String formId = getAttributeDirect("form"); - if (DomElement.ATTRIBUTE_NOT_DEFINED == formId) { + if (DomElement.ATTRIBUTE_NOT_DEFINED == formId || !hasFeature(FORM_FORM_ATTRIBUTE_SUPPORTED)) { form = getEnclosingForm(); } else { - if (hasFeature(FORM_FORM_ATTRIBUTE_SUPPORTED)) { - final DomElement elem = getHtmlPageOrNull().getElementById(formId); - if (elem instanceof HtmlForm) { - form = (HtmlForm) elem; - } + final DomElement elem = getHtmlPageOrNull().getElementById(formId); + if (elem instanceof HtmlForm) { + form = (HtmlForm) elem; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInput.java index 81904e5a01c..8df4cab2215 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,6 +51,14 @@ public void reset() { // Empty. } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCanvas.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCanvas.java index 02ebe35726e..3b65c9eaa2a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCanvas.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCanvas.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCaption.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCaption.java index a7a4dc2c7f8..afe79fef619 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCaption.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCaption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCenter.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCenter.java index a63db1e38e6..d9132970795 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCenter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCenter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput.java index 53ca2784efd..3726e718425 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCitation.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCitation.java index e21506e1db2..f82587c8b69 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCitation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCitation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCode.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCode.java index 972ef6a34ff..9d6288af16b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput.java index 9176cc24be7..cd74ec41dbe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +14,14 @@ */ package com.gargoylesoftware.htmlunit.html; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_COLOR_NOT_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START; import java.awt.Color; import java.util.Map; +import org.apache.commons.lang3.StringUtils; + import com.gargoylesoftware.htmlunit.SgmlPage; /** @@ -39,17 +42,36 @@ public class HtmlColorInput extends HtmlInput { HtmlColorInput(final String qualifiedName, final SgmlPage page, final Map attributes) { super(qualifiedName, page, attributes); - if (getValueAttribute() == ATTRIBUTE_NOT_DEFINED && !hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { + if (getValueAttribute() == ATTRIBUTE_NOT_DEFINED + && !hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { setValueAttribute("#" + Integer.toHexString(Color.black.getRGB()).substring(2)); } } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { - if (hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START) || isValid(newValue)) { + if (hasFeature(HTMLINPUT_TYPE_COLOR_NOT_SUPPORTED)) { + super.setValueAttribute(newValue); + return; + } + + if (StringUtils.isEmpty(newValue)) { + super.setValueAttribute("#000000"); + return; + } + + if (isValid(newValue)) { super.setValueAttribute(newValue); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCommand.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCommand.java index 0696bd52d90..5aaa26d6a31 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCommand.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlContent.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlContent.java index 42a2eee17de..4f0f38a28b3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlContent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlData.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlData.java index 2a4984be432..963603f3f8b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDataList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDataList.java index c1447f268ed..557d8c70553 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDataList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDataList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateInput.java index 712450ade06..7b437c60cc8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,22 +15,30 @@ package com.gargoylesoftware.htmlunit.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.Map; import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.html.impl.SelectableTextInput; +import com.gargoylesoftware.htmlunit.html.impl.SelectableTextSelectionDelegate; +import org.apache.commons.lang3.StringUtils; /** * Wrapper for the HTML element "input" where type is "date". * * @author Ahmed Ashour + * @author Ronald Brill */ -public class HtmlDateInput extends HtmlInput { +public class HtmlDateInput extends HtmlInput implements SelectableTextInput { private static DateTimeFormatter FORMATTER_ = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + private SelectableTextSelectionDelegate selectionDelegate_ = new SelectableTextSelectionDelegate(this); + private DoTypeProcessor doTypeProcessor_ = new DoTypeProcessor(this); + /** * Creates an instance. * @@ -43,13 +51,149 @@ public class HtmlDateInput extends HtmlInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + protected void doType(final char c, final boolean lastType) { + doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); + } + + /** + * {@inheritDoc} + */ + @Override + protected void doType(final int keyCode, final boolean lastType) { + doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); + } + + /** + * {@inheritDoc} + */ + @Override + protected void typeDone(final String newValue, final boolean notifyAttributeChangeListeners) { + if (newValue.length() <= getMaxLength()) { + setAttributeNS(null, "value", newValue, notifyAttributeChangeListeners, false); + } + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean isSubmittableByEnter() { + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public void select() { + selectionDelegate_.select(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getSelectedText() { + return selectionDelegate_.getSelectedText(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getText() { + return getValueAttribute(); + } + + /** + * {@inheritDoc} + */ + @Override + public void setText(final String text) { + setValueAttribute(text); + } + + /** + * {@inheritDoc} + */ + @Override + public int getSelectionStart() { + return selectionDelegate_.getSelectionStart(); + } + + /** + * {@inheritDoc} + */ + @Override + public void setSelectionStart(final int selectionStart) { + selectionDelegate_.setSelectionStart(selectionStart); + } + + /** + * {@inheritDoc} + */ + @Override + public int getSelectionEnd() { + return selectionDelegate_.getSelectionEnd(); + } + + /** + * {@inheritDoc} + */ + @Override + public void setSelectionEnd(final int selectionEnd) { + selectionDelegate_.setSelectionEnd(selectionEnd); + } + + /** + * {@inheritDoc} + */ + @Override + protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, + final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { + super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, + notifyMutationObservers); + if ("value".equals(qualifiedName)) { + final SgmlPage page = getPage(); + if (page != null && page.isHtmlPage()) { + int pos = 0; + if (!hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { + pos = attributeValue.length(); + } + setSelectionStart(pos); + setSelectionEnd(pos); + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public void setDefaultValue(final String defaultValue) { + final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); + setDefaultValue(defaultValue, modifyValue); + } + + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED) && StringUtils.isNotEmpty(newValue)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); @@ -58,4 +202,26 @@ public void setValueAttribute(final String newValue) { // ignore } } + + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + + /** + * {@inheritDoc} + */ + @Override + public DomNode cloneNode(final boolean deep) { + final HtmlDateInput newnode = (HtmlDateInput) super.cloneNode(deep); + newnode.selectionDelegate_ = new SelectableTextSelectionDelegate(newnode); + newnode.doTypeProcessor_ = new DoTypeProcessor(newnode); + + return newnode; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java index fbbf85c7550..5538ef6daf1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,15 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.Map; import com.gargoylesoftware.htmlunit.SgmlPage; +import org.apache.commons.lang3.StringUtils; /** * Wrapper for the HTML element "input" where type is "datetime-local". @@ -43,13 +45,23 @@ public class HtmlDateTimeLocalInput extends HtmlInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && !hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED) + && StringUtils.isNotEmpty(newValue)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinition.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinition.java index 03dfed49381..e255ea47618 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinition.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescription.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescription.java index 68bc64a712c..e4563a71d69 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescription.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionList.java index d78e045322d..670104a3c16 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionTerm.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionTerm.java index 4c930f9f00f..b2d15b53b31 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionTerm.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionTerm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDeletedText.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDeletedText.java index 173ef01a01f..e462ac71e60 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDeletedText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDeletedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDetails.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDetails.java index 21a164b70ac..f38a947d5a7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDetails.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDetails.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDialog.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDialog.java index 3ff920db1f7..1f81f78cab8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDialog.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDirectory.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDirectory.java index ee2b91b3e46..d3cc7c005fe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDirectory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDirectory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDivision.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDivision.java index d3530e45d16..f17e7a26b41 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDivision.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlDivision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java index aac5dd2771b..b07fb1eb5a3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.html; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLELEMENT_DETACH_ACTIVE_TRIGGERS_NO_KEYUP_EVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.KEYBOARD_EVENT_SPECIAL_KEYPRESS; @@ -43,6 +44,7 @@ import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.WebAssert; import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.impl.SelectableTextInput; import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.dom.MutationObserver; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; @@ -154,7 +156,7 @@ public String value() { */ protected HtmlElement(final String qualifiedName, final SgmlPage page, final Map attributes) { - this(HTMLParser.XHTML_NAMESPACE, qualifiedName, page, attributes); + this(Html.XHTML_NAMESPACE, qualifiedName, page, attributes); } /** @@ -211,7 +213,7 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN notifyAttributeChangeListeners(event, this, oldAttributeValue, notifyMutationObservers); } - fireAttributeChangeImpl(event, htmlPage, mappedElement, qualifiedName, attributeValue, oldAttributeValue); + fireAttributeChangeImpl(event, htmlPage, mappedElement, oldAttributeValue); } /** @@ -249,8 +251,7 @@ protected static void notifyAttributeChangeListeners(final HtmlAttributeChangeEv } private void fireAttributeChangeImpl(final HtmlAttributeChangeEvent event, - final HtmlPage htmlPage, final boolean mappedElement, - final String qualifiedName, final String attributeValue, final String oldAttributeValue) { + final HtmlPage htmlPage, final boolean mappedElement, final String oldAttributeValue) { if (mappedElement) { htmlPage.addMappedElement(this); } @@ -297,7 +298,7 @@ public Attr setAttributeNode(final Attr attribute) { final Attr result = super.setAttributeNode(attribute); - fireAttributeChangeImpl(event, htmlPage, mappedElement, qualifiedName, attribute.getValue(), oldAttributeValue); + fireAttributeChangeImpl(event, htmlPage, mappedElement, oldAttributeValue); return result; } @@ -494,7 +495,7 @@ public void type(final String text) throws IOException { * @exception IOException if an IO error occurs */ public Page type(final char c) throws IOException { - return type(c, false, true); + return type(c, true); } /** @@ -509,9 +510,9 @@ public Page type(final char c) throws IOException { * @return the page contained in the current window as returned by {@link WebClient#getCurrentWindow()} * @exception IOException if an IO error occurs */ - private Page type(final char c, final boolean startAtEnd, final boolean lastType) + private Page type(final char c, final boolean lastType) throws IOException { - if (this instanceof DisabledElement && ((DisabledElement) this).isDisabled()) { + if (isDisabledElementAndDisabled()) { return getPage(); } @@ -537,7 +538,7 @@ private Page type(final char c, final boolean startAtEnd, final boolean lastType } final Event keyDown = new KeyboardEvent(this, Event.TYPE_KEY_DOWN, c, - shiftPressed_ || isShiftNeeded, ctrlPressed_, altPressed_); + shiftPressed_ || isShiftNeeded, ctrlPressed_, altPressed_); final ScriptResult keyDownResult = fireEvent(keyDown); if (!keyDown.isAborted(keyDownResult)) { @@ -547,23 +548,43 @@ private Page type(final char c, final boolean startAtEnd, final boolean lastType if ((shiftDown == null || !shiftDown.isAborted(shiftDownResult)) && !keyPress.isAborted(keyPressResult)) { - doType(c, startAtEnd, lastType); + doType(c, lastType); } } final WebClient webClient = page.getWebClient(); if (this instanceof HtmlTextInput || this instanceof HtmlTextArea + || this instanceof HtmlTelInput + || this instanceof HtmlNumberInput + || this instanceof HtmlSearchInput || this instanceof HtmlPasswordInput) { - fireKeyboardEvent(Event.TYPE_INPUT, c, shiftPressed_ || isShiftNeeded); + fireEvent(new KeyboardEvent(this, Event.TYPE_INPUT, c, + shiftPressed_ || isShiftNeeded, ctrlPressed_, altPressed_)); } - fireKeyboardEvent(Event.TYPE_KEY_UP, c, shiftPressed_ || isShiftNeeded); + HtmlElement eventSource = this; + if (!isAttachedToPage()) { + final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); + if (browserVersion.hasFeature(HTMLELEMENT_DETACH_ACTIVE_TRIGGERS_NO_KEYUP_EVENT)) { + eventSource = null; + } + else { + eventSource = page.getBody(); + } + } - if (isShiftNeeded) { - final Event shiftUp = new KeyboardEvent(this, Event.TYPE_KEY_UP, KeyboardEvent.DOM_VK_SHIFT, - false, ctrlPressed_, altPressed_); - fireEvent(shiftUp); + if (eventSource != null) { + final Event keyUp = new KeyboardEvent(this, Event.TYPE_KEY_UP, c, + shiftPressed_ || isShiftNeeded, ctrlPressed_, altPressed_); + eventSource.fireEvent(keyUp); + + if (isShiftNeeded) { + final Event shiftUp = new KeyboardEvent(this, Event.TYPE_KEY_UP, + KeyboardEvent.DOM_VK_SHIFT, + false, ctrlPressed_, altPressed_); + eventSource.fireEvent(shiftUp); + } } final HtmlForm form = getEnclosingForm(); @@ -578,10 +599,6 @@ private Page type(final char c, final boolean startAtEnd, final boolean lastType return webClient.getCurrentWindow().getEnclosedPage(); } - private void fireKeyboardEvent(final String eventType, final char c, final boolean shift) { - fireEvent(new KeyboardEvent(this, eventType, c, shift, ctrlPressed_, altPressed_)); - } - /** * Simulates typing the specified key code while this element has focus, returning the page contained * by this element's window after typing. Note that it may or may not be the same as the original page, @@ -594,7 +611,7 @@ private void fireKeyboardEvent(final String eventType, final char c, final boole * @return the page that occupies this window after typing */ public Page type(final int keyCode) { - return type(keyCode, false, true, true, true, true); + return type(keyCode, true, true, true, true); } /** @@ -611,11 +628,24 @@ public Page type(final Keyboard keyboard) throws IOException { Page page = null; final List keys = keyboard.getKeys(); + + if (keyboard.isStartAtEnd()) { + if (this instanceof SelectableTextInput) { + final SelectableTextInput textInput = (SelectableTextInput) this; + textInput.setSelectionStart(textInput.getText().length()); + } + else { + final DomText domText = getDoTypeNode(); + if (domText != null) { + domText.moveSelectionToEnd(); + } + } + } + for (int i = 0; i < keys.size(); i++) { final Object[] entry = keys.get(i); - final boolean startAtEnd = i == 0 && keyboard.isStartAtEnd(); if (entry.length == 1) { - type((char) entry[0], startAtEnd, i == keys.size() - 1); + type((char) entry[0], i == keys.size() - 1); } else { final int key = (int) entry[0]; @@ -648,10 +678,10 @@ public Page type(final Keyboard keyboard) throws IOException { default: } - page = type(key, startAtEnd, true, keyPress, keyUp, i == keys.size() - 1); + page = type(key, true, keyPress, keyUp, i == keys.size() - 1); } else { - page = type(key, startAtEnd, false, false, true, i == keys.size() - 1); + page = type(key, false, false, true, i == keys.size() - 1); } } } @@ -659,10 +689,10 @@ public Page type(final Keyboard keyboard) throws IOException { return page; } - private Page type(final int keyCode, final boolean startAtEnd, + private Page type(final int keyCode, final boolean fireKeyDown, final boolean fireKeyPress, final boolean fireKeyUp, final boolean lastType) { - if (this instanceof DisabledElement && ((DisabledElement) this).isDisabled()) { + if (isDisabledElementAndDisabled()) { return getPage(); } @@ -699,11 +729,14 @@ private Page type(final int keyCode, final boolean startAtEnd, if (keyDown != null && !keyDown.isAborted(keyDownResult) && (keyPress == null || !keyPress.isAborted(keyPressResult))) { - doType(keyCode, startAtEnd, lastType); + doType(keyCode, lastType); } if (this instanceof HtmlTextInput || this instanceof HtmlTextArea + || this instanceof HtmlTelInput + || this instanceof HtmlNumberInput + || this instanceof HtmlSearchInput || this instanceof HtmlPasswordInput) { final Event input = new KeyboardEvent(this, Event.TYPE_INPUT, keyCode, shiftPressed_, ctrlPressed_, altPressed_); @@ -734,21 +767,12 @@ private Page type(final int keyCode, final boolean startAtEnd, /** * Performs the effective type action, called after the keyPress event and before the keyUp event. * @param c the character you with to simulate typing - * @param startAtEnd whether typing should start at the text end or not * @param lastType is this the last character to type */ - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - final DomNode domNode = getDoTypeNode(); - if (domNode instanceof DomText) { - ((DomText) domNode).doType(c, startAtEnd, this, lastType); - } - else if (domNode instanceof HtmlElement) { - try { - ((HtmlElement) domNode).type(c, startAtEnd, lastType); - } - catch (final IOException e) { - throw new RuntimeException(e); - } + protected void doType(final char c, final boolean lastType) { + final DomText domText = getDoTypeNode(); + if (domText != null) { + domText.doType(c, this, lastType); } } @@ -758,16 +782,12 @@ else if (domNode instanceof HtmlElement) { * An example of predefined values is {@link KeyboardEvent#DOM_VK_PAGE_DOWN}. * * @param keyCode the key code wish to simulate typing - * @param startAtEnd whether typing should start at the text end or not * @param lastType is this the last to type */ - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - final DomNode domNode = getDoTypeNode(); - if (domNode instanceof DomText) { - ((DomText) domNode).doType(keyCode, startAtEnd, this, lastType); - } - else if (domNode instanceof HtmlElement) { - ((HtmlElement) domNode).type(keyCode, startAtEnd, true, true, true, lastType); + protected void doType(final int keyCode, final boolean lastType) { + final DomText domText = getDoTypeNode(); + if (domText != null) { + domText.doType(keyCode, this, lastType); } } @@ -775,29 +795,25 @@ else if (domNode instanceof HtmlElement) { * Returns the node to type into. * @return the node */ - private DomNode getDoTypeNode() { - DomNode node = null; + private DomText getDoTypeNode() { final HTMLElement scriptElement = getScriptableObject(); if (scriptElement.isIsContentEditable() || "on".equals(((Document) scriptElement.getOwnerDocument()).getDesignMode())) { - final DomNodeList children = getChildNodes(); - if (!children.isEmpty()) { + + DomNodeList children = getChildNodes(); + while (!children.isEmpty()) { final DomNode lastChild = children.get(children.size() - 1); if (lastChild instanceof DomText) { - node = lastChild; - } - else if (lastChild instanceof HtmlElement) { - node = lastChild; + return (DomText) lastChild; } + children = lastChild.getChildNodes(); } - if (node == null) { - final DomText domText = new DomText(getPage(), ""); - appendChild(domText); - node = domText; - } + final DomText domText = new DomText(getPage(), ""); + appendChild(domText); + return domText; } - return node; + return null; } /** @@ -1171,13 +1187,20 @@ private String getXPathToken() { return getNodeName() + '[' + nodeIndex + ']'; } + /** + * @return true if the hidden attribute is set. + */ + public boolean isHidden() { + return ATTRIBUTE_NOT_DEFINED != getAttributeDirect("hidden"); + } + /** * {@inheritDoc} * Overwritten to support the hidden attribute (html5). */ @Override public boolean isDisplayed() { - if (ATTRIBUTE_NOT_DEFINED != getAttributeDirect("hidden")) { + if (isHidden()) { return false; } return super.isDisplayed(); @@ -1204,7 +1227,7 @@ protected final String getSrcAttributeNormalized() { // at the moment StringUtils.replaceChars returns the org string // if nothing to replace was found but the doc implies, that we // can't trust on this in the future - final String attrib = getAttributeDirect("src"); + final String attrib = getAttributeDirect(SRC_ATTRIBUTE); if (ATTRIBUTE_NOT_DEFINED == attrib) { return attrib; } @@ -1220,7 +1243,13 @@ protected final String getSrcAttributeNormalized() { */ @Override protected void detach() { - final Object document = getPage().getScriptableObject(); + final SgmlPage page = getPage(); + if (!page.getWebClient().isJavaScriptEngineEnabled()) { + super.detach(); + return; + } + + final Object document = page.getScriptableObject(); if (document instanceof HTMLDocument) { final HTMLDocument doc = (HTMLDocument) document; @@ -1229,10 +1258,10 @@ protected void detach() { if (activeElement == getScriptableObject()) { doc.setActiveElement(null); if (hasFeature(HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT)) { - ((HtmlPage) getPage()).setFocusedElement(null); + ((HtmlPage) page).setFocusedElement(null); } else { - ((HtmlPage) getPage()).setElementWithFocus(null); + ((HtmlPage) page).setElementWithFocus(null); } } else { @@ -1240,10 +1269,10 @@ protected void detach() { if (activeElement == child.getScriptableObject()) { doc.setActiveElement(null); if (hasFeature(HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT)) { - ((HtmlPage) getPage()).setFocusedElement(null); + ((HtmlPage) page).setFocusedElement(null); } else { - ((HtmlPage) getPage()).setElementWithFocus(null); + ((HtmlPage) page).setElementWithFocus(null); } break; @@ -1263,7 +1292,7 @@ public boolean handles(final Event event) { return this instanceof SubmittableElement || getTabIndex() != null; } - if (this instanceof DisabledElement && ((DisabledElement) this).isDisabled()) { + if (isDisabledElementAndDisabled()) { return false; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java index 4baf2a5f7af..6abae420868 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,14 @@ public class HtmlEmailInput extends HtmlInput implements SelectableTextInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @@ -126,10 +134,7 @@ public String getText() { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); } @@ -137,10 +142,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); } @@ -154,6 +156,16 @@ protected void typeDone(final String newValue, final boolean notifyAttributeChan } } + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmbed.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmbed.java index 330a5ad7576..d3fdb325ac4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmbed.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmbed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,11 @@ package com.gargoylesoftware.htmlunit.html; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.URL; +import java.nio.file.Files; import java.util.Map; import org.apache.commons.io.IOUtils; @@ -62,12 +63,13 @@ public void saveAs(final File file) throws IOException { final HtmlPage page = (HtmlPage) getPage(); final WebClient webclient = page.getWebClient(); - final URL url = page.getFullyQualifiedUrl(getAttributeDirect("src")); + final URL url = page.getFullyQualifiedUrl(getAttributeDirect(SRC_ATTRIBUTE)); final WebRequest request = new WebRequest(url); + request.setCharset(page.getCharset()); request.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); final WebResponse webResponse = webclient.loadWebResponse(request); - try (FileOutputStream fos = new FileOutputStream(file); + try (OutputStream fos = Files.newOutputStream(file.toPath()); InputStream content = webResponse.getContentAsStream()) { IOUtils.copy(content, fos); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmphasis.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmphasis.java index d4c42810b1a..6f48be5e9b3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmphasis.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlEmphasis.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlExample.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlExample.java index 94fbb5d5309..a7cf4da0706 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlExample.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlExample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSet.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSet.java index 741968a221b..5d989ca542f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java index ad610719bdb..180989145d4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigureCaption.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigureCaption.java index 6763215ff7c..e7ea6abd8c1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigureCaption.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFigureCaption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput.java index a51a5ea2076..1f30cf49ba4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.util.KeyDataPair; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -85,6 +86,14 @@ public final void setData(final byte[] data) { data_ = data; } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @@ -100,7 +109,7 @@ public NameValuePair[] getSubmitNameValuePairs() { if (contentType_ == null) { contentType = getPage().getWebClient().getBrowserVersion().getUploadMimeType(file); if (StringUtils.isEmpty(contentType)) { - contentType = "application/octet-stream"; + contentType = MimeType.APPLICATION_OCTET_STREAM; } } else { @@ -111,7 +120,7 @@ public NameValuePair[] getSubmitNameValuePairs() { keyDataPair.setData(data_); list.add(keyDataPair); } - return list.toArray(new NameValuePair[list.size()]); + return list.toArray(new NameValuePair[0]); } /** @@ -196,4 +205,14 @@ private static File normalizeFile(final File file) { public File[] getFiles() { return files_; } + + /** + * Returns whether this element satisfies all form validation constraints set. + * @return whether this element satisfies all form validation constraints set + */ + @Override + public boolean isValid() { + return !isRequiredSupported() || getAttributeDirect("required") == ATTRIBUTE_NOT_DEFINED + || files_.length > 0; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFont.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFont.java index 051b0c69da7..b2671263576 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFont.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java index 6bf18609763..1c2e9fb061f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFooter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java index 7cac8d5373f..69a3e0bc0d5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,8 @@ import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.http.client.utils.URLEncodedUtils; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -71,6 +73,7 @@ * @author Anton Demydenko */ public class HtmlForm extends HtmlElement { + private static final Log LOG = LogFactory.getLog(HtmlForm.class); /** The HTML tag represented by this element. */ public static final String TAG_NAME = "form"; @@ -113,10 +116,11 @@ public class HtmlForm extends HtmlElement { Page submit(final SubmittableElement submitElement) { final HtmlPage htmlPage = (HtmlPage) getPage(); final WebClient webClient = htmlPage.getWebClient(); - if (webClient.getOptions().isJavaScriptEnabled()) { + if (webClient.isJavaScriptEnabled()) { if (submitElement != null) { isPreventDefault_ = false; - if (!areChildrenValid()) { + if (getAttributeDirect("novalidate") == ATTRIBUTE_NOT_DEFINED + && !areChildrenValid()) { return htmlPage; } final ScriptResult scriptResult = fireEvent(Event.TYPE_SUBMIT); @@ -125,13 +129,14 @@ Page submit(final SubmittableElement submitElement) { if (scriptResult == null) { return htmlPage; } - return scriptResult.getNewPage(); + return htmlPage.getWebClient().getCurrentWindow().getEnclosedPage(); } } final String action = getActionAttribute().trim(); if (StringUtils.startsWithIgnoreCase(action, JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { - return htmlPage.executeJavaScript(action, "Form action", getStartLineNumber()).getNewPage(); + htmlPage.executeJavaScript(action, "Form action", getStartLineNumber()); + return htmlPage.getWebClient().getCurrentWindow().getEnclosedPage(); } } else { @@ -217,6 +222,9 @@ private boolean areChildrenValid() { boolean valid = true; for (HtmlElement element : getFormHtmlElementDescendants()) { if (element instanceof HtmlInput && !((HtmlInput) element).isValid()) { + if (LOG.isInfoEnabled()) { + LOG.info("Form validation failed; element '" + element + "' was not valid. Submit cancelled."); + } valid = false; break; } @@ -249,13 +257,14 @@ public WebRequest getWebRequest(final SubmittableElement submitElement) { final BrowserVersion browser = getPage().getWebClient().getBrowserVersion(); String actionUrl = getActionAttribute(); String anchor = null; - String queryFromFields = ""; + String queryFormFields = ""; + final Charset enc = getSubmitCharset(); + if (HttpMethod.GET == method) { if (actionUrl.contains("#")) { anchor = StringUtils.substringAfter(actionUrl, "#"); } - final Charset enc = getPage().getCharset(); - queryFromFields = + queryFormFields = URLEncodedUtils.format(Arrays.asList(NameValuePair.toHttpClient(parameters)), enc); // action may already contain some query parameters: they have to be removed @@ -263,6 +272,7 @@ public WebRequest getWebRequest(final SubmittableElement submitElement) { actionUrl = StringUtils.substringBefore(actionUrl, "?"); parameters.clear(); // parameters have been added to query } + URL url; try { if (actionUrl.isEmpty()) { @@ -272,8 +282,8 @@ public WebRequest getWebRequest(final SubmittableElement submitElement) { url = htmlPage.getFullyQualifiedUrl(actionUrl); } - if (!queryFromFields.isEmpty()) { - url = UrlUtils.getUrlWithNewQuery(url, queryFromFields); + if (!queryFormFields.isEmpty()) { + url = UrlUtils.getUrlWithNewQuery(url, queryFormFields); } if (HttpMethod.GET == method && browser.hasFeature(FORM_SUBMISSION_URL_WITHOUT_HASH) @@ -295,22 +305,28 @@ else if (anchor != null throw new IllegalArgumentException("Not a valid url: " + actionUrl); } - final WebRequest request = new WebRequest(url, method); - request.setAdditionalHeader(HttpHeader.ACCEPT, browser.getHtmlAcceptHeader()); - request.setAdditionalHeader(HttpHeader.ACCEPT_ENCODING, "gzip, deflate"); + final WebRequest request = new WebRequest(url, browser.getHtmlAcceptHeader(), + browser.getAcceptEncodingHeader()); + request.setHttpMethod(method); request.setRequestParameters(parameters); if (HttpMethod.POST == method) { request.setEncodingType(FormEncodingType.getInstance(getEnctypeAttribute())); } - request.setCharset(getSubmitCharset()); + request.setCharset(enc); - String referer = htmlPage.getUrl().toExternalForm(); - request.setAdditionalHeader(HttpHeader.REFERER, referer); + request.setAdditionalHeader(HttpHeader.REFERER, htmlPage.getUrl().toExternalForm()); if (HttpMethod.POST == method && browser.hasFeature(FORM_SUBMISSION_HEADER_ORIGIN)) { - referer = StringUtils.stripEnd(referer, "/"); - request.setAdditionalHeader(HttpHeader.ORIGIN, referer); + try { + request.setAdditionalHeader(HttpHeader.ORIGIN, + UrlUtils.getUrlWithProtocolAndAuthority(htmlPage.getUrl()).toExternalForm()); + } + catch (final MalformedURLException e) { + if (LOG.isWarnEnabled()) { + LOG.info("Invalid origin url '" + htmlPage.getUrl() + "'"); + } + } } if (HttpMethod.POST == method && browser.hasFeature(FORM_SUBMISSION_HEADER_CACHE_CONTROL_MAX_AGE)) { @@ -375,7 +391,7 @@ public Page reset() { final SgmlPage htmlPage = getPage(); final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET); if (ScriptResult.isFalse(scriptResult)) { - return scriptResult.getNewPage(); + return htmlPage.getWebClient().getCurrentWindow().getEnclosedPage(); } for (final HtmlElement next : getHtmlElementDescendants()) { @@ -472,11 +488,8 @@ private static boolean isSubmittable(final HtmlElement element, final Submittabl return false; } } - if (HtmlButton.TAG_NAME.equals(tagName)) { - return false; - } - return true; + return !HtmlButton.TAG_NAME.equals(tagName); } /** @@ -916,11 +929,13 @@ public List getInputsByValue(final String value) { } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Allows the parser to notify the form of a field that doesn't belong to its DOM children * due to malformed HTML code - * @param element the form field + * @param field the form field */ - void addLostChild(final HtmlElement field) { + public void addLostChild(final HtmlElement field) { lostChildren_.add(field); field.setOwningForm(this); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrame.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrame.java index e9ed3453f1d..7990892e300 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrame.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrameSet.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrameSet.java index 3826cbfdb67..5c010fdd620 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrameSet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlFrameSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHead.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHead.java index ca9bcd2f46f..a226e3f21cf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHead.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java index 41eb80b0433..9e1dd635578 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading1.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading1.java index efea330234c..fadcb24b0e6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading1.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading2.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading2.java index 03d72458b3a..258fdd2d507 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading2.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading3.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading3.java index 5adf0e0d701..8321d2ccff5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading3.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading4.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading4.java index be5e29662f4..198f1084be3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading4.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading5.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading5.java index d0c461b17c6..f1bb23801e9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading5.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading6.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading6.java index cd4bc03c931..e150266d63c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading6.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHeading6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHiddenInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHiddenInput.java index fbc3ab3bb9b..73acfb313c9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHiddenInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHiddenInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,6 +67,14 @@ public String asText() { return ""; } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRule.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRule.java index 1ca68404569..676e82c92f8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHtml.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHtml.java index 26fb9dc7710..9d490b76121 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHtml.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlHtml.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java index 26c9d660f37..df066023ca3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,12 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_COMPLETE_RETURNS_TRUE_FOR_NO_REQUEST; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; import java.net.URL; +import java.nio.file.Files; import java.util.Iterator; import java.util.Map; @@ -39,6 +41,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; +import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.SgmlPage; @@ -46,8 +49,9 @@ import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.javascript.PostponedAction; -import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; +import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; +import com.gargoylesoftware.htmlunit.util.UrlUtils; /** * Wrapper for the HTML element "img". @@ -80,7 +84,7 @@ public class HtmlImage extends HtmlElement { private int height_ = -1; private boolean downloaded_; private boolean isComplete_; - private boolean onloadInvoked_; + private boolean onloadProcessed_; private boolean createdByJavascript_; /** @@ -130,14 +134,14 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { final HtmlPage htmlPage = getHtmlPageOrNull(); - if ("src".equals(qualifiedName) && value != ATTRIBUTE_NOT_DEFINED && htmlPage != null) { + if (SRC_ATTRIBUTE.equals(qualifiedName) && value != ATTRIBUTE_NOT_DEFINED && htmlPage != null) { final String oldValue = getAttributeNS(namespaceURI, qualifiedName); if (!oldValue.equals(value)) { super.setAttributeNS(namespaceURI, qualifiedName, value, notifyAttributeChangeListeners, notifyMutationObservers); // onload handlers may need to be invoked again, and a new image may need to be downloaded - onloadInvoked_ = false; + onloadProcessed_ = false; downloaded_ = false; isComplete_ = false; width_ = -1; @@ -167,23 +171,83 @@ public void execute() throws Exception { notifyMutationObservers); } + /** + * {@inheritDoc} + */ + @Override + public void processImportNode(final Document doc) { + URL oldUrl = null; + final String src = getSrcAttribute(); + HtmlPage htmlPage = getHtmlPageOrNull(); + try { + if (htmlPage != null) { + oldUrl = htmlPage.getFullyQualifiedUrl(src); + } + } + catch (final MalformedURLException e) { + // ignore + } + + super.processImportNode(doc); + + URL url = null; + htmlPage = getHtmlPageOrNull(); + try { + if (htmlPage != null) { + url = htmlPage.getFullyQualifiedUrl(src); + } + } + catch (final MalformedURLException e) { + // ignore + } + + if (oldUrl == null || !UrlUtils.sameFile(oldUrl, url)) { + // image has to be reloaded + lastClickX_ = 0; + lastClickY_ = 0; + imageWebResponse_ = null; + imageData_ = null; + width_ = -1; + height_ = -1; + downloaded_ = false; + isComplete_ = false; + onloadProcessed_ = false; + createdByJavascript_ = true; + } + + if (htmlPage == null) { + return; // nothing to do if embedded in XML code + } + + if (htmlPage.getWebClient().getOptions().isDownloadImages()) { + try { + downloadImageIfNeeded(); + } + catch (final IOException e) { + if (LOG.isDebugEnabled()) { + LOG.debug("Unable to download image for element " + this); + } + } + } + } + /** *

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

* - *

Executes this element's onload handler if it has one. This method also downloads the image - * if this element has an onload handler (prior to invoking said handler), because applications - * sometimes use images to send information to the server and use the onload handler to get notified - * when the information has been received by the server.

+ *

Executes this element's onload or onerror handler. This method downloads the image + * if either of these handlers are present (prior to invoking the resulting handler), because applications + * sometimes use images to send information to the server and use these handlers to get notified when the + * information has been received by the server.

* *

See here and * here for the discussion which * lead up to this method.

* - *

This method may be called multiple times, but will only attempt to execute the onload - * handler the first time it is invoked.

+ *

This method may be called multiple times, but will only attempt to execute the onload or + * onerror handler the first time it is invoked.

*/ public void doOnLoad() { - if (onloadInvoked_) { + if (onloadProcessed_) { return; } @@ -193,47 +257,48 @@ public void doOnLoad() { } final WebClient client = htmlPage.getWebClient(); - if (!client.getOptions().isJavaScriptEnabled()) { - onloadInvoked_ = true; + if (!client.isJavaScriptEnabled()) { + onloadProcessed_ = true; return; } - if (hasEventHandlers("onload") && !getSrcAttribute().isEmpty()) { - // An onload handler and source are defined; we need to download the image and then call the onload handler. - onloadInvoked_ = true; - try { - downloadImageIfNeeded(); - final int i = imageWebResponse_.getStatusCode(); - if ((i >= HttpStatus.SC_OK && i < HttpStatus.SC_MULTIPLE_CHOICES) - || i == HttpStatus.SC_USE_PROXY) { - - // If the download was a success, trigger the onload handler. - final Event event = new Event(this, Event.TYPE_LOAD); - final Node scriptObject = getScriptableObject(); - - final String readyState = htmlPage.getReadyState(); - if (READY_STATE_LOADING.equals(readyState)) { - final PostponedAction action = new PostponedAction(getPage()) { - @Override - public void execute() throws Exception { - scriptObject.executeEventLocally(event); - } - }; - htmlPage.addAfterLoadAction(action); - } - else { - scriptObject.executeEventLocally(event); + if ((hasEventHandlers("onload") || hasEventHandlers("onerror")) && hasAttribute(SRC_ATTRIBUTE)) { + onloadProcessed_ = true; + boolean loadSuccessful = false; + if (!getSrcAttribute().isEmpty()) { + // We need to download the image and then call the resulting handler. + try { + downloadImageIfNeeded(); + final int i = imageWebResponse_.getStatusCode(); + // if the download was a success + if ((i >= HttpStatus.SC_OK && i < HttpStatus.SC_MULTIPLE_CHOICES) + || i == HttpStatus.SC_USE_PROXY) { + loadSuccessful = true; // Trigger the onload handler } } - return; - } - catch (final IOException e) { - if (LOG.isDebugEnabled()) { - LOG.debug("IOException while downloading image for '" + this + "' : " + e.getMessage()); + catch (final IOException e) { + if (LOG.isDebugEnabled()) { + LOG.debug("IOException while downloading image for '" + this + "' : " + e.getMessage()); + } } } + + final Event event = new Event(this, loadSuccessful ? Event.TYPE_LOAD : Event.TYPE_ERROR); if (LOG.isDebugEnabled()) { - LOG.debug("Unable to download image for '" + this + "'; not firing onload event."); + LOG.debug("Firing the " + event.getType() + " event for '" + this + "'."); + } + + if (READY_STATE_LOADING.equals(htmlPage.getReadyState())) { + final PostponedAction action = new PostponedAction(getPage()) { + @Override + public void execute() throws Exception { + HtmlImage.this.fireEvent(event); + } + }; + htmlPage.addAfterLoadAction(action); + } + else { + fireEvent(event); } } } @@ -455,16 +520,21 @@ private void downloadImageIfNeeded() throws IOException { if (!downloaded_) { // HTMLIMAGE_BLANK_SRC_AS_EMPTY final String src = getSrcAttribute(); - if (!"".equals(src) - && !(hasFeature(HTMLIMAGE_BLANK_SRC_AS_EMPTY) && StringUtils.isBlank(src))) { - final HtmlPage page = (HtmlPage) getPage(); - final WebClient webclient = page.getWebClient(); - final URL url = page.getFullyQualifiedUrl(src); - final String accept = webclient.getBrowserVersion().getImgAcceptHeader(); - final WebRequest request = new WebRequest(url, accept); - request.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); - imageWebResponse_ = webclient.loadWebResponse(request); + if (!"".equals(src)) { + final HtmlPage page = (HtmlPage) getPage(); + final WebClient webClient = page.getWebClient(); + final BrowserVersion browser = webClient.getBrowserVersion(); + + if (!(browser.hasFeature(HTMLIMAGE_BLANK_SRC_AS_EMPTY) + && StringUtils.isBlank(src))) { + final URL url = page.getFullyQualifiedUrl(src); + final WebRequest request = new WebRequest(url, browser.getImgAcceptHeader(), + browser.getAcceptEncodingHeader()); + request.setCharset(page.getCharset()); + request.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); + imageWebResponse_ = webClient.loadWebResponse(request); + } } if (imageData_ != null) { @@ -484,7 +554,7 @@ private void readImageIfNeeded() throws IOException { downloadImageIfNeeded(); if (imageData_ == null) { if (null == imageWebResponse_) { - throw new IOException("No image response available (src=" + getSrcAttribute() + ")"); + throw new IOException("No image response available (src='" + getSrcAttribute() + "')"); } @SuppressWarnings("resource") final ImageInputStream iis = ImageIO.createImageInputStream(imageWebResponse_.getContentAsStream()); @@ -578,9 +648,9 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK public void saveAs(final File file) throws IOException { downloadImageIfNeeded(); if (null != imageWebResponse_) { - try (FileOutputStream fileOut = new FileOutputStream(file); + try (OutputStream fos = Files.newOutputStream(file.toPath()); InputStream inputStream = imageWebResponse_.getContentAsStream()) { - IOUtils.copy(inputStream, fileOut); + IOUtils.copy(inputStream, fos); } } } @@ -649,15 +719,6 @@ public boolean isComplete() { : imageData_ != null); } - /** - * @return true if the image was successfully downloaded - * @deprecated as of 2.26, please use {@link #isComplete()} instead - */ - @Deprecated - public boolean getComplete() { - return isComplete(); - } - /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java index 1c2dc54781a..0fecd24efdb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,17 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_COMPLETE_RETURNS_TRUE_FOR_NO_REQUEST; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.URL; +import java.nio.file.Files; import java.util.Map; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; +import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.Page; @@ -161,9 +163,19 @@ public

P click(final int x, final int y) throws IOException, El * @exception IOException if an IO error occurs */ @Override - public

P click(final Event event, final boolean ignoreVisibility) throws IOException { + public

P click(final Event event, + final boolean shiftKey, final boolean ctrlKey, final boolean altKey, + final boolean ignoreVisibility) throws IOException { wasPositionSpecified_ = true; - return super.click(event, ignoreVisibility); + return super.click(event, shiftKey, ctrlKey, altKey, ignoreVisibility); + } + + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. } /** @@ -211,13 +223,15 @@ private void downloadImageIfNeeded() throws IOException { if (!"".equals(src) && !(hasFeature(HTMLIMAGE_BLANK_SRC_AS_EMPTY) && StringUtils.isBlank(src))) { final HtmlPage page = (HtmlPage) getPage(); - final WebClient webclient = page.getWebClient(); + final WebClient webClient = page.getWebClient(); final URL url = page.getFullyQualifiedUrl(src); - final String accept = webclient.getBrowserVersion().getImgAcceptHeader(); - final WebRequest request = new WebRequest(url, accept); + final BrowserVersion browser = webClient.getBrowserVersion(); + final WebRequest request = new WebRequest(url, browser.getImgAcceptHeader(), + browser.getAcceptEncodingHeader()); + request.setCharset(page.getCharset()); request.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); - imageWebResponse_ = webclient.loadWebResponse(request); + imageWebResponse_ = webClient.loadWebResponse(request); } if (imageData_ != null) { @@ -237,9 +251,9 @@ private void downloadImageIfNeeded() throws IOException { public void saveAs(final File file) throws IOException { downloadImageIfNeeded(); if (null != imageWebResponse_) { - try (FileOutputStream fileOut = new FileOutputStream(file); + try (OutputStream fos = Files.newOutputStream(file.toPath()); InputStream inputStream = imageWebResponse_.getContentAsStream()) { - IOUtils.copy(inputStream, fileOut); + IOUtils.copy(inputStream, fos); } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame.java index c23d0cadcc2..8504181fbdf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineQuotation.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineQuotation.java index 83cc946d5e3..6945e585672 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineQuotation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInlineQuotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java index 7f7eb209b6c..fa63fdf0126 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_INPUT_DISPLAY_INLINE_BLOCK; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_MOUSE_ON_DISABLED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_DOES_NOT_CLICK_SURROUNDING_ANCHOR; @@ -417,18 +418,6 @@ public String getDefaultValue() { return defaultValue_; } - /** - * {@inheritDoc} The default implementation is empty; only checkboxes and radio buttons - * really care what the default checked value is. - * @see SubmittableElement#setDefaultChecked(boolean) - * @see HtmlRadioButtonInput#setDefaultChecked(boolean) - * @see HtmlCheckBoxInput#setDefaultChecked(boolean) - */ - @Override - public void setDefaultChecked(final boolean defaultChecked) { - // Empty. - } - /** * {@inheritDoc} The default implementation returns {@code false}; only checkboxes and * radio buttons really care what the default checked value is. @@ -529,7 +518,7 @@ static Page executeOnChangeHandlerIfAppropriate(final HtmlElement htmlElement) { if (scriptResult != null) { // current window doesn't exist anymore - return scriptResult.getNewPage(); + return page.getWebClient().getCurrentWindow().getEnclosedPage(); } return page; @@ -627,6 +616,15 @@ public DisplayStyle getDefaultStyleDisplay() { if (hasFeature(CSS_INPUT_DISPLAY_INLINE_BLOCK)) { return DisplayStyle.INLINE_BLOCK; } + + if (hasFeature(CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK)) { + final String type = getTypeAttribute(); + if ("radio".equals(type) + || "checkbox".equals(type)) { + return DisplayStyle.INLINE_BLOCK; + } + } + return DisplayStyle.INLINE; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedText.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedText.java index dc4bd73d4f5..4138ea056c1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex.java index 2167390bb57..680c3b1c21b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlItalic.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlItalic.java index 3fd8b5864bc..5b6dbddce48 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlItalic.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlItalic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlKeyboard.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlKeyboard.java index a86dab7b27c..45cefaf9830 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlKeyboard.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlKeyboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLabel.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLabel.java index f1932bb2a34..3b714ba5a0d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLabel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLabel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -148,23 +148,20 @@ public HtmlElement getReferencedElement() { * {@inheritDoc} */ @Override - public

P click(final Event event, final boolean ignoreVisibility) throws IOException { + public

P click(final Event event, + final boolean shiftKey, final boolean ctrlKey, final boolean altKey, + final boolean ignoreVisibility) throws IOException { // first the click on the label - final P page = super.click(event, ignoreVisibility); - - // not sure which page we should return - final P response; + final P page = super.click(event, shiftKey, ctrlKey, altKey, ignoreVisibility); // then the click on the referenced element final HtmlElement element = getReferencedElement(); - if (element != null) { - response = element.click(false, false, false, false, true, true); - } - else { - response = page; + if (element == null || element.isDisabledElementAndDisabled()) { + return page; } - return response; + // not sure which page we should return + return element.click(false, false, false, false, true, true); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLayer.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLayer.java index 80561e45734..76ecda765a6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLayer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLegend.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLegend.java index 5130080c869..00b688c7331 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLegend.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLegend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLink.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLink.java index 879b2343492..24c88b5cc01 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLink.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; +import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.WebClient; @@ -226,13 +227,13 @@ public WebRequest getWebRequest() throws MalformedURLException { final HtmlPage page = (HtmlPage) getPage(); final URL url = page.getFullyQualifiedUrl(getHrefAttribute()); - final WebRequest request = new WebRequest(url); + final BrowserVersion browser = page.getWebClient().getBrowserVersion(); + final WebRequest request = new WebRequest(url, browser.getCssAcceptHeader(), browser.getAcceptEncodingHeader()); + // use the page encoding even if this is a GET requests + request.setCharset(page.getCharset()); request.setAdditionalHeader(HttpHeader.REFERER, page.getUrl().toExternalForm()); - final String accept = page.getWebClient().getBrowserVersion().getCssAcceptHeader(); - request.setAdditionalHeader(HttpHeader.ACCEPT, accept); - return request; } @@ -266,7 +267,7 @@ private void executeEvent(final String type) { * {@inheritDoc} */ @Override - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { if (getOwnerDocument() instanceof XmlPage) { return; } @@ -274,8 +275,29 @@ protected void onAllChildrenAddedToPage(final boolean postponed) { LOG.debug("Link node added: " + asXml()); } - if (!getPage().getWebClient().getOptions().isCssEnabled() - || !StyleSheetList.isStyleSheetLink(this)) { + final WebClient webClient = getPage().getWebClient(); + if (!StyleSheetList.isStyleSheetLink(this)) { + if (LOG.isDebugEnabled()) { + LOG.debug("Link type '" + getRelAttribute() + "' not supported (" + + asXml().replaceAll("\\r|\\n", "") + ")."); + } + + return; + } + + if (!webClient.getOptions().isCssEnabled()) { + if (LOG.isDebugEnabled()) { + LOG.debug("Stylesheet Link found but ignored because css support is disabled (" + + asXml().replaceAll("\\r|\\n", "") + ")."); + } + return; + } + + if (!webClient.isJavaScriptEngineEnabled()) { + if (LOG.isDebugEnabled()) { + LOG.debug("Stylesheet Link found but ignored because javascript engine is disabled (" + + asXml().replaceAll("\\r|\\n", "") + ")."); + } return; } @@ -287,7 +309,7 @@ public void execute() { } }; - final AbstractJavaScriptEngine engine = getPage().getWebClient().getJavaScriptEngine(); + final AbstractJavaScriptEngine engine = webClient.getJavaScriptEngine(); if (postponed) { engine.addPostponedAction(action); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListItem.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListItem.java index eca5d33dbcf..ccc2b96010e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListItem.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListing.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListing.java index 71780c517be..dced694c98f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListing.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlListing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMain.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMain.java index d6cf026e4f5..ea4bc39174c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMain.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMap.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMap.java index c88e6329979..7b4910ded1c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java index 2ec87ffb3cb..4cb68d89eeb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMarquee.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMarquee.java index b6eed2a40e8..94e55fbf354 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMarquee.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMarquee.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMedia.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMedia.java index fb644298bb9..113a6652ca1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMedia.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMedia.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenu.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenu.java index 3c9bf24a9c4..b1264f57efb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenu.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenu.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenuItem.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenuItem.java index f75596f29cb..e0d0e43ffce 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenuItem.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMenuItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeta.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeta.java index 8969b33adf3..2c6161b69d8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeta.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeta.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,22 +45,15 @@ public class HtmlMeta extends HtmlElement { final Map attributes) { super(qualifiedName, page, attributes); + // Handles the cookies specified in meta tags, + // like <meta http-equiv='set-cookie' content='webm=none; path=/;'>. if ("set-cookie".equalsIgnoreCase(getHttpEquivAttribute())) { - performSetCookie(); + final WebClient client = page.getWebClient(); + final URL url = page.getUrl(); + client.addCookie(getContentAttribute(), url, this); } } - /** - * Handles the cookies specified in meta tags, - * like <meta http-equiv='set-cookie' content='webm=none; path=/;'>. - */ - protected void performSetCookie() { - final SgmlPage page = getPage(); - final WebClient client = page.getWebClient(); - final URL url = page.getUrl(); - client.addCookie(getContentAttribute(), url, this); - } - /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeter.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeter.java index 30357cb075d..f994f734050 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMeter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java index 017fbe95194..147b99b35bb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMonthInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,15 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.Map; import com.gargoylesoftware.htmlunit.SgmlPage; +import org.apache.commons.lang3.StringUtils; /** * Wrapper for the HTML element "input" where type is "month". @@ -43,13 +45,23 @@ public class HtmlMonthInput extends HtmlInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && !hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED) + && StringUtils.isNotEmpty(newValue)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMultiColumn.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMultiColumn.java index eb9c79fa83d..f93eb1d2762 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMultiColumn.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlMultiColumn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java index 397636919e3..e245e3c30f0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNav.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNextId.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNextId.java index 8af81ced4f6..47578e2db36 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNextId.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNextId.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoBreak.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoBreak.java index 96fa2ca57b5..c6a87585952 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoBreak.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoBreak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoEmbed.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoEmbed.java index 52eab4668dd..818de9ff808 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoEmbed.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoEmbed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames.java index 171e1b31dd8..bbfb67ea4d1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoLayer.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoLayer.java index b7d50d0b3e7..e4d4d0130ae 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoLayer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript.java index 02492df2cdf..148f865ad44 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ public class HtmlNoScript extends HtmlElement { */ @Override public DisplayStyle getDefaultStyleDisplay() { - if (!getPage().getWebClient().getOptions().isJavaScriptEnabled()) { + if (!getPage().getWebClient().isJavaScriptEnabled()) { return DisplayStyle.BLOCK; } if (hasFeature(CSS_NOSCRIPT_DISPLAY_INLINE)) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java index 6d5e3029f5d..9e814a7b91e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlNumberInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,10 +49,7 @@ public class HtmlNumberInput extends HtmlInput implements SelectableTextInput { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); } @@ -60,10 +57,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); } @@ -174,17 +168,17 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN * {@inheritDoc} */ @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlNumberInput(getQualifiedName(), getPage(), getAttributesMap()); + public void setDefaultValue(final String defaultValue) { + final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); + setDefaultValue(defaultValue, modifyValue); } /** * {@inheritDoc} */ @Override - public void setDefaultValue(final String defaultValue) { - final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); - setDefaultValue(defaultValue, modifyValue); + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. } /** @@ -203,6 +197,16 @@ public void setValueAttribute(final String newValue) { } } + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlObject.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlObject.java index 0954e79277e..ef0354563c6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlObject.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,8 +63,6 @@ public class HtmlObject extends HtmlElement { public static final String TAG_NAME = "object"; private Applet applet_; - private AppletClassLoader appletClassLoader_; - private List archiveUrls_; /** * Creates an instance of HtmlObject @@ -287,7 +285,7 @@ public final String getVspaceAttribute() { * {@inheritDoc} */ @Override - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { if (getOwnerDocument() instanceof XmlPage) { return; } @@ -297,7 +295,7 @@ protected void onAllChildrenAddedToPage(final boolean postponed) { } final String clsId = getClassIdAttribute(); - if (ATTRIBUTE_NOT_DEFINED != clsId) { + if (ATTRIBUTE_NOT_DEFINED != clsId && getPage().getWebClient().isJavaScriptEngineEnabled()) { ((HTMLObjectElement) getScriptableObject()).setClassid(clsId); } } @@ -374,75 +372,77 @@ private synchronized void setupAppletIfNeeded() throws IOException { appletClassName = appletClassName.substring(0, appletClassName.length() - 6); } - appletClassLoader_ = new AppletClassLoader((Window) getPage().getEnclosingWindow().getScriptableObject(), - Thread.currentThread().getContextClassLoader()); + try (AppletClassLoader appletClassLoader = + new AppletClassLoader((Window) getPage().getEnclosingWindow().getScriptableObject(), + Thread.currentThread().getContextClassLoader())) { - final String documentUrl = page.getUrl().toExternalForm(); - String baseUrl = UrlUtils.resolveUrl(documentUrl, "."); - if (StringUtils.isNotEmpty(codebaseProperty)) { - // codebase can be relative to the page - baseUrl = UrlUtils.resolveUrl(baseUrl, codebaseProperty); - } - if (!baseUrl.endsWith("/")) { - baseUrl = baseUrl + "/"; - } - - // check archive - archiveUrls_ = new LinkedList<>(); - String[] archives = StringUtils.split(params.get(ARCHIVE), ','); - if (null != archives) { - for (int i = 0; i < archives.length; i++) { - final String tmpArchive = archives[i].trim(); - final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive); - final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); - - appletClassLoader_.addArchiveToClassPath(archiveUrl); - archiveUrls_.add(archiveUrl); + final String documentUrl = page.getUrl().toExternalForm(); + String baseUrl = UrlUtils.resolveUrl(documentUrl, "."); + if (StringUtils.isNotEmpty(codebaseProperty)) { + // codebase can be relative to the page + baseUrl = UrlUtils.resolveUrl(baseUrl, codebaseProperty); } - } - archives = StringUtils.split(params.get(CACHE_ARCHIVE), ','); - if (null != archives) { - for (int i = 0; i < archives.length; i++) { - final String tmpArchive = archives[i].trim(); - final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive); - final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); - - appletClassLoader_.addArchiveToClassPath(archiveUrl); - archiveUrls_.add(archiveUrl); + if (!baseUrl.endsWith("/")) { + baseUrl = baseUrl + "/"; } - } - archiveUrls_ = Collections.unmodifiableList(archiveUrls_); - // no archive attribute, single class - if (archiveUrls_.isEmpty()) { - final String tempUrl = UrlUtils.resolveUrl(baseUrl, getAttributeDirect("code")); - final URL classUrl = UrlUtils.toUrlUnsafe(tempUrl); + // check archive + List archiveUrls = new LinkedList<>(); + String[] archives = StringUtils.split(params.get(ARCHIVE), ','); + if (null != archives) { + for (String tmpArchive : archives) { + final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive.trim()); + final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); + + appletClassLoader.addArchiveToClassPath(archiveUrl); + archiveUrls.add(archiveUrl); + } + } + archives = StringUtils.split(params.get(CACHE_ARCHIVE), ','); + if (null != archives) { + for (String tmpArchive : archives) { + final String tempUrl = UrlUtils.resolveUrl(baseUrl, tmpArchive.trim()); + final URL archiveUrl = UrlUtils.toUrlUnsafe(tempUrl); + + appletClassLoader.addArchiveToClassPath(archiveUrl); + archiveUrls.add(archiveUrl); + } + } + archiveUrls = Collections.unmodifiableList(archiveUrls); + + // no archive attribute, single class + if (archiveUrls.isEmpty()) { + final String tempUrl = UrlUtils.resolveUrl(baseUrl, getAttributeDirect("code")); + final URL classUrl = UrlUtils.toUrlUnsafe(tempUrl); + + final WebResponse response = webclient.loadWebResponse(new WebRequest(classUrl)); + try { + webclient.throwFailingHttpStatusCodeExceptionIfNecessary(response); + appletClassLoader.addClassToClassPath(appletClassName, response); + } + catch (final FailingHttpStatusCodeException e) { + // that is what the browser does, the applet only fails, if + // the main class is not loadable + LOG.error(e.getMessage(), e); + } + } - final WebResponse response = webclient.loadWebResponse(new WebRequest(classUrl)); try { - webclient.throwFailingHttpStatusCodeExceptionIfNecessary(response); - appletClassLoader_.addClassToClassPath(appletClassName, response); + final Class appletClass = (Class) appletClassLoader.loadClass(appletClassName); + applet_ = appletClass.newInstance(); + applet_.setStub(new AppletStubImpl(getHtmlPageOrNull(), params, + UrlUtils.toUrlUnsafe(baseUrl), UrlUtils.toUrlUnsafe(documentUrl))); + applet_.init(); + applet_.start(); } - catch (final FailingHttpStatusCodeException e) { - // that is what the browser does, the applet only fails, if - // the main class is not loadable - LOG.error(e.getMessage(), e); + catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) { + if (LOG.isErrorEnabled()) { + LOG.error("Loading applet '" + appletClassName + "' failed\n" + + " " + e.toString() + + "\n Classpath:\n" + appletClassLoader.info()); + } + throw new RuntimeException(e); } } - - try { - final Class appletClass = (Class) appletClassLoader_.loadClass(appletClassName); - applet_ = appletClass.newInstance(); - applet_.setStub(new AppletStubImpl(getHtmlPageOrNull(), params, - UrlUtils.toUrlUnsafe(baseUrl), UrlUtils.toUrlUnsafe(documentUrl))); - applet_.init(); - applet_.start(); - } - catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) { - LOG.error("Loading applet '" + appletClassName + "' failed\n" - + " " + e.toString() - + "\n Classpath:\n" + appletClassLoader_.info()); - throw new RuntimeException(e); - } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java index e9682ce0a2d..f1257b668b5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMOUSEOVER_NEVER_FOR_SELECT_OPTION; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMOUSEUP_FOR_SELECT_OPTION_TRIGGERS_ADDITIONAL_UP_FOR_SELECT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMOUSEUP_NOT_FOR_SELECT_OPTION; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLOPTION_EXACT_ONE_OPTION_GETS_NERVER_DESELECTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLOPTION_PREVENT_DISABLED; import java.io.IOException; @@ -110,17 +109,13 @@ public void setSelectedFromJavaScript(final boolean selected) { * @param shiftKey {@code true} if SHIFT is pressed * @param ctrlKey {@code true} if CTRL is pressed */ - private void setSelected(boolean selected, final boolean invokeOnFocus, final boolean isClick, + private void setSelected(final boolean selected, final boolean invokeOnFocus, final boolean isClick, final boolean shiftKey, final boolean ctrlKey) { if (selected == isSelected()) { return; } final HtmlSelect select = getEnclosingSelect(); if (select != null) { - if (hasFeature(HTMLOPTION_EXACT_ONE_OPTION_GETS_NERVER_DESELECTED) - && !select.isMultipleSelectEnabled() && select.getOptionSize() == 1) { - selected = true; - } select.setSelectedAttribute(this, selected, invokeOnFocus, shiftKey, ctrlKey, isClick); return; } @@ -291,7 +286,9 @@ public Page mouseUp(final boolean shiftKey, final boolean ctrlKey, final boolean */ @Override @SuppressWarnings("unchecked") - public

P click(final Event event, final boolean ignoreVisibility) throws IOException { + public

P click(final Event event, + final boolean shiftKey, final boolean ctrlKey, final boolean altKey, + final boolean ignoreVisibility) throws IOException { if (hasFeature(EVENT_ONCLICK_FOR_SELECT_ONLY)) { final SgmlPage page = getPage(); @@ -303,9 +300,9 @@ public

P click(final Event event, final boolean ignoreVisibilit doClickStateUpdate(event.isShiftKey(), event.isCtrlKey()); } - return getEnclosingSelect().click(event, ignoreVisibility); + return getEnclosingSelect().click(event, shiftKey, ctrlKey, altKey, ignoreVisibility); } - return super.click(event, ignoreVisibility); + return super.click(event, shiftKey, ctrlKey, altKey, ignoreVisibility); } /** @@ -423,6 +420,10 @@ public Page mouseOver(final boolean shiftKey, final boolean ctrlKey, final boole if (page.getWebClient().getBrowserVersion().hasFeature(EVENT_ONMOUSEOVER_NEVER_FOR_SELECT_OPTION)) { return page; } + + if (hasFeature(EVENT_ONMOUSEOVER_FOR_DISABLED_OPTION) && isDisabled()) { + getEnclosingSelect().mouseOver(shiftKey, ctrlKey, altKey, button); + } return super.mouseOver(shiftKey, ctrlKey, altKey, button); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOptionGroup.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOptionGroup.java index 2f541445f8b..3a2b9e62e60 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOptionGroup.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOptionGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOrderedList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOrderedList.java index 9bf42ac568d..92a777e4c77 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOrderedList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOrderedList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java index 4058750f47a..3c968355396 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java index 496025bbfe4..829e07be28f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_FOCUS_FOCUS_IN_BLUR_OUT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_FOCUS_IN_FOCUS_OUT_BLUR; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.FOCUS_BODY_ELEMENT_AT_START; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CALL_RESULT_IS_LAST_RETURN_VALUE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DEFERRED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IGNORES_UTF8_BOM_SOMETIMES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.PAGE_SELECTION_RANGE_FROM_SELECTABLE_TEXT_INPUT; @@ -61,7 +60,6 @@ import org.w3c.dom.ProcessingInstruction; import org.w3c.dom.ranges.Range; -import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.Cache; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; @@ -77,20 +75,22 @@ import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebWindow; -import com.gargoylesoftware.htmlunit.html.HTMLParser.HtmlUnitDOMBuilder; import com.gargoylesoftware.htmlunit.html.impl.SelectableTextInput; import com.gargoylesoftware.htmlunit.html.impl.SimpleRange; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParserDOMBuilder; import com.gargoylesoftware.htmlunit.javascript.AbstractJavaScriptEngine; +import com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory; import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.PostponedAction; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.host.Window; -import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; import com.gargoylesoftware.htmlunit.javascript.host.event.BeforeUnloadEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; +import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.protocol.javascript.JavaScriptURLConnection; import com.gargoylesoftware.htmlunit.util.EncodingSniffer; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.UrlUtils; import net.sourceforge.htmlunit.corejs.javascript.Context; @@ -140,6 +140,7 @@ * @author Ronald Brill * @author Frank Danek * @author Joerg Werner + * @author Atsushi Nakagawa */ public class HtmlPage extends SgmlPage { @@ -147,7 +148,7 @@ public class HtmlPage extends SgmlPage { private static final Comparator documentPositionComparator = new DocumentPositionComparator(); - private HtmlUnitDOMBuilder builder_; + private HTMLParserDOMBuilder domBuilder_; private transient Charset originalCharset_; private Map> idMap_ @@ -244,6 +245,9 @@ public void initialize() throws IOException, FailingHttpStatusCodeException { } } } + + executeEventHandlersIfNeeded(Event.TYPE_DOM_DOCUMENT_LOADED); + loadFrames(); // don't set the ready state if we really load the blank page into the window @@ -256,7 +260,6 @@ public void initialize() throws IOException, FailingHttpStatusCodeException { getDocumentElement().setReadyState(READY_STATE_COMPLETE); } - executeEventHandlersIfNeeded(Event.TYPE_DOM_DOCUMENT_LOADED); executeDeferredScriptsIfNeeded(); setReadyStateOnDeferredScriptsIfNeeded(); @@ -550,7 +553,8 @@ public DomElement createElement(String tagName) { if (tagName.indexOf(':') == -1) { tagName = tagName.toLowerCase(Locale.ROOT); } - return HTMLParser.getFactory(tagName).createElementNS(this, null, tagName, null, true); + return getWebClient().getPageCreator().getHtmlParser().getFactory(tagName) + .createElementNS(this, null, tagName, null, true); } /** @@ -558,8 +562,9 @@ public DomElement createElement(String tagName) { */ @Override public DomElement createElementNS(final String namespaceURI, final String qualifiedName) { - return HTMLParser.getElementFactory(this, namespaceURI, qualifiedName, false, true) - .createElementNS(this, namespaceURI, qualifiedName, null, true); + return getWebClient().getPageCreator().getHtmlParser() + .getElementFactory(this, namespaceURI, qualifiedName, false, true) + .createElementNS(this, namespaceURI, qualifiedName, null, true); } /** @@ -875,7 +880,7 @@ public List getHtmlElementsByAccessKey(final char accessKey) { * be achieved to execute JavaScript in the current page by entering "javascript:...some JS code..." * in the URL field of a native browser.

*

Note: the provided code won't be executed if JavaScript has been disabled on the WebClient - * (see {@link com.gargoylesoftware.htmlunit.WebClientOptions#isJavaScriptEnabled()}.

+ * (see {@link com.gargoylesoftware.htmlunit.WebClient#isJavaScriptEnabled()}.

* @param sourceCode the JavaScript code to execute * @return a ScriptResult which will contain both the current page (which may be different than * the previous page) and a JavaScript result object @@ -905,8 +910,8 @@ public ScriptResult executeJavaScript(final String sourceCode) { * the previous page and a JavaScript result object. */ public ScriptResult executeJavaScript(String sourceCode, final String sourceName, final int startLine) { - if (!getWebClient().getOptions().isJavaScriptEnabled()) { - return new ScriptResult(null, this); + if (!getWebClient().isJavaScriptEnabled()) { + return new ScriptResult(Undefined.instance); } if (StringUtils.startsWithIgnoreCase(sourceCode, JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { @@ -917,13 +922,15 @@ public ScriptResult executeJavaScript(String sourceCode, final String sourceName } final Object result = getWebClient().getJavaScriptEngine().execute(this, sourceCode, sourceName, startLine); - return new ScriptResult(result, getWebClient().getCurrentWindow().getEnclosedPage()); + return new ScriptResult(result); } /** Various possible external JavaScript file loading results. */ enum JavaScriptLoadResult { /** The load was aborted and nothing was done. */ NOOP, + /** The load was aborted and nothing was done. */ + NO_CONTENT, /** The external JavaScript file was downloaded and compiled successfully. */ SUCCESS, /** The external JavaScript file was not downloaded successfully. */ @@ -946,7 +953,7 @@ JavaScriptLoadResult loadExternalJavaScriptFile(final String srcAttribute, final throws FailingHttpStatusCodeException { final WebClient client = getWebClient(); - if (StringUtils.isBlank(srcAttribute) || !client.getOptions().isJavaScriptEnabled()) { + if (StringUtils.isBlank(srcAttribute) || !client.isJavaScriptEnabled()) { return JavaScriptLoadResult.NOOP; } @@ -955,7 +962,9 @@ JavaScriptLoadResult loadExternalJavaScriptFile(final String srcAttribute, final scriptURL = getFullyQualifiedUrl(srcAttribute); final String protocol = scriptURL.getProtocol(); if ("javascript".equals(protocol)) { - LOG.info("Ignoring script src [" + srcAttribute + "]"); + if (LOG.isInfoEnabled()) { + LOG.info("Ignoring script src [" + srcAttribute + "]"); + } return JavaScriptLoadResult.NOOP; } if (!"http".equals(protocol) && !"https".equals(protocol) @@ -979,6 +988,9 @@ JavaScriptLoadResult loadExternalJavaScriptFile(final String srcAttribute, final return JavaScriptLoadResult.DOWNLOAD_ERROR; } catch (final FailingHttpStatusCodeException e) { + if (e.getStatusCode() == HttpStatus.SC_NO_CONTENT) { + return JavaScriptLoadResult.NO_CONTENT; + } client.getJavaScriptErrorListener().loadScriptError(this, scriptURL, e); throw e; } @@ -1011,11 +1023,12 @@ private Object loadJavaScriptFromUrl(final URL url, final Charset scriptCharset) final WebRequest referringRequest = getWebResponse().getWebRequest(); final WebClient client = getWebClient(); - final BrowserVersion browser = client.getBrowserVersion(); - final WebRequest request = new WebRequest(url, browser.getScriptAcceptHeader()); + final WebRequest request = new WebRequest(url); + // copy all headers from the referring request request.setAdditionalHeaders(new HashMap<>(referringRequest.getAdditionalHeaders())); - request.setAdditionalHeader(HttpHeader.REFERER, referringRequest.getUrl().toString()); + // at least overwrite this headers request.setAdditionalHeader(HttpHeader.ACCEPT, client.getBrowserVersion().getScriptAcceptHeader()); + request.setAdditionalHeader(HttpHeader.REFERER, referringRequest.getUrl().toString()); // our cache is a bit strange; // loadWebResponse check the cache for the web response @@ -1034,15 +1047,18 @@ private Object loadJavaScriptFromUrl(final URL url, final Charset scriptCharset) client.throwFailingHttpStatusCodeExceptionIfNecessary(response); final int statusCode = response.getStatusCode(); - final boolean successful = statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES; - final boolean noContent = statusCode == HttpStatus.SC_NO_CONTENT; - if (!successful || noContent) { + if (statusCode == HttpStatus.SC_NO_CONTENT) { + throw new FailingHttpStatusCodeException(response); + } + + if (statusCode < HttpStatus.SC_OK + || statusCode >= HttpStatus.SC_MULTIPLE_CHOICES) { throw new IOException("Unable to download JavaScript from '" + url + "' (status " + statusCode + ")."); } //http://www.ietf.org/rfc/rfc4329.txt final String contentType = response.getContentType(); - if (!"application/javascript".equalsIgnoreCase(contentType) + if (!MimeType.APPLICATION_JAVASCRIPT.equalsIgnoreCase(contentType) && !"application/ecmascript".equalsIgnoreCase(contentType)) { // warn about obsolete or not supported content types if ("text/javascript".equals(contentType) @@ -1199,26 +1215,41 @@ private HtmlTitle getTitleElement() { */ private boolean executeEventHandlersIfNeeded(final String eventType) { // If JavaScript isn't enabled, there's nothing for us to do. - if (!getWebClient().getOptions().isJavaScriptEnabled()) { + if (!getWebClient().isJavaScriptEnabled()) { return true; } // Execute the specified event on the document element. final WebWindow window = getEnclosingWindow(); if (window.getScriptableObject() instanceof Window) { - final DomElement element = getDocumentElement(); - if (element == null) { // happens for instance if document.documentElement has been removed from parent - return true; - } final Event event; if (eventType.equals(Event.TYPE_BEFORE_UNLOAD)) { - event = new BeforeUnloadEvent(element, eventType); + event = new BeforeUnloadEvent(this, eventType); + } + else { + event = new Event(this, eventType); + } + + // This is the same as DomElement.fireEvent() and was copied + // here so it could be used with HtmlPage. + if (LOG.isDebugEnabled()) { + LOG.debug("Firing " + event); + } + + final EventTarget jsNode; + if (Event.TYPE_DOM_DOCUMENT_LOADED.equals(eventType)) { + jsNode = this.getScriptableObject(); } else { - event = new Event(element, eventType); + // The load/beforeunload/unload events target Document but paths Window only (tested in Chrome/FF) + jsNode = window.getScriptableObject(); } - final ScriptResult result = element.fireEvent(event); - if (!isOnbeforeunloadAccepted(this, event, result)) { + + final HtmlUnitContextFactory cf = ((JavaScriptEngine) getWebClient().getJavaScriptEngine()) + .getContextFactory(); + cf.callSecured(cx -> jsNode.fireEvent(event), this); + + if (!isOnbeforeunloadAccepted(this, event)) { return false; } } @@ -1245,8 +1276,13 @@ private boolean executeEventHandlersIfNeeded(final String eventType) { else { event = new Event(frame, eventType); } - final ScriptResult result = ((Node) frame.getScriptableObject()).executeEventLocally(event); - if (!isOnbeforeunloadAccepted((HtmlPage) frame.getPage(), event, result)) { + // This fires the "load" event for the element which, like all non-window + // load events, propagates up to Document but not Window. The "load" event for + // on the other hand, like that of , is handled above where it is + // fired against Document and directed to Window. + frame.fireEvent(event); + + if (!isOnbeforeunloadAccepted((HtmlPage) frame.getPage(), event)) { return false; } } @@ -1265,17 +1301,19 @@ public boolean isOnbeforeunloadAccepted() { return executeEventHandlersIfNeeded(Event.TYPE_BEFORE_UNLOAD); } - private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event, final ScriptResult result) { - if (event.getType().equals(Event.TYPE_BEFORE_UNLOAD)) { - final boolean ie = hasFeature(JS_CALL_RESULT_IS_LAST_RETURN_VALUE); - final String message = getBeforeUnloadMessage(event, result, ie); - if (message != null) { + private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event) { + if (event instanceof BeforeUnloadEvent) { + final BeforeUnloadEvent beforeUnloadEvent = (BeforeUnloadEvent) event; + if (beforeUnloadEvent.isBeforeUnloadMessageSet()) { final OnbeforeunloadHandler handler = getWebClient().getOnbeforeunloadHandler(); if (handler == null) { - LOG.warn("document.onbeforeunload() returned a string in event.returnValue," - + " but no onbeforeunload handler installed."); + if (LOG.isWarnEnabled()) { + LOG.warn("document.onbeforeunload() returned a string in event.returnValue," + + " but no onbeforeunload handler installed."); + } } else { + final String message = Context.toString(beforeUnloadEvent.getReturnValue()); return handler.handleEvent(page, message); } } @@ -1283,30 +1321,6 @@ private boolean isOnbeforeunloadAccepted(final HtmlPage page, final Event event, return true; } - private static String getBeforeUnloadMessage(final Event event, final ScriptResult result, final boolean ie) { - String message = null; - if (event.getReturnValue() != Undefined.instance) { - if (!ie || event.getReturnValue() != null || result == null || result.getJavaScriptResult() == null - || result.getJavaScriptResult() == Undefined.instance) { - message = Context.toString(event.getReturnValue()); - } - } - else { - if (result != null) { - if (ie) { - if (result.getJavaScriptResult() != Undefined.instance) { - message = Context.toString(result.getJavaScriptResult()); - } - } - else if (result.getJavaScriptResult() != null - && result.getJavaScriptResult() != Undefined.instance) { - message = Context.toString(result.getJavaScriptResult()); - } - } - } - return message; - } - /** * If a refresh has been specified either through a meta tag or an HTTP * response header, then perform that refresh. @@ -1338,7 +1352,9 @@ private void executeRefreshIfNeeded() throws IOException { time = Double.parseDouble(refreshString); } catch (final NumberFormatException e) { - LOG.error("Malformed refresh string (no ';' but not a number): " + refreshString, e); + if (LOG.isErrorEnabled()) { + LOG.error("Malformed refresh string (no ';' but not a number): " + refreshString, e); + } return; } url = getUrl(); @@ -1349,12 +1365,16 @@ private void executeRefreshIfNeeded() throws IOException { time = Double.parseDouble(refreshString.substring(0, index).trim()); } catch (final NumberFormatException e) { - LOG.error("Malformed refresh string (no valid number before ';') " + refreshString, e); + if (LOG.isErrorEnabled()) { + LOG.error("Malformed refresh string (no valid number before ';') " + refreshString, e); + } return; } index = refreshString.toLowerCase(Locale.ROOT).indexOf("url=", index); if (index == -1) { - LOG.error("Malformed refresh string (found ';' but no 'url='): " + refreshString); + if (LOG.isErrorEnabled()) { + LOG.error("Malformed refresh string (found ';' but no 'url='): " + refreshString); + } return; } final StringBuilder builder = new StringBuilder(refreshString.substring(index + 4)); @@ -1374,7 +1394,9 @@ private void executeRefreshIfNeeded() throws IOException { url = getFullyQualifiedUrl(urlString); } catch (final MalformedURLException e) { - LOG.error("Malformed URL in refresh string: " + refreshString, e); + if (LOG.isErrorEnabled()) { + LOG.error("Malformed URL in refresh string: " + refreshString, e); + } throw e; } } @@ -1416,7 +1438,7 @@ private String getRefreshStringOrNull() { * Executes any deferred scripts, if necessary. */ private void executeDeferredScriptsIfNeeded() { - if (!getWebClient().getOptions().isJavaScriptEnabled()) { + if (!getWebClient().isJavaScriptEnabled()) { return; } if (hasFeature(JS_DEFERRED)) { @@ -1437,7 +1459,7 @@ private void executeDeferredScriptsIfNeeded() { * Sets the ready state on any deferred scripts, if necessary. */ private void setReadyStateOnDeferredScriptsIfNeeded() { - if (getWebClient().getOptions().isJavaScriptEnabled() && hasFeature(JS_DEFERRED)) { + if (getWebClient().isJavaScriptEnabled() && hasFeature(JS_DEFERRED)) { final List elements = getDocumentElement().getElementsByTagName("script"); for (final HtmlElement e : elements) { if (e instanceof HtmlScript) { @@ -1786,11 +1808,12 @@ else if (!elements.contains(element)) { } } - private static String getAttributeValue(final DomElement element, final String attribute) { + private String getAttributeValue(final DomElement element, final String attribute) { // first try real attributes String value = element.getAttribute(attribute); if (DomElement.ATTRIBUTE_NOT_DEFINED == value + && getWebClient().isJavaScriptEngineEnabled() && !(element instanceof HtmlApplet) && !(element instanceof HtmlObject)) { // second try are JavaScript attributes @@ -1955,8 +1978,10 @@ protected HtmlPage clone() { public HtmlPage cloneNode(final boolean deep) { // we need the ScriptObject clone before cloning the kids. final HtmlPage result = (HtmlPage) super.cloneNode(false); - final SimpleScriptable jsObjClone = ((SimpleScriptable) getScriptableObject()).clone(); - jsObjClone.setDomNode(result); + if (getWebClient().isJavaScriptEnabled()) { + final SimpleScriptable jsObjClone = ((SimpleScriptable) getScriptableObject()).clone(); + jsObjClone.setDomNode(result); + } // if deep, clone the kids too, and re initialize parts of the clone if (deep) { @@ -2088,20 +2113,26 @@ public boolean isBeingParsed() { } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Called by the HTML parser to let the page know that it has started parsing some content for this page. */ - void registerParsingStart() { + public void registerParsingStart() { parserCount_++; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Called by the HTML parser to let the page know that it has finished parsing some content for this page. */ - void registerParsingEnd() { + public void registerParsingEnd() { parserCount_--; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Returns {@code true} if an HTML parser is parsing a non-inline HTML snippet to add content * to this page. Non-inline content is content that is parsed for the page, but not in the * same stream as the page itself -- basically anything other than document.write() @@ -2111,25 +2142,31 @@ void registerParsingEnd() { * @return {@code true} if an HTML parser is parsing a non-inline HTML snippet to add content * to this page */ - boolean isParsingHtmlSnippet() { + public boolean isParsingHtmlSnippet() { return snippetParserCount_ > 0; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Called by the HTML parser to let the page know that it has started parsing a non-inline HTML snippet. */ - void registerSnippetParsingStart() { + public void registerSnippetParsingStart() { snippetParserCount_++; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Called by the HTML parser to let the page know that it has finished parsing a non-inline HTML snippet. */ - void registerSnippetParsingEnd() { + public void registerSnippetParsingEnd() { snippetParserCount_--; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Returns {@code true} if an HTML parser is parsing an inline HTML snippet to add content * to this page. Inline content is content inserted into the parser stream dynamically * while the page is being parsed (i.e. document.write() or document.writeln()). @@ -2137,21 +2174,25 @@ void registerSnippetParsingEnd() { * @return {@code true} if an HTML parser is parsing an inline HTML snippet to add content * to this page */ - boolean isParsingInlineHtmlSnippet() { + public boolean isParsingInlineHtmlSnippet() { return inlineSnippetParserCount_ > 0; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Called by the HTML parser to let the page know that it has started parsing an inline HTML snippet. */ - void registerInlineSnippetParsingStart() { + public void registerInlineSnippetParsingStart() { inlineSnippetParserCount_++; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Called by the HTML parser to let the page know that it has finished parsing an inline HTML snippet. */ - void registerInlineSnippetParsingEnd() { + public void registerInlineSnippetParsingEnd() { inlineSnippetParserCount_--; } @@ -2173,23 +2214,27 @@ public Page refresh() throws IOException { * @param string the HTML code to write in place */ public void writeInParsedStream(final String string) { - builder_.pushInputString(string); + getDOMBuilder().pushInputString(string); } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Sets the builder to allow page to send content from document.write(ln) calls. * @param htmlUnitDOMBuilder the builder */ - void setBuilder(final HtmlUnitDOMBuilder htmlUnitDOMBuilder) { - builder_ = htmlUnitDOMBuilder; + public void setDOMBuilder(final HTMLParserDOMBuilder htmlUnitDOMBuilder) { + domBuilder_ = htmlUnitDOMBuilder; } /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Returns the current builder. * @return the current builder */ - HtmlUnitDOMBuilder getBuilder() { - return builder_; + public HTMLParserDOMBuilder getDOMBuilder() { + return domBuilder_; } /** @@ -2219,7 +2264,7 @@ public Map getNamespaces() { * {@inheritDoc} */ @Override - protected void setDocumentType(final DocumentType type) { + public void setDocumentType(final DocumentType type) { super.setDocumentType(type); } @@ -2268,7 +2313,7 @@ public URL getBaseURL() { if (base_ == null) { baseUrl = getUrl(); final WebWindow window = getEnclosingWindow(); - final boolean frame = window != window.getTopWindow(); + final boolean frame = window != null && window != window.getTopWindow(); if (frame) { final boolean frameSrcIsNotSet = baseUrl == WebClient.URL_ABOUT_BLANK; final boolean frameSrcIsJs = "javascript".equals(baseUrl.getProtocol()); @@ -2295,7 +2340,7 @@ else if (baseUrl_ != null) { else if (href.startsWith("//")) { baseUrl = new URL(String.format("%s:%s", url.getProtocol(), href)); } - else if (href.startsWith("/")) { + else if (href.length() > 0 && href.charAt(0) == '/') { final int port = Window.getPort(url); baseUrl = new URL(String.format("%s://%s:%d%s", url.getProtocol(), url.getHost(), port, href)); } @@ -2363,7 +2408,9 @@ public void setElementFromPointHandler(final ElementFromPointHandler elementFrom */ public HtmlElement getElementFromPoint(final int x, final int y) { if (elementFromPointHandler_ == null) { - LOG.warn("ElementFromPointHandler was not specicifed for " + this); + if (LOG.isWarnEnabled()) { + LOG.warn("ElementFromPointHandler was not specicifed for " + this); + } if (x <= 0 || y <= 0) { return null; } @@ -2506,8 +2553,8 @@ public void setSelectionRange(final Range selectionRange) { */ public ScriptResult executeJavaScriptFunction(final Object function, final Object thisObject, final Object[] args, final DomNode htmlElementScope) { - if (!getWebClient().getOptions().isJavaScriptEnabled()) { - return new ScriptResult(null, this); + if (!getWebClient().isJavaScriptEnabled()) { + return new ScriptResult(null); } return executeJavaScriptFunction((Function) function, (Scriptable) thisObject, args, htmlElementScope); @@ -2519,7 +2566,7 @@ private ScriptResult executeJavaScriptFunction(final Function function, final Sc final JavaScriptEngine engine = (JavaScriptEngine) getWebClient().getJavaScriptEngine(); final Object result = engine.callFunction(this, function, thisObject, args, htmlElementScope); - return new ScriptResult(result, getWebClient().getCurrentWindow().getEnclosedPage()); + return new ScriptResult(result); } private void writeObject(final ObjectOutputStream oos) throws IOException { @@ -2534,4 +2581,20 @@ private void readObject(final ObjectInputStream ois) throws ClassNotFoundExcepti originalCharset_ = Charset.forName(charsetName); } } + + /** + * {@inheritDoc} + */ + @Override + public void setNodeValue(final String value) { + // Default behavior is to do nothing, overridden in some subclasses + } + + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParagraph.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParagraph.java index 810ce67fe51..c63268a59c4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParagraph.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParagraph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParameter.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParameter.java index 9c0c63dfc01..3f3aff319a1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParameter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlParameter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java index 2f881da69f9..44751ab749d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPasswordInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,14 @@ public class HtmlPasswordInput extends HtmlInput implements SelectableTextInput super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @@ -126,10 +134,7 @@ public void setSelectionEnd(final int selectionEnd) { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); } @@ -137,10 +142,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); } @@ -154,14 +156,6 @@ protected void typeDone(final String newValue, final boolean notifyAttributeChan } } - /** - * {@inheritDoc} - */ - @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlPasswordInput(getQualifiedName(), getPage(), getAttributesMap()); - } - /** * {@inheritDoc} */ @@ -192,6 +186,16 @@ public void setDefaultValue(final String defaultValue) { setDefaultValue(defaultValue, modifyValue); } + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPicture.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPicture.java index 20d88d735d2..2e57cc1f770 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPicture.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPicture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPlainText.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPlainText.java index 580cf122c37..d3edd65da70 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPlainText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPlainText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPreformattedText.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPreformattedText.java index b88b8b4e9ef..762ebc929ac 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPreformattedText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlPreformattedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlProgress.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlProgress.java index 718185d1a7f..5d85b65836b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlProgress.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlProgress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRadioButtonInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRadioButtonInput.java index 321356e6e67..19728f3a137 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRadioButtonInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRadioButtonInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -143,7 +143,7 @@ else if (page != null && page.isHtmlPage()) { if (changed) { final ScriptResult scriptResult = fireEvent(Event.TYPE_CHANGE); if (scriptResult != null) { - page = scriptResult.getNewPage(); + page = page.getEnclosingWindow().getWebClient().getCurrentWindow().getEnclosedPage(); } } return page; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRangeInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRangeInput.java index 3b390461c2c..e577f06621b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRangeInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRangeInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,13 @@ import java.util.Map; import com.gargoylesoftware.htmlunit.SgmlPage; +import org.apache.commons.lang3.StringUtils; /** * Wrapper for the HTML element "input" where type is "range". * * @author Ahmed Ashour + * @author Ronald Brill */ public class HtmlRangeInput extends HtmlInput { @@ -35,7 +37,87 @@ public class HtmlRangeInput extends HtmlInput { HtmlRangeInput(final String qualifiedName, final SgmlPage page, final Map attributes) { super(qualifiedName, page, attributes); - setValueAttribute("50"); + + final String value = getValueAttribute(); + if (value == ATTRIBUTE_NOT_DEFINED) { + final double min = getMinNumeric(); + final double max = getMaxNumeric(); + if (max < min) { + setValueAttribute(min); + return; + } + + final double val = min + ((max - min) / 2); + setValueAttribute(val); + } + else { + setValueAttribute(value); + } + } + + /** + * @return the min as double + */ + public double getMinNumeric() { + final String min = getAttributeDirect("min"); + if (min == ATTRIBUTE_NOT_DEFINED) { + return 0; + } + try { + return Double.parseDouble(min); + } + catch (final NumberFormatException e) { + return 0; + } + } + + /** + * @return the max as double + */ + public double getMaxNumeric() { + final String max = getAttributeDirect("max"); + if (max == ATTRIBUTE_NOT_DEFINED) { + return 100; + } + try { + return Double.parseDouble(max); + } + catch (final NumberFormatException e) { + return 100; + } + } + + /** + * @return the max as double + */ + public double getStepNumeric() { + final String step = getAttributeDirect("step"); + if (step == ATTRIBUTE_NOT_DEFINED) { + return 1; + } + try { + return Double.parseDouble(step); + } + catch (final NumberFormatException e) { + return 1; + } + } + + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + + /** + * {@inheritDoc} + */ + @Override + public void setDefaultValue(final String defaultValue) { + final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); + setDefaultValue(defaultValue, modifyValue); } /** @@ -44,9 +126,15 @@ public class HtmlRangeInput extends HtmlInput { @Override public void setValueAttribute(final String newValue) { try { - final int value = Integer.parseInt(newValue); - if (value >= 0 && value <= 100) { - super.setValueAttribute(newValue); + if (StringUtils.isNotEmpty(newValue)) { + setValueAttribute(Double.parseDouble(newValue)); + } + else { + final double min = getMinNumeric(); + final double max = getMaxNumeric(); + + // place in the middle + setValueAttribute(min + ((max - min) / 2)); } } catch (final NumberFormatException e) { @@ -54,6 +142,39 @@ public void setValueAttribute(final String newValue) { } } + private void setValueAttribute(final double newValue) { + double value = newValue; + + final double min = getMinNumeric(); + final double max = getMaxNumeric(); + + if (value > max) { + value = max; + } + else { + if (value < min) { + value = min; + } + } + + final double step = getStepNumeric(); + value = value - min; + int fact = (int) (value / step); + final double rest = value % step; + if (rest >= step / 2) { + fact++; + } + value = min + step * fact; + + if (!Double.isInfinite(value) && (value == Math.floor(value))) { + super.setValueAttribute(Integer.toString((int) value)); + } + else { + super.setValueAttribute(Double.toString(value)); + } + return; + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlResetInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlResetInput.java index a44329b6ffd..6bc826ca17c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlResetInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlResetInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,6 +90,14 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK return false; } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} This method does nothing for reset input elements. * @see SubmittableElement#reset() diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRp.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRp.java index 5ccbbe4b12e..eb0be40994b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRp.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,9 +79,6 @@ public DisplayStyle getDefaultStyleDisplay() { return DisplayStyle.EMPTY; } } - else { - return DisplayStyle.NONE; - } - return DisplayStyle.INLINE; + return DisplayStyle.NONE; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRt.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRt.java index f7b4d084ada..eec57c4effe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRt.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRuby.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRuby.java index 814c29c1698..74363434335 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRuby.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlRuby.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlS.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlS.java index 50859c8db82..5bebd0a2739 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlS.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSample.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSample.java index 1e51cc2ca5a..c68a6a522d1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSample.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java index 1c3da56a7b1..c0bde91af43 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlScript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONLOAD_INTERNAL_JAVASCRIPT; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLSCRIPT_TRIM_TYPE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SCRIPT_HANDLE_204_AS_ERROR; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SCRIPT_SUPPORTS_FOR_AND_EVENT_WINDOW; import java.io.PrintWriter; @@ -101,18 +101,6 @@ public final String getCharsetAttribute() { return getAttributeDirect("charset"); } - /** - * {@inheritDoc} - * - * @deprecated as of 2.27, not used - */ - @Override - @Deprecated - public final Charset getCharset() { - final String charsetName = getCharsetAttribute(); - return EncodingSniffer.toCharset(charsetName); - } - /** * Returns the value of the attribute {@code type}. Refer to the * HTML 4.01 @@ -197,7 +185,7 @@ public boolean mayBeDisplayed() { protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { // special additional processing for the 'src' - if (namespaceURI != null || !"src".equals(qualifiedName)) { + if (namespaceURI != null || !SRC_ATTRIBUTE.equals(qualifiedName)) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); return; @@ -224,7 +212,7 @@ public void execute() { * the script itself, if necessary. {@inheritDoc} */ @Override - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { if (getOwnerDocument() instanceof XmlPage) { return; } @@ -236,9 +224,9 @@ protected void onAllChildrenAddedToPage(final boolean postponed) { @Override public void execute() { Object jsDoc = null; - final Object window = getPage().getEnclosingWindow().getScriptableObject(); - if (window instanceof Window) { - jsDoc = ((Window) window).getDocument(); + final Window window = getPage().getEnclosingWindow().getScriptableObject(); + if (window != null) { + jsDoc = window.getDocument(); ((HTMLDocument) jsDoc).setExecutingDynamicExternalPosponed(getStartLineNumber() == -1 && getSrcAttribute() != ATTRIBUTE_NOT_DEFINED); } @@ -254,12 +242,13 @@ public void execute() { }; final AbstractJavaScriptEngine engine = getPage().getWebClient().getJavaScriptEngine(); - if (hasAttribute("async") && !engine.isScriptRunning()) { + if (engine != null + && hasAttribute("async") && !engine.isScriptRunning()) { final HtmlPage owningPage = getHtmlPageOrNull(); owningPage.addAfterLoadAction(action); } - else if (hasAttribute("async") - || postponed && StringUtils.isBlank(getTextContent())) { + else if (engine != null && (hasAttribute("async") + || postponed && StringUtils.isBlank(getTextContent()))) { engine.addPostponedAction(action); } else { @@ -345,12 +334,13 @@ public void executeScriptIfNeeded() { final HtmlPage page = (HtmlPage) getPage(); final String src = getSrcAttribute(); - if (src.equals(SLASH_SLASH_COLON)) { - executeEvent(Event.TYPE_ERROR); - return; - } if (src != ATTRIBUTE_NOT_DEFINED) { + if (src.equals(SLASH_SLASH_COLON)) { + executeEvent(Event.TYPE_ERROR); + return; + } + if (!src.startsWith(JavaScriptURLConnection.JAVASCRIPT_PREFIX)) { // if (LOG.isDebugEnabled()) { @@ -380,6 +370,15 @@ public void executeScriptIfNeeded() { else if (result == JavaScriptLoadResult.DOWNLOAD_ERROR) { executeEvent(Event.TYPE_ERROR); } + else if (result == JavaScriptLoadResult.NO_CONTENT) { + final BrowserVersion browserVersion = getPage().getWebClient().getBrowserVersion(); + if (browserVersion.hasFeature(JS_SCRIPT_HANDLE_204_AS_ERROR)) { + executeEvent(Event.TYPE_ERROR); + } + else { + executeEvent(Event.TYPE_LOAD); + } + } } catch (final FailingHttpStatusCodeException e) { executeEvent(Event.TYPE_ERROR); @@ -428,7 +427,7 @@ private boolean isExecutionNeeded() { // If JavaScript is disabled, we don't need to execute. final SgmlPage page = getPage(); - if (!page.getWebClient().getOptions().isJavaScriptEnabled()) { + if (!page.getWebClient().isJavaScriptEnabled()) { return false; } @@ -452,58 +451,17 @@ private boolean isExecutionNeeded() { } // If the script language is not JavaScript, we can't execute. - if (!isJavaScript(getTypeAttribute(), getLanguageAttribute())) { - final String t = getTypeAttribute(); - final String l = getLanguageAttribute(); - LOG.warn("Script is not JavaScript (type: " + t + ", language: " + l + "). Skipping execution."); + final String t = getTypeAttribute(); + final String l = getLanguageAttribute(); + if (!ScriptElementSupport.isJavaScript(this, t, l)) { + LOG.warn("Script is not JavaScript (type: '" + t + "', language: '" + l + "'). Skipping execution."); return false; } // If the script's root ancestor node is not the page, then the script is not a part of the page. // If it isn't yet part of the page, don't execute the script; it's probably just being cloned. - if (!getPage().isAncestorOf(this)) { - return false; - } - - return true; - } - - /** - * Returns true if a script with the specified type and language attributes is actually JavaScript. - * According to W3C recommendation - * are content types case insensitive. - * IE supports only a limited number of values for the type attribute. For testing you can - * use http://www.robinlionheart.com/stds/html4/scripts. - * @param typeAttribute the type attribute specified in the script tag - * @param languageAttribute the language attribute specified in the script tag - * @return true if the script is JavaScript - */ - boolean isJavaScript(String typeAttribute, final String languageAttribute) { - final BrowserVersion browserVersion = getPage().getWebClient().getBrowserVersion(); - - if (browserVersion.hasFeature(HTMLSCRIPT_TRIM_TYPE)) { - typeAttribute = typeAttribute.trim(); - } - - if (StringUtils.isNotEmpty(typeAttribute)) { - if ("text/javascript".equalsIgnoreCase(typeAttribute) - || "text/ecmascript".equalsIgnoreCase(typeAttribute)) { - return true; - } - - if ("application/javascript".equalsIgnoreCase(typeAttribute) - || "application/ecmascript".equalsIgnoreCase(typeAttribute) - || "application/x-javascript".equalsIgnoreCase(typeAttribute)) { - return true; - } - return false; - } - - if (StringUtils.isNotEmpty(languageAttribute)) { - return StringUtils.startsWithIgnoreCase(languageAttribute, "javascript"); - } - return true; + return getPage().isAncestorOf(this); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSearchInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSearchInput.java index 3f0135102aa..ac10f7183c3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSearchInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSearchInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java index 4f9377c23ee..76db710ac9f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSelect.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSelect.java index 247a0128aee..8ce3e598fd2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSelect.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSelect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_MOUSE_ON_DISABLED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_SET_VALUES_CHECKS_ONLY_VALUE_ATTRIBUTE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.SELECT_DESELECT_ALL_IF_SWITCHING_UNKNOWN; import java.util.ArrayList; import java.util.Collection; @@ -80,7 +79,7 @@ public class HtmlSelect extends HtmlElement implements DisabledElement, Submitta * @param postponed whether to use {@link com.gargoylesoftware.htmlunit.javascript.PostponedAction} or no */ @Override - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { // Fix the size if necessary. int size; try { @@ -311,10 +310,8 @@ public

P setSelectedAttribute(final String optionValue, return setSelectedAttribute(selected, isSelected, invokeOnFocus, true, false, true); } catch (final ElementNotFoundException e) { - if (hasFeature(SELECT_DESELECT_ALL_IF_SWITCHING_UNKNOWN)) { - for (final HtmlOption o : getSelectedOptions()) { - o.setSelected(false); - } + for (final HtmlOption o : getSelectedOptions()) { + o.setSelected(false); } return (P) getPage(); } @@ -575,7 +572,7 @@ public String asText() { builder.append(currentOption.asText()); } if (i.hasNext()) { - builder.append("\n"); + builder.append('\n'); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializer.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializer.java index 6fa28a53bb1..79c3374b1be 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,12 @@ import java.util.Iterator; import java.util.List; -import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlSerializer.HtmlSerializerTextBuilder.Mode; import com.gargoylesoftware.htmlunit.javascript.host.Element; /** @@ -33,20 +33,6 @@ * @author Rob Kodey */ public class HtmlSerializer { - /** Indicates a block. Will be rendered as line separator (multiple block marks are ignored) */ - protected static final String AS_TEXT_BLOCK_SEPARATOR = "§bs§"; - private static final int AS_TEXT_BLOCK_SEPARATOR_LENGTH = AS_TEXT_BLOCK_SEPARATOR.length(); - - /** Indicates a new line. Will be rendered as line separator. */ - protected static final String AS_TEXT_NEW_LINE = "§nl§"; - private static final int AS_TEXT_NEW_LINE_LENGTH = AS_TEXT_NEW_LINE.length(); - - /** Indicates a non blank that can't be trimmed or reduced. */ - protected static final String AS_TEXT_BLANK = "§blank§"; - /** Indicates a tab. */ - protected static final String AS_TEXT_TAB = "§tab§"; - - private static final Pattern TEXT_AREA_PATTERN = Pattern.compile("\r?\n"); private boolean ignoreMaskedElements_ = true; @@ -56,145 +42,9 @@ public class HtmlSerializer { * @return the text representation according to the setting of this serializer */ public String asText(final DomNode node) { - final StringBuilder builder = new StringBuilder(); + final HtmlSerializerTextBuilder builder = new HtmlSerializerTextBuilder(); appendNode(builder, node); - final String response = builder.toString(); - return cleanUp(response); - } - - /** - * Reduce the whitespace and do some more cleanup. - * @param text the text to clean up - * @return the new text - */ - protected String cleanUp(String text) { - // ignore
at the end of a block - text = reduceWhitespace(text); - text = StringUtils.replace(text, AS_TEXT_BLANK, " "); - final String ls = System.lineSeparator(); - text = StringUtils.replace(text, AS_TEXT_NEW_LINE, ls); - text = StringUtils.replace(text, AS_TEXT_BLOCK_SEPARATOR, ls); - text = StringUtils.replace(text, AS_TEXT_TAB, "\t"); - - return text; - } - - private static String reduceWhitespace(String text) { - text = trim(text); - - // remove white spaces before or after block separators - text = reduceWhiteSpaceAroundBlockSeparator(text); - - // remove leading block separators - while (text.startsWith(AS_TEXT_BLOCK_SEPARATOR)) { - text = text.substring(AS_TEXT_BLOCK_SEPARATOR_LENGTH); - } - - // remove trailing block separators - while (text.endsWith(AS_TEXT_BLOCK_SEPARATOR)) { - text = text.substring(0, text.length() - AS_TEXT_BLOCK_SEPARATOR_LENGTH); - } - text = trim(text); - - final StringBuilder builder = new StringBuilder(text.length()); - - boolean whitespace = false; - for (final char ch : text.toCharArray()) { - - // Translate non-breaking space to regular space. - if (ch == (char) 160) { - builder.append(' '); - whitespace = false; - } - else { - if (whitespace) { - if (!isSpace(ch)) { - builder.append(ch); - whitespace = false; - } - } - else { - if (isSpace(ch)) { - whitespace = true; - builder.append(' '); - } - else { - builder.append(ch); - } - } - } - } - return builder.toString(); - } - - private static boolean isSpace(final char ch) { - return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\f' || ch == '\r'; - } - - private static String trim(String string) { - int length = string.length(); - - int start = 0; - while (start != length && isSpace(string.charAt(start))) { - start++; - } - if (start != 0) { - string = string.substring(start); - length = string.length(); - } - - if (length != 0) { - int end = length; - while (end != 0 && isSpace(string.charAt(end - 1))) { - end--; - } - if (end != length) { - string = string.substring(0, end); - } - } - - return string; - } - - private static String reduceWhiteSpaceAroundBlockSeparator(final String text) { - int p0 = text.indexOf(AS_TEXT_BLOCK_SEPARATOR); - if (p0 == -1) { - return text; - } - - final int length = text.length(); - if (length <= AS_TEXT_BLOCK_SEPARATOR_LENGTH) { - return text; - } - - final StringBuilder result = new StringBuilder(length); - int start = 0; - while (p0 != -1) { - int p1 = p0 + AS_TEXT_BLOCK_SEPARATOR_LENGTH; - while (p0 != start && isSpace(text.charAt(p0 - 1))) { - p0--; - } - if (p0 >= AS_TEXT_NEW_LINE_LENGTH && text.startsWith(AS_TEXT_NEW_LINE, p0 - AS_TEXT_NEW_LINE_LENGTH)) { - p0 = p0 - AS_TEXT_NEW_LINE_LENGTH; - } - result.append(text.substring(start, p0)).append(AS_TEXT_BLOCK_SEPARATOR); - - while (p1 < length && isSpace(text.charAt(p1))) { - p1++; - } - start = p1; - - // ignore duplicates - p0 = text.indexOf(AS_TEXT_BLOCK_SEPARATOR, start); - while (p0 != -1 && p0 == start) { - start += AS_TEXT_BLOCK_SEPARATOR_LENGTH; - p0 = text.indexOf(AS_TEXT_BLOCK_SEPARATOR, start); - } - } - if (start < length) { - result.append(text.substring(start)); - } - return result.toString(); + return builder.getText(); } /** @@ -203,7 +53,7 @@ private static String reduceWhiteSpaceAroundBlockSeparator(final String text) { * @param builder the StringBuilder to add to * @param node the node to process */ - protected void appendChildren(final StringBuilder builder, final DomNode node) { + protected void appendChildren(final HtmlSerializerTextBuilder builder, final DomNode node) { for (final DomNode child : node.getChildren()) { appendNode(builder, child); } @@ -216,7 +66,7 @@ protected void appendChildren(final StringBuilder builder, final DomNode node) { * @param builder the StringBuilder to add to * @param node the node to process */ - protected void appendNode(final StringBuilder builder, final DomNode node) { + protected void appendNode(final HtmlSerializerTextBuilder builder, final DomNode node) { if (node instanceof DomText) { appendText(builder, (DomText) node); } @@ -284,7 +134,7 @@ else if (node instanceof HtmlPreformattedText) { else if (node instanceof HtmlInlineFrame) { appendInlineFrame(builder, (HtmlInlineFrame) node); } - else if (node instanceof HtmlNoScript && node.getPage().getWebClient().getOptions().isJavaScriptEnabled()) { + else if (node instanceof HtmlNoScript && node.getPage().getWebClient().isJavaScriptEnabled()) { appendNoScript(builder, (HtmlNoScript) node); } else { @@ -298,27 +148,26 @@ else if (node instanceof HtmlNoScript && node.getPage().getWebClient().getOption * @param builder the StringBuilder to add to * @param domNode the target to process */ - protected void appendDomNode(final StringBuilder builder, final DomNode domNode) { - final boolean block; - final Object scriptableObject = domNode.getScriptableObject(); - if (domNode instanceof HtmlBody) { - block = false; - } - else if (scriptableObject instanceof Element) { - final Element element = (Element) scriptableObject; - final String display = element.getWindow().getComputedStyle(element, null).getDisplay(true); - block = "block".equals(display); - } - else { - block = false; + protected void appendDomNode(final HtmlSerializerTextBuilder builder, final DomNode domNode) { + boolean block = false; + if (!(domNode instanceof HtmlBody)) { + final SgmlPage page = domNode.getPage(); + if (page != null && page.getWebClient().isJavaScriptEngineEnabled()) { + final Object scriptableObject = domNode.getScriptableObject(); + if (scriptableObject instanceof Element) { + final Element element = (Element) scriptableObject; + final String display = element.getWindow().getComputedStyle(element, null).getDisplay(true); + block = "block".equals(display); + } + } } if (block) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } appendChildren(builder, domNode); if (block) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } } @@ -328,7 +177,7 @@ else if (scriptableObject instanceof Element) { * @param builder the StringBuilder to add to * @param htmlHiddenInput the target to process */ - protected void appendHiddenInput(final StringBuilder builder, final HtmlHiddenInput htmlHiddenInput) { + protected void appendHiddenInput(final HtmlSerializerTextBuilder builder, final HtmlHiddenInput htmlHiddenInput) { // nothing to do } @@ -338,7 +187,7 @@ protected void appendHiddenInput(final StringBuilder builder, final HtmlHiddenIn * @param builder the StringBuilder to add to * @param htmlScript the target to process */ - protected void appendScript(final StringBuilder builder, final HtmlScript htmlScript) { + protected void appendScript(final HtmlSerializerTextBuilder builder, final HtmlScript htmlScript) { // nothing to do } @@ -348,7 +197,7 @@ protected void appendScript(final StringBuilder builder, final HtmlScript htmlSc * @param builder the StringBuilder to add to * @param htmlStyle the target to process */ - protected void appendStyle(final StringBuilder builder, final HtmlStyle htmlStyle) { + protected void appendStyle(final HtmlSerializerTextBuilder builder, final HtmlStyle htmlStyle) { // nothing to do } @@ -358,7 +207,7 @@ protected void appendStyle(final StringBuilder builder, final HtmlStyle htmlStyl * @param builder the StringBuilder to add to * @param htmlNoScript the target to process */ - protected void appendNoScript(final StringBuilder builder, final HtmlNoScript htmlNoScript) { + protected void appendNoScript(final HtmlSerializerTextBuilder builder, final HtmlNoScript htmlNoScript) { // nothing to do } @@ -368,7 +217,7 @@ protected void appendNoScript(final StringBuilder builder, final HtmlNoScript ht * @param builder the StringBuilder to add to * @param htmlNoFrames the target to process */ - protected void appendNoFrames(final StringBuilder builder, final HtmlNoFrames htmlNoFrames) { + protected void appendNoFrames(final HtmlSerializerTextBuilder builder, final HtmlNoFrames htmlNoFrames) { // nothing to do } @@ -378,8 +227,8 @@ protected void appendNoFrames(final StringBuilder builder, final HtmlNoFrames ht * @param builder the StringBuilder to add to * @param htmlSubmitInput the target to process */ - protected void appendSubmitInput(final StringBuilder builder, final HtmlSubmitInput htmlSubmitInput) { - builder.append(htmlSubmitInput.asText()); + protected void appendSubmitInput(final HtmlSerializerTextBuilder builder, final HtmlSubmitInput htmlSubmitInput) { + builder.append(htmlSubmitInput.asText(), Mode.NORMALIZE); } /** @@ -388,8 +237,8 @@ protected void appendSubmitInput(final StringBuilder builder, final HtmlSubmitIn * @param builder the StringBuilder to add to * @param htmlInput the target to process */ - protected void appendInput(final StringBuilder builder, final HtmlInput htmlInput) { - builder.append(htmlInput.getValueAttribute()); + protected void appendInput(final HtmlSerializerTextBuilder builder, final HtmlInput htmlInput) { + builder.append(htmlInput.getValueAttribute(), Mode.NORMALIZE); } /** @@ -398,8 +247,8 @@ protected void appendInput(final StringBuilder builder, final HtmlInput htmlInpu * @param builder the StringBuilder to add to * @param htmlResetInput the target to process */ - protected void appendResetInput(final StringBuilder builder, final HtmlResetInput htmlResetInput) { - builder.append(htmlResetInput.asText()); + protected void appendResetInput(final HtmlSerializerTextBuilder builder, final HtmlResetInput htmlResetInput) { + builder.append(htmlResetInput.asText(), Mode.NORMALIZE); } /** @@ -407,17 +256,18 @@ protected void appendResetInput(final StringBuilder builder, final HtmlResetInpu * @param builder the StringBuilder to add to * @param htmlUnorderedList the target to process */ - protected void appendUnorderedList(final StringBuilder builder, final HtmlUnorderedList htmlUnorderedList) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + protected void appendUnorderedList(final HtmlSerializerTextBuilder builder, + final HtmlUnorderedList htmlUnorderedList) { + builder.appendBlockSeparator(); boolean first = true; for (final DomNode item : htmlUnorderedList.getChildren()) { if (!first) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } first = false; appendNode(builder, item); } - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } /** @@ -425,15 +275,15 @@ protected void appendUnorderedList(final StringBuilder builder, final HtmlUnorde * @param builder the StringBuilder to add to * @param htmlTitle the target to process */ - protected void appendTitle(final StringBuilder builder, final HtmlTitle htmlTitle) { + protected void appendTitle(final HtmlSerializerTextBuilder builder, final HtmlTitle htmlTitle) { // optimized version // for the title there is no need to check the visibility // of the containing dom text; // this optimization defers the load of the style sheets final DomNode child = htmlTitle.getFirstChild(); if (child instanceof DomText) { - builder.append(((DomText) child).getData()); - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.append(((DomText) child).getData(), Mode.NORMALIZE); + builder.appendBlockSeparator(); } } @@ -443,11 +293,11 @@ protected void appendTitle(final StringBuilder builder, final HtmlTitle htmlTitl * @param builder the StringBuilder to add to * @param htmlTableRow the target to process */ - protected void appendTableRow(final StringBuilder builder, final HtmlTableRow htmlTableRow) { + protected void appendTableRow(final HtmlSerializerTextBuilder builder, final HtmlTableRow htmlTableRow) { boolean first = true; for (final HtmlTableCell cell : htmlTableRow.getCells()) { if (!first) { - builder.append(AS_TEXT_TAB); + builder.appendTab(); } else { first = false; @@ -462,14 +312,9 @@ protected void appendTableRow(final StringBuilder builder, final HtmlTableRow ht * @param builder the StringBuilder to add to * @param htmlTextArea the target to process */ - protected void appendTextArea(final StringBuilder builder, final HtmlTextArea htmlTextArea) { + protected void appendTextArea(final HtmlSerializerTextBuilder builder, final HtmlTextArea htmlTextArea) { if (isVisible(htmlTextArea)) { - String text = htmlTextArea.getText(); - text = StringUtils.stripEnd(text, null); - text = TEXT_AREA_PATTERN.matcher(text).replaceAll(AS_TEXT_NEW_LINE); - text = StringUtils.replace(text, "\r", AS_TEXT_NEW_LINE); - text = StringUtils.replace(text, " ", AS_TEXT_BLANK); - builder.append(text); + builder.append(htmlTextArea.getText(), Mode.PRESERVE_BLANK_NEWLINE); } } @@ -479,12 +324,12 @@ protected void appendTextArea(final StringBuilder builder, final HtmlTextArea ht * @param builder the StringBuilder to add to * @param htmlTable the target to process */ - protected void appendTable(final StringBuilder builder, final HtmlTable htmlTable) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + protected void appendTable(final HtmlSerializerTextBuilder builder, final HtmlTable htmlTable) { + builder.appendBlockSeparator(); final String caption = htmlTable.getCaptionText(); if (caption != null) { - builder.append(caption); - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.append(caption, Mode.NORMALIZE); + builder.appendBlockSeparator(); } boolean first = true; @@ -509,7 +354,7 @@ else if (tableRows.isEmpty()) { } } - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } /** @@ -522,7 +367,7 @@ else if (tableRows.isEmpty()) { * @param skipParent2 skip row if the parent is this * @return true if this was the first one */ - protected boolean appendTableRows(final StringBuilder builder, + protected boolean appendTableRows(final HtmlSerializerTextBuilder builder, final List rows, boolean first, final TableRowGroup skipParent1, final TableRowGroup skipParent2) { for (final HtmlTableRow row : rows) { @@ -530,7 +375,7 @@ protected boolean appendTableRows(final StringBuilder builder, continue; } if (!first) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } first = false; appendTableRow(builder, row); @@ -544,7 +389,7 @@ protected boolean appendTableRows(final StringBuilder builder, * @param builder the StringBuilder to add to * @param htmlSelect the target to process */ - protected void appendSelect(final StringBuilder builder, final HtmlSelect htmlSelect) { + protected void appendSelect(final HtmlSerializerTextBuilder builder, final HtmlSelect htmlSelect) { final List options; if (htmlSelect.isMultipleSelectEnabled()) { options = htmlSelect.getOptions(); @@ -557,7 +402,7 @@ protected void appendSelect(final StringBuilder builder, final HtmlSelect htmlSe final HtmlOption currentOption = i.next(); appendNode(builder, currentOption); if (i.hasNext()) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } } } @@ -568,25 +413,25 @@ protected void appendSelect(final StringBuilder builder, final HtmlSelect htmlSe * @param builder the StringBuilder to add to * @param htmlOrderedList the OL element */ - protected void appendOrderedList(final StringBuilder builder, final HtmlOrderedList htmlOrderedList) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + protected void appendOrderedList(final HtmlSerializerTextBuilder builder, final HtmlOrderedList htmlOrderedList) { + builder.appendBlockSeparator(); boolean first = true; int i = 1; for (final DomNode item : htmlOrderedList.getChildren()) { if (!first) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } first = false; if (item instanceof HtmlListItem) { - builder.append(Integer.toString(i++)); - builder.append(". "); + builder.append(Integer.toString(i++), Mode.NORMALIZE); + builder.append(". ", Mode.NORMALIZE); appendChildren(builder, item); } else { appendNode(builder, item); } } - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } /** @@ -595,17 +440,12 @@ protected void appendOrderedList(final StringBuilder builder, final HtmlOrderedL * @param builder the StringBuilder to add to * @param htmlPreformattedText the target to process */ - protected void appendPreformattedText(final StringBuilder builder, + protected void appendPreformattedText(final HtmlSerializerTextBuilder builder, final HtmlPreformattedText htmlPreformattedText) { if (isVisible(htmlPreformattedText)) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); - String text = htmlPreformattedText.getTextContent(); - text = StringUtils.replace(text, "\t", AS_TEXT_TAB); - text = StringUtils.replace(text, " ", AS_TEXT_BLANK); - text = TEXT_AREA_PATTERN.matcher(text).replaceAll(AS_TEXT_NEW_LINE); - text = StringUtils.replace(text, "\r", AS_TEXT_NEW_LINE); - builder.append(text); - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); + builder.append(htmlPreformattedText.getTextContent(), Mode.PRESERVE_BLANK_TAB_NEWLINE); + builder.appendBlockSeparator(); } } @@ -615,15 +455,15 @@ protected void appendPreformattedText(final StringBuilder builder, * @param builder the StringBuilder to add to * @param htmlInlineFrame the target to process */ - protected void appendInlineFrame(final StringBuilder builder, + protected void appendInlineFrame(final HtmlSerializerTextBuilder builder, final HtmlInlineFrame htmlInlineFrame) { if (isVisible(htmlInlineFrame)) { - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); final Page page = htmlInlineFrame.getEnclosedPage(); if (page instanceof SgmlPage) { - builder.append(((SgmlPage) page).asText()); + builder.append(((SgmlPage) page).asText(), Mode.NORMALIZE); } - builder.append(AS_TEXT_BLOCK_SEPARATOR); + builder.appendBlockSeparator(); } } @@ -633,10 +473,10 @@ protected void appendInlineFrame(final StringBuilder builder, * @param builder the StringBuilder to add to * @param domText the target to process */ - protected void appendText(final StringBuilder builder, final DomText domText) { + protected void appendText(final HtmlSerializerTextBuilder builder, final DomText domText) { final DomNode parent = domText.getParentNode(); if (parent == null || parent instanceof HtmlTitle || isVisible(parent)) { - builder.append(domText.getData()); + builder.append(domText.getData(), Mode.NORMALIZE); } } @@ -646,7 +486,7 @@ protected void appendText(final StringBuilder builder, final DomText domText) { * @param builder the StringBuilder to add to * @param domComment the target to process */ - protected void appendComment(final StringBuilder builder, final DomComment domComment) { + protected void appendComment(final HtmlSerializerTextBuilder builder, final DomComment domComment) { // nothing to do } @@ -656,7 +496,7 @@ protected void appendComment(final StringBuilder builder, final DomComment domCo * @param builder the StringBuilder to add to * @param htmlApplet the target to process */ - protected void appendApplet(final StringBuilder builder, final HtmlApplet htmlApplet) { + protected void appendApplet(final HtmlSerializerTextBuilder builder, final HtmlApplet htmlApplet) { // nothing to do } @@ -666,8 +506,8 @@ protected void appendApplet(final StringBuilder builder, final HtmlApplet htmlAp * @param builder the StringBuilder to add to * @param htmlBreak the target to process */ - protected void appendBreak(final StringBuilder builder, final HtmlBreak htmlBreak) { - builder.append(AS_TEXT_NEW_LINE); + protected void appendBreak(final HtmlSerializerTextBuilder builder, final HtmlBreak htmlBreak) { + builder.appendNewLine(); } /** @@ -676,12 +516,13 @@ protected void appendBreak(final StringBuilder builder, final HtmlBreak htmlBrea * @param builder the StringBuilder to add to * @param htmlCheckBoxInput the target to process */ - protected void doAppendCheckBoxInput(final StringBuilder builder, final HtmlCheckBoxInput htmlCheckBoxInput) { + protected void doAppendCheckBoxInput(final HtmlSerializerTextBuilder builder, + final HtmlCheckBoxInput htmlCheckBoxInput) { if (htmlCheckBoxInput.isChecked()) { - builder.append("checked"); + builder.append("checked", Mode.NORMALIZE); } else { - builder.append("unchecked"); + builder.append("unchecked", Mode.NORMALIZE); } } @@ -691,13 +532,13 @@ protected void doAppendCheckBoxInput(final StringBuilder builder, final HtmlChec * @param builder the StringBuilder to add to * @param htmlRadioButtonInput the target to process */ - protected void doAppendRadioButtonInput(final StringBuilder builder, + protected void doAppendRadioButtonInput(final HtmlSerializerTextBuilder builder, final HtmlRadioButtonInput htmlRadioButtonInput) { if (htmlRadioButtonInput.isChecked()) { - builder.append("checked"); + builder.append("checked", Mode.NORMALIZE); } else { - builder.append("unchecked"); + builder.append("unchecked", Mode.NORMALIZE); } } @@ -713,4 +554,196 @@ private boolean isVisible(final DomNode node) { public void setIgnoreMaskedElements(final boolean ignore) { ignoreMaskedElements_ = ignore; } + + protected static class HtmlSerializerTextBuilder { + /** Mode. */ + protected enum Mode { + /** Collapse whitespace. */ + NORMALIZE, + + /** Preserve tab, blank, newline. */ + PRESERVE_BLANK_TAB_NEWLINE, + + /** Preserve blank, newline. */ + PRESERVE_BLANK_NEWLINE + } + + private enum State { + DEFAULT, + EMPTY, + TRIM, + BLANK_AT_END, + BLANK_AT_END_AFTER_NEWLINE, + NEWLINE_AT_END, + BLOCK_SEPARATOR_AT_END + } + + private static final String LINE_SEPARATOR = System.lineSeparator(); + private static final int LINE_SEPARATOR_LENGTH = LINE_SEPARATOR.length(); + + private State state_; + private final StringBuilder builder_; + private int trimRightPos_; + + public HtmlSerializerTextBuilder() { + builder_ = new StringBuilder(); + state_ = State.EMPTY; + trimRightPos_ = 0; + } + + public void append(final String content, final Mode mode) { + final int length = content.length(); + if (length == 0) { + return; + } + + String text = content; + if (mode == Mode.PRESERVE_BLANK_NEWLINE) { + text = StringUtils.stripEnd(text, null); + } + + boolean crFound = false; + for (final char c : text.toCharArray()) { + if (mode == Mode.NORMALIZE) { + if (isSpace(c)) { + switch (state_) { + case EMPTY: + case TRIM: + case BLANK_AT_END: + case BLANK_AT_END_AFTER_NEWLINE: + case BLOCK_SEPARATOR_AT_END: + break; + case NEWLINE_AT_END: + builder_.append(' '); + state_ = State.BLANK_AT_END_AFTER_NEWLINE; + break; + default: + builder_.append(' '); + state_ = State.BLANK_AT_END; + break; + } + } + else if (c == (char) 160) { + builder_.append(' '); + state_ = State.DEFAULT; + trimRightPos_ = builder_.length(); + } + else { + builder_.append(c); + state_ = State.DEFAULT; + trimRightPos_ = builder_.length(); + } + continue; + } + + // preserve mode + if (c == '\n') { + appendNewLine(); + crFound = false; + } + else { + if (crFound) { + appendNewLine(); + } + crFound = c == '\r'; + + if (c == '\t') { + if (mode == Mode.PRESERVE_BLANK_TAB_NEWLINE) { + appendTab(); + } + else if (state_ != State.BLOCK_SEPARATOR_AT_END) { + builder_.append(' '); + } + } + else if (c == (char) 160) { + appendBlank(); + } + else if (c == ' ') { + appendBlank(); + } + else { + builder_.append(c); + } + trimRightPos_ = builder_.length(); + } + } + + if (crFound) { + appendNewLine(); + } + + if (mode != Mode.NORMALIZE) { + // reset state to empty to restart whitespace normalization afterwards + state_ = State.TRIM; + } + } + + public void appendBlockSeparator() { + switch (state_) { + case EMPTY: + break; + case BLANK_AT_END: + builder_.setLength(trimRightPos_); + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + else { + builder_.append(LINE_SEPARATOR); + state_ = State.BLOCK_SEPARATOR_AT_END; + } + break; + case BLANK_AT_END_AFTER_NEWLINE: + builder_.setLength(trimRightPos_ - LINE_SEPARATOR_LENGTH); + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + else { + builder_.append(LINE_SEPARATOR); + state_ = State.BLOCK_SEPARATOR_AT_END; + } + break; + case BLOCK_SEPARATOR_AT_END: + break; + case NEWLINE_AT_END: + builder_.setLength(builder_.length() - LINE_SEPARATOR_LENGTH); + trimRightPos_ = trimRightPos_ - LINE_SEPARATOR_LENGTH; + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + else { + builder_.append(LINE_SEPARATOR); + state_ = State.BLOCK_SEPARATOR_AT_END; + } + break; + default: + builder_.append(LINE_SEPARATOR); + state_ = State.BLOCK_SEPARATOR_AT_END; + break; + } + } + + public void appendNewLine() { + builder_.append(LINE_SEPARATOR); + state_ = State.NEWLINE_AT_END; + trimRightPos_ = builder_.length(); + } + + public void appendTab() { + builder_.append('\t'); + trimRightPos_ = builder_.length(); + } + + private void appendBlank() { + builder_.append(' '); + trimRightPos_ = builder_.length(); + } + + public String getText() { + return builder_.substring(0, trimRightPos_); + } + + private static boolean isSpace(final char ch) { + return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\f' || ch == '\r'; + } + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializerVisibleText.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializerVisibleText.java new file mode 100644 index 00000000000..f5618bd27f9 --- /dev/null +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSerializerVisibleText.java @@ -0,0 +1,940 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html; + +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +import com.gargoylesoftware.htmlunit.Page; +import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlSerializerVisibleText.HtmlSerializerTextBuilder.Mode; +import com.gargoylesoftware.htmlunit.javascript.host.Element; +import com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration; +import com.gargoylesoftware.htmlunit.javascript.host.css.StyleAttributes.Definition; +import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; + +/** + * Special serializer to generate the output we need + * at least for selenium WebElement#getText(). + * + * @author Ronald Brill + */ +public class HtmlSerializerVisibleText { + + /** + * Converts an HTML node to text. + * @param node a node + * @return the text representation according to the setting of this serializer + */ + public String asText(final DomNode node) { + if (node instanceof HtmlBreak) { + return ""; + } + final HtmlSerializerTextBuilder builder = new HtmlSerializerTextBuilder(); + appendNode(builder, node, whiteSpaceStyle(node, Mode.WHITE_SPACE_NORMAL)); + return builder.getText(); + } + + /** + * Iterate over all Children and call appendNode() for every. + * + * @param builder the StringBuilder to add to + * @param node the node to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendChildren(final HtmlSerializerTextBuilder builder, final DomNode node, final Mode mode) { + for (final DomNode child : node.getChildren()) { + appendNode(builder, child, mode); + } + } + + /** + * The core distribution method call the different appendXXX + * methods depending on the type of the given node. + * + * @param builder the StringBuilder to add to + * @param node the node to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendNode(final HtmlSerializerTextBuilder builder, final DomNode node, final Mode mode) { + if (node instanceof DomText) { + appendText(builder, (DomText) node, mode); + } + else if (node instanceof DomComment) { + appendComment(builder, (DomComment) node, mode); + } + else if (node instanceof HtmlApplet + && node.getPage().getWebClient().getOptions().isAppletEnabled()) { + appendApplet(builder, (HtmlApplet) node, mode); + } + else if (node instanceof HtmlBreak) { + appendBreak(builder, (HtmlBreak) node, mode); + } + else if (node instanceof HtmlHiddenInput) { + appendHiddenInput(builder, (HtmlHiddenInput) node, mode); + } + else if (node instanceof HtmlScript) { + appendScript(builder, (HtmlScript) node, mode); + } + else if (node instanceof HtmlStyle) { + appendStyle(builder, (HtmlStyle) node, mode); + } + else if (node instanceof HtmlNoFrames) { + appendNoFrames(builder, (HtmlNoFrames) node, mode); + } + else if (node instanceof HtmlTextArea) { + appendTextArea(builder, (HtmlTextArea) node, mode); + } + else if (node instanceof HtmlTitle) { + appendTitle(builder, (HtmlTitle) node, mode); + } + else if (node instanceof HtmlTableRow) { + appendTableRow(builder, (HtmlTableRow) node, mode); + } + else if (node instanceof HtmlSelect) { + appendSelect(builder, (HtmlSelect) node, mode); + } + else if (node instanceof HtmlOption) { + appendOption(builder, (HtmlOption) node, mode); + } + else if (node instanceof HtmlSubmitInput) { + appendSubmitInput(builder, (HtmlSubmitInput) node, mode); + } + else if (node instanceof HtmlResetInput) { + appendResetInput(builder, (HtmlResetInput) node, mode); + } + else if (node instanceof HtmlCheckBoxInput) { + doAppendCheckBoxInput(builder, (HtmlCheckBoxInput) node, mode); + } + else if (node instanceof HtmlRadioButtonInput) { + doAppendRadioButtonInput(builder, (HtmlRadioButtonInput) node, mode); + } + else if (node instanceof HtmlInput) { + // nothing + } + else if (node instanceof HtmlTable) { + appendTable(builder, (HtmlTable) node, mode); + } + else if (node instanceof HtmlOrderedList) { + appendOrderedList(builder, (HtmlOrderedList) node, mode); + } + else if (node instanceof HtmlUnorderedList) { + appendUnorderedList(builder, (HtmlUnorderedList) node, mode); + } + else if (node instanceof HtmlPreformattedText) { + appendPreformattedText(builder, (HtmlPreformattedText) node, mode); + } + else if (node instanceof HtmlInlineFrame) { + appendInlineFrame(builder, (HtmlInlineFrame) node, mode); + } + else if (node instanceof HtmlMenu) { + appendMenu(builder, (HtmlMenu) node, mode); + } + else if (node instanceof HtmlNoScript && node.getPage().getWebClient().isJavaScriptEnabled()) { + appendNoScript(builder, (HtmlNoScript) node, mode); + } + else { + appendDomNode(builder, node, mode); + } + } + + /** + * Process {@link HtmlHiddenInput}. + * + * @param builder the StringBuilder to add to + * @param domNode the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendDomNode(final HtmlSerializerTextBuilder builder, + final DomNode domNode, final Mode mode) { + final boolean block; + final Object scriptableObject = domNode.getScriptableObject(); + if (domNode instanceof HtmlBody) { + block = false; + } + else if (scriptableObject instanceof Element) { + final Element element = (Element) scriptableObject; + final String display = element.getWindow().getComputedStyle(element, null).getDisplay(true); + block = "block".equals(display); + } + else { + block = false; + } + + if (block) { + builder.appendBlockSeparator(); + } + appendChildren(builder, domNode, mode); + if (block) { + builder.appendBlockSeparator(); + } + } + + /** + * Process {@link HtmlHiddenInput}. + * + * @param builder the StringBuilder to add to + * @param htmlHiddenInput the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendHiddenInput(final HtmlSerializerTextBuilder builder, + final HtmlHiddenInput htmlHiddenInput, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlScript}. + * + * @param builder the StringBuilder to add to + * @param htmlScript the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendScript(final HtmlSerializerTextBuilder builder, + final HtmlScript htmlScript, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlStyle}. + * + * @param builder the StringBuilder to add to + * @param htmlStyle the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendStyle(final HtmlSerializerTextBuilder builder, + final HtmlStyle htmlStyle, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlNoScript}. + * + * @param builder the StringBuilder to add to + * @param htmlNoScript the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendNoScript(final HtmlSerializerTextBuilder builder, + final HtmlNoScript htmlNoScript, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlNoFrames}. + * + * @param builder the StringBuilder to add to + * @param htmlNoFrames the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendNoFrames(final HtmlSerializerTextBuilder builder, + final HtmlNoFrames htmlNoFrames, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlSubmitInput}. + * + * @param builder the StringBuilder to add to + * @param htmlSubmitInput the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendSubmitInput(final HtmlSerializerTextBuilder builder, + final HtmlSubmitInput htmlSubmitInput, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlInput}. + * + * @param builder the StringBuilder to add to + * @param htmlInput the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendInput(final HtmlSerializerTextBuilder builder, + final HtmlInput htmlInput, final Mode mode) { + builder.append(htmlInput.getValueAttribute(), mode); + } + + /** + * Process {@link HtmlResetInput}. + * + * @param builder the StringBuilder to add to + * @param htmlResetInput the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendResetInput(final HtmlSerializerTextBuilder builder, + final HtmlResetInput htmlResetInput, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlMenu}. + * @param builder the StringBuilder to add to + * @param htmlMenu the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendMenu(final HtmlSerializerTextBuilder builder, + final HtmlMenu htmlMenu, final Mode mode) { + builder.appendBlockSeparator(); + boolean first = true; + for (final DomNode item : htmlMenu.getChildren()) { + if (!first) { + builder.appendBlockSeparator(); + } + first = false; + appendNode(builder, item, mode); + } + builder.appendBlockSeparator(); + } + + /** + * Process {@link HtmlTitle}. + * @param builder the StringBuilder to add to + * @param htmlTitle the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendTitle(final HtmlSerializerTextBuilder builder, + final HtmlTitle htmlTitle, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlTableRow}. + * + * @param builder the StringBuilder to add to + * @param htmlTableRow the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendTableRow(final HtmlSerializerTextBuilder builder, + final HtmlTableRow htmlTableRow, final Mode mode) { + boolean first = true; + for (final HtmlTableCell cell : htmlTableRow.getCells()) { + if (!first) { + builder.appendBlank(); + } + else { + first = false; + } + appendChildren(builder, cell, mode); // trim? + } + } + + /** + * Process {@link HtmlTextArea}. + * + * @param builder the StringBuilder to add to + * @param htmlTextArea the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendTextArea(final HtmlSerializerTextBuilder builder, + final HtmlTextArea htmlTextArea, final Mode mode) { + if (isVisible(htmlTextArea)) { + builder.append(htmlTextArea.getDefaultValue(), whiteSpaceStyle(htmlTextArea, Mode.PRE)); + builder.trimRight(Mode.PRE); + } + } + + /** + * Process {@link HtmlTable}. + * + * @param builder the StringBuilder to add to + * @param htmlTable the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendTable(final HtmlSerializerTextBuilder builder, + final HtmlTable htmlTable, final Mode mode) { + builder.appendBlockSeparator(); + final String caption = htmlTable.getCaptionText(); + if (caption != null) { + builder.append(caption, mode); + builder.appendBlockSeparator(); + } + + boolean first = true; + + // first thead has to be displayed first and first tfoot has to be displayed last + final HtmlTableHeader tableHeader = htmlTable.getHeader(); + if (tableHeader != null) { + first = appendTableRows(builder, mode, tableHeader.getRows(), true, null, null); + } + final HtmlTableFooter tableFooter = htmlTable.getFooter(); + + final List tableRows = htmlTable.getRows(); + first = appendTableRows(builder, mode, tableRows, first, tableHeader, tableFooter); + + if (tableFooter != null) { + first = appendTableRows(builder, mode, tableFooter.getRows(), first, null, null); + } + else if (tableRows.isEmpty()) { + final DomNode firstChild = htmlTable.getFirstChild(); + if (firstChild != null) { + appendNode(builder, firstChild, mode); + } + } + + builder.appendBlockSeparator(); + } + + /** + * Process {@link HtmlTableRow}. + * + * @param builder the StringBuilder to add to + * @param mode the {@link Mode} to use for processing + * @param rows the rows + * @param first if true this is the first one + * @param skipParent1 skip row if the parent is this + * @param skipParent2 skip row if the parent is this + * @return true if this was the first one + */ + protected boolean appendTableRows(final HtmlSerializerTextBuilder builder, final Mode mode, + final List rows, boolean first, final TableRowGroup skipParent1, + final TableRowGroup skipParent2) { + for (final HtmlTableRow row : rows) { + if (row.getParentNode() == skipParent1 || row.getParentNode() == skipParent2) { + continue; + } + if (!first) { + builder.appendBlockSeparator(); + } + first = false; + appendTableRow(builder, row, mode); + } + return first; + } + + /** + * Process {@link HtmlSelect}. + * + * @param builder the StringBuilder to add to + * @param htmlSelect the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendSelect(final HtmlSerializerTextBuilder builder, + final HtmlSelect htmlSelect, final Mode mode) { + builder.appendBlockSeparator(); + boolean leadingNlPending = false; + final Mode selectMode = whiteSpaceStyle(htmlSelect, mode); + for (final DomNode item : htmlSelect.getChildren()) { + if (leadingNlPending) { + builder.appendBlockSeparator(); + leadingNlPending = false; + } + + builder.resetContentAdded(); + appendNode(builder, item, whiteSpaceStyle(item, selectMode)); + if (!leadingNlPending && builder.contentAdded_) { + leadingNlPending = true; + } + } + builder.appendBlockSeparator(); + } + + /** + * Process {@link HtmlSelect}. + * + * @param builder the StringBuilder to add to + * @param htmlOption the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendOption(final HtmlSerializerTextBuilder builder, + final HtmlOption htmlOption, final Mode mode) { + builder.ignoreHtmlBreaks(); + appendChildren(builder, htmlOption, mode); + builder.processHtmlBreaks(); + } + + /** + * Process {@link HtmlOrderedList}. + * + * @param builder the StringBuilder to add to + * @param htmlOrderedList the OL element + * @param mode the {@link Mode} to use for processing + */ + protected void appendOrderedList(final HtmlSerializerTextBuilder builder, + final HtmlOrderedList htmlOrderedList, final Mode mode) { + builder.appendBlockSeparator(); + boolean leadingNlPending = false; + final Mode olMode = whiteSpaceStyle(htmlOrderedList, mode); + for (final DomNode item : htmlOrderedList.getChildren()) { + if (leadingNlPending) { + builder.appendBlockSeparator(); + leadingNlPending = false; + } + + builder.resetContentAdded(); + appendNode(builder, item, whiteSpaceStyle(item, olMode)); + if (!leadingNlPending && builder.contentAdded_) { + leadingNlPending = true; + } + } + builder.appendBlockSeparator(); + } + + /** + * Process {@link HtmlUnorderedList}. + * @param builder the StringBuilder to add to + * @param htmlUnorderedList the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendUnorderedList(final HtmlSerializerTextBuilder builder, + final HtmlUnorderedList htmlUnorderedList, final Mode mode) { + builder.appendBlockSeparator(); + boolean leadingNlPending = false; + final Mode ulMode = whiteSpaceStyle(htmlUnorderedList, mode); + for (final DomNode item : htmlUnorderedList.getChildren()) { + if (leadingNlPending) { + builder.appendBlockSeparator(); + leadingNlPending = false; + } + + builder.resetContentAdded(); + appendNode(builder, item, whiteSpaceStyle(item, ulMode)); + if (!leadingNlPending && builder.contentAdded_) { + leadingNlPending = true; + } + } + builder.appendBlockSeparator(); + } + + /** + * Process {@link HtmlPreformattedText}. + * + * @param builder the StringBuilder to add to + * @param htmlPreformattedText the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendPreformattedText(final HtmlSerializerTextBuilder builder, + final HtmlPreformattedText htmlPreformattedText, final Mode mode) { + if (isVisible(htmlPreformattedText)) { + builder.appendBlockSeparator(); + appendChildren(builder, htmlPreformattedText, whiteSpaceStyle(htmlPreformattedText, Mode.PRE)); + builder.appendBlockSeparator(); + } + } + + /** + * Process {@link HtmlInlineFrame}. + * + * @param builder the StringBuilder to add to + * @param htmlInlineFrame the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendInlineFrame(final HtmlSerializerTextBuilder builder, + final HtmlInlineFrame htmlInlineFrame, final Mode mode) { + if (isVisible(htmlInlineFrame)) { + builder.appendBlockSeparator(); + final Page page = htmlInlineFrame.getEnclosedPage(); + if (page instanceof SgmlPage) { + builder.append(((SgmlPage) page).asText(), mode); + } + builder.appendBlockSeparator(); + } + } + + /** + * Process {@link DomText}. + * + * @param builder the StringBuilder to add to + * @param domText the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendText(final HtmlSerializerTextBuilder builder, final DomText domText, final Mode mode) { + final DomNode parent = domText.getParentNode(); + if (parent == null || parent instanceof HtmlTitle || isVisible(parent)) { + builder.append(domText.getData(), mode); + } + } + + /** + * Process {@link DomComment}. + * + * @param builder the StringBuilder to add to + * @param domComment the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendComment(final HtmlSerializerTextBuilder builder, + final DomComment domComment, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlApplet}. + * + * @param builder the StringBuilder to add to + * @param htmlApplet the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendApplet(final HtmlSerializerTextBuilder builder, + final HtmlApplet htmlApplet, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlBreak}. + * + * @param builder the StringBuilder to add to + * @param htmlBreak the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void appendBreak(final HtmlSerializerTextBuilder builder, + final HtmlBreak htmlBreak, final Mode mode) { + builder.appendBreak(mode); + } + + /** + * Process {@link HtmlCheckBoxInput}. + * + * @param builder the StringBuilder to add to + * @param htmlCheckBoxInput the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void doAppendCheckBoxInput(final HtmlSerializerTextBuilder builder, + final HtmlCheckBoxInput htmlCheckBoxInput, final Mode mode) { + // nothing to do + } + + /** + * Process {@link HtmlRadioButtonInput}. + * + * @param builder the StringBuilder to add to + * @param htmlRadioButtonInput the target to process + * @param mode the {@link Mode} to use for processing + */ + protected void doAppendRadioButtonInput(final HtmlSerializerTextBuilder builder, + final HtmlRadioButtonInput htmlRadioButtonInput, final Mode mode) { + // nothing to do + } + + private boolean isVisible(final DomNode node) { + return node.isDisplayed(); + } + + private Mode whiteSpaceStyle(final DomNode domNode, final Mode defaultMode) { + final Object scriptableObject = domNode.getScriptableObject(); + if (scriptableObject instanceof Node) { + final Page page = domNode.getPage(); + if (page != null && page.getEnclosingWindow().getWebClient().getOptions().isCssEnabled()) { + Node node = (Node) scriptableObject; + + while (node != null) { + if (node instanceof Element) { + final ComputedCSSStyleDeclaration style = node.getWindow().getComputedStyle(node, 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; + } + } + } + node = node.getParentElement(); + } + } + } + return defaultMode; + } + + protected static class HtmlSerializerTextBuilder { + /** Mode. */ + protected enum Mode { + /** + * The mode for the pre tag. + */ + PRE, + + /** + * Sequences of white space are collapsed. Newline characters + * in the source are handled the same as other white space. + * Lines are broken as necessary to fill line boxes. + */ + WHITE_SPACE_NORMAL, + + /** + * Sequences of white space are preserved. Lines are only broken + * at newline characters in the source and at
elements. + */ + WHITE_SPACE_PRE, + + /** + * Sequences of white space are collapsed. Lines are broken + * at newline characters, at
, and as necessary + * to fill line boxes. + */ + WHITE_SPACE_PRE_LINE + } + + private enum State { + DEFAULT, + EMPTY, + BLANK_AT_END, + BLANK_AT_END_AFTER_NEWLINE, + NEWLINE_AT_END, + BREAK_AT_END, + BLOCK_SEPARATOR_AT_END + } + + private State state_; + private final StringBuilder builder_; + private int trimRightPos_; + private boolean contentAdded_; + private boolean ignoreHtmlBreaks_; + + public HtmlSerializerTextBuilder() { + builder_ = new StringBuilder(); + state_ = State.EMPTY; + trimRightPos_ = 0; + } + + // see https://drafts.csswg.org/css-text-3/#white-space + public void append(final String content, final Mode mode) { + int length = content.length(); + if (length == 0) { + return; + } + + length--; + int i = -1; + for (char c : content.toCharArray()) { + i++; + + // handle \r + if (c == '\r') { + if (length != i) { + continue; + } + c = '\n'; + } + + if (c == '\n') { + if (mode == Mode.WHITE_SPACE_PRE) { + switch (state_) { + case EMPTY: + case BLOCK_SEPARATOR_AT_END: + break; + default: + builder_.append('\n'); + state_ = State.NEWLINE_AT_END; + trimRightPos_ = builder_.length(); + break; + } + continue; + } + + if (mode == Mode.PRE) { + builder_.append('\n'); + state_ = State.NEWLINE_AT_END; + trimRightPos_ = builder_.length(); + + continue; + } + + if (mode == Mode.WHITE_SPACE_PRE_LINE) { + switch (state_) { + case EMPTY: + case BLOCK_SEPARATOR_AT_END: + break; + default: + builder_.append('\n'); + state_ = State.NEWLINE_AT_END; + trimRightPos_ = builder_.length(); + break; + } + continue; + } + + switch (state_) { + case EMPTY: + case BLANK_AT_END: + case BLANK_AT_END_AFTER_NEWLINE: + case BLOCK_SEPARATOR_AT_END: + case NEWLINE_AT_END: + case BREAK_AT_END: + break; + default: + builder_.append(' '); + state_ = State.BLANK_AT_END; + break; + } + continue; + } + + if (c == ' ' || c == '\t' || c == '\f') { + if (mode == Mode.WHITE_SPACE_PRE || mode == Mode.PRE) { + appendBlank(); + continue; + } + + if (mode == Mode.WHITE_SPACE_PRE_LINE) { + switch (state_) { + case EMPTY: + case BLANK_AT_END: + case BLANK_AT_END_AFTER_NEWLINE: + case BREAK_AT_END: + break; + default: + builder_.append(' '); + state_ = State.BLANK_AT_END; + break; + } + continue; + } + + switch (state_) { + case EMPTY: + case BLANK_AT_END: + case BLANK_AT_END_AFTER_NEWLINE: + case BLOCK_SEPARATOR_AT_END: + case NEWLINE_AT_END: + case BREAK_AT_END: + break; + default: + builder_.append(' '); + state_ = State.BLANK_AT_END; + break; + } + continue; + } + + if (c == (char) 160) { + appendBlank(); + if (mode == Mode.WHITE_SPACE_NORMAL || mode == Mode.WHITE_SPACE_PRE_LINE) { + state_ = State.DEFAULT; + } + continue; + } + builder_.append(c); + state_ = State.DEFAULT; + trimRightPos_ = builder_.length(); + contentAdded_ = true; + } + } + + public void appendBlockSeparator() { + switch (state_) { + case EMPTY: + break; + case BLANK_AT_END: + builder_.setLength(trimRightPos_); + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + else { + builder_.append('\n'); + state_ = State.BLOCK_SEPARATOR_AT_END; + } + break; + case BLANK_AT_END_AFTER_NEWLINE: + builder_.setLength(trimRightPos_ - 1); + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + else { + builder_.append('\n'); + state_ = State.BLOCK_SEPARATOR_AT_END; + } + break; + case BLOCK_SEPARATOR_AT_END: + break; + case NEWLINE_AT_END: + case BREAK_AT_END: + builder_.setLength(builder_.length() - 1); + trimRightPos_ = trimRightPos_ - 1; + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + else { + builder_.append('\n'); + state_ = State.BLOCK_SEPARATOR_AT_END; + } + break; + default: + builder_.append('\n'); + state_ = State.BLOCK_SEPARATOR_AT_END; + break; + } + } + + public void appendBreak(final Mode mode) { + if (ignoreHtmlBreaks_) { + return; + } + + builder_.setLength(trimRightPos_); + + builder_.append('\n'); + state_ = State.BREAK_AT_END; + trimRightPos_ = builder_.length(); + } + + public void appendBlank() { + builder_.append(' '); + state_ = State.BLANK_AT_END; + trimRightPos_ = builder_.length(); + } + + public void trimRight(final Mode mode) { + if (mode == Mode.PRE) { + switch (state_) { + case BLOCK_SEPARATOR_AT_END: + case NEWLINE_AT_END: + case BREAK_AT_END: + if (trimRightPos_ == builder_.length()) { + trimRightPos_--; + } + break; + default: + break; + } + } + + builder_.setLength(trimRightPos_); + state_ = State.DEFAULT; + if (builder_.length() == 0) { + state_ = State.EMPTY; + } + } + + public boolean wasContentAdded() { + return contentAdded_; + } + + public void resetContentAdded() { + contentAdded_ = false; + } + + public void ignoreHtmlBreaks() { + ignoreHtmlBreaks_ = true; + } + + public void processHtmlBreaks() { + ignoreHtmlBreaks_ = false; + } + + public String getText() { + return builder_.substring(0, trimRightPos_); + } + } +} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSlot.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSlot.java index f1ce8affc37..1a3a11ebd8c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSlot.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSmall.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSmall.java index d4b1d100a65..812a4bdfed2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSmall.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSmall.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSource.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSource.java index 46d970df457..190eb026484 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSource.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSpan.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSpan.java index b57a212656e..8f41b65c34f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSpan.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSpan.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrike.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrike.java index 126aafdfbac..baf21ddbf5b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrike.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrike.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrong.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrong.java index c09391678a7..621702bb068 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrong.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStrong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStyle.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStyle.java index 0dea1089449..01f5b79ad65 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStyle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubmitInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubmitInput.java index 15c28b8b7ac..65fdab9bf55 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubmitInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubmitInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,6 +94,14 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK return false; } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} This method does nothing for submit input elements. * @see SubmittableElement#reset() diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubscript.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubscript.java index e5d5978da27..f9954bf48e4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubscript.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSubscript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSummary.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSummary.java index f1d4c14248a..4bfe775535b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSummary.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSuperscript.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSuperscript.java index 3e4022a91d8..915d1c0d8b4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSuperscript.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSuperscript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSvg.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSvg.java index cb857423bb7..98cc7c82f22 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSvg.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlSvg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,6 @@ public class HtmlSvg extends HtmlElement { */ HtmlSvg(final String qualifiedName, final SgmlPage page, final Map attributes) { - super(HTMLParser.SVG_NAMESPACE, qualifiedName, page, attributes); + super(Html.SVG_NAMESPACE, qualifiedName, page, attributes); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTable.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTable.java index 3bfe8ac55b1..de785784555 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTable.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,7 +139,7 @@ public HtmlTableRow getRow(final int index) throws IndexOutOfBoundsException { } count++; } - throw new IndexOutOfBoundsException(); + throw new IndexOutOfBoundsException("No row found for index " + index + "."); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableBody.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableBody.java index ca20a3fafda..8852759e2d6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableBody.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableCell.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableCell.java index 58f75ab64c6..d701058a0e9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableCell.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableCell.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumn.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumn.java index 8f06009300a..872d748faba 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumn.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumnGroup.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumnGroup.java index f5264dba9f4..9dbd1026f3f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumnGroup.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableColumnGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableDataCell.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableDataCell.java index e70fc210eb5..9a60620f61a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableDataCell.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableDataCell.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableFooter.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableFooter.java index 921aa1b136d..6aa67528734 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableFooter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableFooter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeader.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeader.java index 1d78d2fb0f8..4dde5398f1d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeaderCell.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeaderCell.java index 2088671b6e3..77cf0a496c4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeaderCell.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableHeaderCell.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableRow.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableRow.java index 8c76fa28283..6cb469f20b5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableRow.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTableRow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,7 @@ public HtmlTableCell getCell(final int index) throws IndexOutOfBoundsException { } count++; } - throw new IndexOutOfBoundsException(); + throw new IndexOutOfBoundsException("No cell found for index " + index + "."); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java index e0eb9794ea6..c6f6d6da8af 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTelInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,14 @@ public class HtmlTelInput extends HtmlInput implements SelectableTextInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @@ -111,10 +119,7 @@ public String getText() { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); } @@ -122,10 +127,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); } @@ -150,4 +152,14 @@ public DomNode cloneNode(final boolean deep) { return newnode; } + + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTeletype.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTeletype.java index 1fea88d46b1..e5c15b27069 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTeletype.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTeletype.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTemplate.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTemplate.java index bc27dba19b5..35f5a28934e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTemplate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ public DomDocumentFragment getContent() { * Parsing of the children is done, we can move our children to the content. */ @Override - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { while (getFirstChild() != null) { final DomNode child = getFirstChild(); child.basicRemove(); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java index 384dcdc9024..90a15bd7551 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -463,10 +463,7 @@ protected void printXml(final String indent, final PrintWriter printWriter) { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getText().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getText(), selectionDelegate_, c, this, lastType); } @@ -474,10 +471,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getText().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getText(), selectionDelegate_, keyCode, this, lastType); } @@ -512,7 +506,7 @@ public void focus() { @Override public void removeFocus() { super.removeFocus(); - if (!valueAtFocus_.equals(getText())) { + if (valueAtFocus_ != null && !valueAtFocus_.equals(getText())) { HtmlInput.executeOnChangeHandlerIfAppropriate(this); } valueAtFocus_ = null; @@ -540,14 +534,6 @@ public boolean isReadOnly() { return hasAttribute("readOnly"); } - /** - * {@inheritDoc} - */ - @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlTextArea(getQualifiedName(), getPage(), getAttributesMap()); - } - /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java index abd993fc638..58c6ec82de6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTextInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,10 +55,7 @@ public class HtmlTextInput extends HtmlInput implements SelectableTextInput { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); } @@ -66,10 +63,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); } @@ -180,17 +174,27 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN * {@inheritDoc} */ @Override - protected Object clone() throws CloneNotSupportedException { - return new HtmlTextInput(getQualifiedName(), getPage(), getAttributesMap()); + public void setDefaultValue(final String defaultValue) { + final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); + setDefaultValue(defaultValue, modifyValue); } /** * {@inheritDoc} */ @Override - public void setDefaultValue(final String defaultValue) { - final boolean modifyValue = getValueAttribute().equals(getDefaultValue()); - setDefaultValue(defaultValue, modifyValue); + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTime.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTime.java index 82c1d4c5c5c..0b2771a4cd0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTime.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java index 0500ca1bebc..6e306b23ef0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTimeInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,14 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.Map; import com.gargoylesoftware.htmlunit.SgmlPage; +import org.apache.commons.lang3.StringUtils; /** * Wrapper for the HTML element "input" where type is "time". @@ -43,13 +44,22 @@ public class HtmlTimeInput extends HtmlInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && StringUtils.isNotEmpty(newValue)) { FORMATTER_.parse(newValue); } super.setValueAttribute(newValue); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTitle.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTitle.java index fb8ca73057c..b2b9fdc9448 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTitle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTrack.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTrack.java index c8f20afc9c5..366aa22fd87 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTrack.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnderlined.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnderlined.java index 1a6aadb7d4a..8e0f6e365aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnderlined.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnderlined.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnknownElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnknownElement.java index 75bfbe5e048..1367750804d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnknownElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnknownElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,12 @@ */ package com.gargoylesoftware.htmlunit.html; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_DIALOG_NONE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_RP_DISPLAY_NONE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_RT_DISPLAY_RUBY_TEXT_ALWAYS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_RUBY_DISPLAY_INLINE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.MULTICOL_BLOCK; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.SLOT_CONTENTS; import java.util.Map; @@ -98,18 +100,26 @@ public DisplayStyle getDefaultStyleDisplay() { } break; case HtmlRt.TAG_NAME: - if (wasCreatedByJavascript() && getParentNode() == null) { + if (!hasFeature(CSS_RT_DISPLAY_RUBY_TEXT_ALWAYS) + && wasCreatedByJavascript() && getParentNode() == null) { return DisplayStyle.BLOCK; } - if (hasFeature(CSS_RT_DISPLAY_RUBY_TEXT_ALWAYS)) { - return DisplayStyle.RUBY_TEXT; - } - break; + return DisplayStyle.RUBY_TEXT; case HtmlMultiColumn.TAG_NAME: if (hasFeature(MULTICOL_BLOCK)) { return DisplayStyle.BLOCK; } break; + case HtmlDialog.TAG_NAME: + if (hasFeature(CSS_DIALOG_NONE)) { + return DisplayStyle.NONE; + } + break; + case HtmlSlot.TAG_NAME: + if (getPage().getWebClient().getBrowserVersion().hasFeature(SLOT_CONTENTS)) { + return DisplayStyle.CONTENTS; + } + break; default: } return DisplayStyle.INLINE; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnorderedList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnorderedList.java index 07694a51e66..1f67a67148f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnorderedList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUnorderedList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java index 9b0a6ed5e16..ea2d8250aea 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlUrlInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,14 @@ public class HtmlUrlInput extends HtmlInput implements SelectableTextInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @@ -126,10 +134,7 @@ public String getText() { * {@inheritDoc} */ @Override - protected void doType(final char c, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final char c, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, c, this, lastType); } @@ -137,10 +142,7 @@ protected void doType(final char c, final boolean startAtEnd, final boolean last * {@inheritDoc} */ @Override - protected void doType(final int keyCode, final boolean startAtEnd, final boolean lastType) { - if (startAtEnd) { - selectionDelegate_.setSelectionStart(getValueAttribute().length()); - } + protected void doType(final int keyCode, final boolean lastType) { doTypeProcessor_.doType(getValueAttribute(), selectionDelegate_, keyCode, this, lastType); } @@ -154,6 +156,16 @@ protected void typeDone(final String newValue, final boolean notifyAttributeChan } } + /** + * {@inheritDoc} + * @see HtmlInput#reset() + */ + @Override + public void reset() { + super.reset(); + setSelectionEnd(0); + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVariable.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVariable.java index 26bd90200e9..dea0cfa8a95 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVariable.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVariable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVideo.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVideo.java index ef8ee51e547..5e4f95ecb2d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVideo.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlVideo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java index c3d197409fb..feb44dc6659 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWeekInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,15 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.Map; +import org.apache.commons.lang3.StringUtils; + import com.gargoylesoftware.htmlunit.SgmlPage; /** @@ -43,15 +46,28 @@ public class HtmlWeekInput extends HtmlInput { super(qualifiedName, page, attributes); } + /** + * {@inheritDoc} + */ + @Override + public void setDefaultChecked(final boolean defaultChecked) { + // Empty. + } + /** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { + if (!hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + || hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED) + || StringUtils.isEmpty(newValue)) { + super.setValueAttribute(newValue); + return; + } + try { - if (hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { - FORMATTER_.parse(newValue); - } + FORMATTER_.parse(newValue); super.setValueAttribute(newValue); } catch (final DateTimeParseException e) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWordBreak.java b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWordBreak.java index 3956c0a9927..9454c7eceb7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWordBreak.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/HtmlWordBreak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/InputElementFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/html/InputElementFactory.java deleted file mode 100644 index c0ec946af26..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/InputElementFactory.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.html; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.xml.sax.Attributes; - -import com.gargoylesoftware.htmlunit.SgmlPage; - -/** - * A specialized creator that knows how to create input objects. - * - * @author Christian Sell - * @author Marc Guillemot - * @author Ahmed Ashour - * @author David K. Taylor - * @author Dmitri Zoubkov - * @author Frank Danek - */ -public final class InputElementFactory implements ElementFactory { - - /** Logging support. */ - private static final Log LOG = LogFactory.getLog(InputElementFactory.class); - - /** The singleton instance. */ - public static final InputElementFactory instance = new InputElementFactory(); - - /** Private singleton constructor. */ - private InputElementFactory() { - // Empty. - } - - /** - * Creates an HtmlElement for the specified xmlElement, contained in the specified page. - * - * @param page the page that this element will belong to - * @param tagName the HTML tag name - * @param attributes the SAX attributes - * - * @return a new HtmlInput element - */ - @Override - public HtmlElement createElement( - final SgmlPage page, final String tagName, - final Attributes attributes) { - return createElementNS(page, null, tagName, attributes); - } - - /** - * {@inheritDoc} - */ - @Override - public HtmlElement createElementNS(final SgmlPage page, final String namespaceURI, - final String qualifiedName, final Attributes attributes) { - return createElementNS(page, namespaceURI, qualifiedName, attributes, false); - } - - /** - * {@inheritDoc} - */ - @Override - public HtmlElement createElementNS(final SgmlPage page, final String namespaceURI, - final String qualifiedName, final Attributes attributes, final boolean asdf) { - - Map attributeMap = DefaultElementFactory.toMap(page, attributes); - if (attributeMap == null) { - attributeMap = new HashMap<>(); - } - - String type = null; - for (final Map.Entry entry : attributeMap.entrySet()) { - if ("type".equalsIgnoreCase(entry.getKey())) { - type = entry.getValue().getValue(); - } - } - if (type == null) { - type = ""; - } - - final HtmlInput result; - switch (type.toLowerCase(Locale.ROOT)) { - case "": - // This not an illegal value, as it defaults to "text" - // cf http://www.w3.org/TR/REC-html40/interact/forms.html#adef-type-INPUT - // and the common browsers seem to treat it as a "text" input so we will as well. - case "text": - result = new HtmlTextInput(qualifiedName, page, attributeMap); - break; - - case "submit": - result = new HtmlSubmitInput(qualifiedName, page, attributeMap); - break; - - case "checkbox": - result = new HtmlCheckBoxInput(qualifiedName, page, attributeMap); - break; - - case "radio": - result = new HtmlRadioButtonInput(qualifiedName, page, attributeMap); - break; - - case "hidden": - result = new HtmlHiddenInput(qualifiedName, page, attributeMap); - break; - - case "password": - result = new HtmlPasswordInput(qualifiedName, page, attributeMap); - break; - - case "image": - result = new HtmlImageInput(qualifiedName, page, attributeMap); - break; - - case "reset": - result = new HtmlResetInput(qualifiedName, page, attributeMap); - break; - - case "button": - result = new HtmlButtonInput(qualifiedName, page, attributeMap); - break; - - case "file": - result = new HtmlFileInput(qualifiedName, page, attributeMap); - break; - - case "color": - result = new HtmlColorInput(qualifiedName, page, attributeMap); - break; - - case "date": - result = new HtmlDateInput(qualifiedName, page, attributeMap); - break; - - case "datetime-local": - result = new HtmlDateTimeLocalInput(qualifiedName, page, attributeMap); - break; - - case "email": - result = new HtmlEmailInput(qualifiedName, page, attributeMap); - break; - - case "month": - result = new HtmlMonthInput(qualifiedName, page, attributeMap); - break; - - case "number": - result = new HtmlNumberInput(qualifiedName, page, attributeMap); - break; - - case "range": - result = new HtmlRangeInput(qualifiedName, page, attributeMap); - break; - - case "search": - result = new HtmlSearchInput(qualifiedName, page, attributeMap); - break; - - case "tel": - result = new HtmlTelInput(qualifiedName, page, attributeMap); - break; - - case "time": - result = new HtmlTimeInput(qualifiedName, page, attributeMap); - break; - - case "url": - result = new HtmlUrlInput(qualifiedName, page, attributeMap); - break; - - case "week": - result = new HtmlWeekInput(qualifiedName, page, attributeMap); - break; - - default: - LOG.info("Bad input type: \"" + type + "\", creating a text input"); - result = new HtmlTextInput(qualifiedName, page, attributeMap); - break; - } - return result; - } - - /** - * Returns whether the specified type is supported or not. - * @param type the type - * @return whether the specified type is supported or not - */ - public static boolean isSupported(final String type) { - boolean supported = false; - switch (type) { - case "text": - case "submit": - case "checkbox": - case "radio": - case "hidden": - case "password": - case "image": - case "reset": - case "button": - case "file": - case "color": - case "date": - case "datetime-local": - case "email": - case "month": - case "number": - case "range": - case "search": - case "tel": - case "time": - case "url": - case "week": - supported = true; - break; - - default: - } - return supported; - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/Keyboard.java b/src/main/java/com/gargoylesoftware/htmlunit/html/Keyboard.java index 436c0f4e088..cced05ea5f3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/Keyboard.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/Keyboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElement.java index 38858a91a77..de65105fe44 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import java.nio.charset.Charset; - /** * An element which can handle scripts. * @@ -54,14 +52,4 @@ public interface ScriptElement { * or an empty string if that attribute isn't defined. */ String getCharsetAttribute(); - - /** - * Returns the {@link Charset}. - * - * @return the {@link Charset} - * @deprecated as of 2.27, not used - */ - @Deprecated - Charset getCharset(); - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java b/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java index 24d55c3c6b8..2e56e74ddde 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/ScriptElementSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,14 +38,18 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.protocol.javascript.JavaScriptURLConnection; import com.gargoylesoftware.htmlunit.util.EncodingSniffer; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.xml.XmlPage; import net.sourceforge.htmlunit.corejs.javascript.BaseFunction; /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * A helper class to be used by elements which support {@link ScriptElement}. * * @author Ahmed Ashour + * @author Ronald Brill */ public final class ScriptElementSupport { @@ -145,7 +149,7 @@ public static void executeScriptIfNeeded(final DomElement element) { charset = page.getCharset(); } final JavaScriptLoadResult result = page.loadExternalJavaScriptFile(src, charset); - if (result == JavaScriptLoadResult.SUCCESS) { + if (result == JavaScriptLoadResult.SUCCESS || result == JavaScriptLoadResult.NO_CONTENT) { executeEvent(element, Event.TYPE_LOAD); } else if (result == JavaScriptLoadResult.DOWNLOAD_ERROR) { @@ -185,7 +189,7 @@ private static boolean isExecutionNeeded(final DomElement element) { // If JavaScript is disabled, we don't need to execute. final SgmlPage page = element.getPage(); - if (!page.getWebClient().getOptions().isJavaScriptEnabled()) { + if (!page.getWebClient().isJavaScriptEnabled()) { return false; } @@ -212,7 +216,7 @@ private static boolean isExecutionNeeded(final DomElement element) { final String t = element.getAttributeDirect("type"); final String l = element.getAttributeDirect("language"); if (!isJavaScript(element, t, l)) { - LOG.warn("Script is not JavaScript (type: " + t + ", language: " + l + "). Skipping execution."); + LOG.warn("Script is not JavaScript (type: '" + t + "', language: '" + l + "'). Skipping execution."); return false; } @@ -225,7 +229,7 @@ private static boolean isExecutionNeeded(final DomElement element) { /** * Returns true if a script with the specified type and language attributes is actually JavaScript. * According to W3C recommendation - * are content types case insensitive. + * are content types case insensitive.
* IE supports only a limited number of values for the type attribute. For testing you can * use http://www.robinlionheart.com/stds/html4/scripts. * @param element the element @@ -233,7 +237,7 @@ private static boolean isExecutionNeeded(final DomElement element) { * @param languageAttribute the language attribute specified in the script tag * @return true if the script is JavaScript */ - static boolean isJavaScript(final DomElement element, String typeAttribute, final String languageAttribute) { + public static boolean isJavaScript(final DomElement element, String typeAttribute, final String languageAttribute) { final BrowserVersion browserVersion = element.getPage().getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(HTMLSCRIPT_TRIM_TYPE)) { @@ -246,7 +250,7 @@ static boolean isJavaScript(final DomElement element, String typeAttribute, fina return true; } - if ("application/javascript".equalsIgnoreCase(typeAttribute) + if (MimeType.APPLICATION_JAVASCRIPT.equalsIgnoreCase(typeAttribute) || "application/ecmascript".equalsIgnoreCase(typeAttribute) || "application/x-javascript".equalsIgnoreCase(typeAttribute)) { return true; @@ -289,7 +293,7 @@ private static void executeInlineScriptIfNeeded(final DomElement element) { final String scriptCode = getScriptCode(element); if (event != ATTRIBUTE_NOT_DEFINED && forr != ATTRIBUTE_NOT_DEFINED) { if (element.hasFeature(JS_SCRIPT_SUPPORTS_FOR_AND_EVENT_WINDOW) && "window".equals(forr)) { - final Window window = (Window) element.getPage().getEnclosingWindow().getScriptableObject(); + final Window window = element.getPage().getEnclosingWindow().getScriptableObject(); final BaseFunction function = new EventHandler(element, event, scriptCode); window.getEventListenersContainer().addEventListener(StringUtils.substring(event, 2), function, false); return; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/SiblingDomNodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/SiblingDomNodeList.java index f139cb61d74..91de0661abf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/SiblingDomNodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/SiblingDomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/StaticDomNodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/html/StaticDomNodeList.java index c9aa4b4ac98..6cb6483434e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/StaticDomNodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/StaticDomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/SubmittableElement.java b/src/main/java/com/gargoylesoftware/htmlunit/html/SubmittableElement.java index 64e20bab598..e208ae99d99 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/SubmittableElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/SubmittableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,6 +56,12 @@ public interface SubmittableElement { /** * Sets the default checked state to use when this element gets reset, if applicable. + * The default implementation is empty; only checkboxes and radio buttons + * really care what the default checked value is. + * @see SubmittableElement#setDefaultChecked(boolean) + * @see HtmlRadioButtonInput#setDefaultChecked(boolean) + * @see HtmlCheckBoxInput#setDefaultChecked(boolean) + * * @param defaultChecked the default checked state to use when this element gets reset, if applicable */ void setDefaultChecked(boolean defaultChecked); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/TableRowGroup.java b/src/main/java/com/gargoylesoftware/htmlunit/html/TableRowGroup.java index a808368dc8c..676f9011a82 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/TableRowGroup.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/TableRowGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/UnknownElementFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/html/UnknownElementFactory.java index 502729514b8..1ac90078f9e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/UnknownElementFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/UnknownElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/XHtmlPage.java b/src/main/java/com/gargoylesoftware/htmlunit/html/XHtmlPage.java index eccd779e058..539b71a37d3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/XHtmlPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/XHtmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/XmlSerializer.java b/src/main/java/com/gargoylesoftware/htmlunit/html/XmlSerializer.java index 437d0a1f683..db442bef814 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/XmlSerializer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/XmlSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,12 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.URL; import java.nio.charset.Charset; +import java.nio.file.Files; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; @@ -29,6 +30,8 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.SgmlPage; @@ -46,6 +49,8 @@ class XmlSerializer { private static final String FILE_SEPARATOR = "/"; private static final Pattern CREATE_FILE_PATTERN = Pattern.compile(".*/"); + private static final Log LOG = LogFactory.getLog(XmlSerializer.class); + private final StringBuilder builder_ = new StringBuilder(); private final StringBuilder indent_ = new StringBuilder(); private File outputDir_; @@ -61,7 +66,23 @@ public void save(final SgmlPage page, final File file) throws IOException { } fileName = fileName.substring(0, fileName.lastIndexOf('.')); outputDir_ = new File(file.getParentFile(), fileName); - FileUtils.writeStringToFile(outputFile, asXml(page.getDocumentElement()), ISO_8859_1); + + // don't use asXml here because we have to sync the encoding from the + // header with the one used by the writer + final DomElement node = page.getDocumentElement(); + Charset charsetName = ISO_8859_1; + builder_.setLength(0); + indent_.setLength(0); + if (page.isHtmlPage()) { + charsetName = page.getCharset(); + if (charsetName != null && node instanceof HtmlHtml) { + builder_.append("").append('\n'); + } + } + printXml(node); + final String response = builder_.toString(); + builder_.setLength(0); + FileUtils.writeStringToFile(outputFile, response, charsetName); } /** @@ -95,7 +116,7 @@ protected void printXml(final DomElement node) throws IOException { builder_.append("/>").append('\n'); } else { - builder_.append(">").append('\n'); + builder_.append('>').append('\n'); for (DomNode child = node.getFirstChild(); child != null; child = child.getNextSibling()) { indent_.append(" "); if (child instanceof DomElement) { @@ -153,7 +174,7 @@ protected void printOpeningTag(final DomElement node) throws IOException { final Map attributes = readAttributes(node); for (final Map.Entry entry : attributes.entrySet()) { - builder_.append(" "); + builder_.append(' '); builder_.append(entry.getKey()); builder_.append("=\""); final String value = entry.getValue().getNodeValue(); @@ -190,8 +211,8 @@ else if (node instanceof BaseFrameElement) { } private Map getAttributesFor(final BaseFrameElement frame) throws IOException { - final Map map = createAttributesCopyWithClonedAttribute(frame, "src"); - final DomAttr srcAttr = map.get("src"); + final Map map = createAttributesCopyWithClonedAttribute(frame, DomElement.SRC_ATTRIBUTE); + final DomAttr srcAttr = map.get(DomElement.SRC_ATTRIBUTE); if (srcAttr == null) { return map; } @@ -208,7 +229,7 @@ private Map getAttributesFor(final BaseFrameElement frame) thro } else { try (InputStream is = enclosedPage.getWebResponse().getContentAsStream()) { - try (FileOutputStream fos = new FileOutputStream(file)) { + try (OutputStream fos = Files.newOutputStream(file.toPath())) { IOUtils.copyLarge(is, fos); } } @@ -240,28 +261,50 @@ protected Map getAttributesFor(final HtmlLink link) throws IOEx if (hrefAttr != null && StringUtils.isNotBlank(hrefAttr.getValue())) { final String protocol = link.getWebRequest().getUrl().getProtocol(); if ("http".equals(protocol) || "https".equals(protocol)) { - final File file = createFile(hrefAttr.getValue(), ".css"); - FileUtils.writeStringToFile(file, link.getWebResponse(true, null).getContentAsString(), ISO_8859_1); - hrefAttr.setValue(outputDir_.getName() + FILE_SEPARATOR + file.getName()); + try { + final WebResponse response = link.getWebResponse(true, null); + + final File file = createFile(hrefAttr.getValue(), ".css"); + FileUtils.writeStringToFile(file, response.getContentAsString(), ISO_8859_1); + hrefAttr.setValue(outputDir_.getName() + FILE_SEPARATOR + file.getName()); + } + catch (final IOException e) { + LOG.error("XmlSerializer: IOException while downloading link content from url '" + + hrefAttr + "'", e); + } + catch (final IllegalStateException e) { + LOG.error("XmlSerializer: IllegalStateException while downloading link content from url '" + + hrefAttr + "'", e); + } } } return map; } - protected Map getAttributesFor(final HtmlImage image) throws IOException { - final Map map = createAttributesCopyWithClonedAttribute(image, "src"); - final DomAttr srcAttr = map.get("src"); + protected Map getAttributesFor(final HtmlImage image) { + final Map map = createAttributesCopyWithClonedAttribute(image, DomElement.SRC_ATTRIBUTE); + final DomAttr srcAttr = map.get(DomElement.SRC_ATTRIBUTE); if (srcAttr != null && StringUtils.isNotBlank(srcAttr.getValue())) { - final WebResponse response = image.getWebResponse(true); + try { + final WebResponse response = image.getWebResponse(true); - final File file = createFile(srcAttr.getValue(), "." + getSuffix(response)); - try (InputStream inputStream = response.getContentAsStream()) { - FileUtils.copyInputStreamToFile(inputStream, file); - } + try (InputStream inputStream = response.getContentAsStream()) { + final File file = createFile(srcAttr.getValue(), "." + getSuffix(response)); + FileUtils.copyInputStreamToFile(inputStream, file); - final String valueOnFileSystem = outputDir_.getName() + FILE_SEPARATOR + file.getName(); - srcAttr.setValue(valueOnFileSystem); // this is the clone attribute node, not the original one of the page + final String valueOnFileSystem = outputDir_.getName() + FILE_SEPARATOR + file.getName(); + // this is the clone attribute node, not the original one of the page + srcAttr.setValue(valueOnFileSystem); + } + } + catch (final IOException e) { + LOG.error("XmlSerializer: IOException while downloading image content from url '" + srcAttr + "'", e); + } + catch (final IllegalStateException e) { + LOG.error("XmlSerializer: IllegalStateException while downloading image content from url '" + + srcAttr + "'", e); + } } return map; @@ -330,7 +373,7 @@ private File createFile(final String url, final String extension) throws IOExcep else { fileName = name; } - outputDir_.mkdirs(); + FileUtils.forceMkdir(outputDir_); final File f = new File(outputDir_, fileName); if (f.createNewFile()) { return f; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletClassLoader.java b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletClassLoader.java index 6823ffe2516..798efea46ed 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletClassLoader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class AppletClassLoader extends URLClassLoader { private static final Log LOG = LogFactory.getLog(AppletClassLoader.class); - private final StringBuilder info_ = new StringBuilder(); + private final StringBuilder info_ = new StringBuilder(40); /** * The constructor. @@ -49,9 +49,11 @@ public AppletClassLoader(final Window window, final ClassLoader parent) { super(new URL[0], parent); if (window.getWebWindow().getWebClient().getOptions().isUseInsecureSSL()) { - LOG.warn("AppletClassLoader: your WebClient accepts ssl connections without certificate checking." - + " If you like to load applet archives from a SSL/HTTPS connection you have to configure" - + " your jvm to accept untrusted certificate for SSL/HTTPS connections also."); + if (LOG.isWarnEnabled()) { + LOG.warn("AppletClassLoader: your WebClient accepts ssl connections without certificate checking." + + " If you like to load applet archives from a SSL/HTTPS connection you have to configure" + + " your jvm to accept untrusted certificate for SSL/HTTPS connections also."); + } } try { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletContextImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletContextImpl.java index 31df3142cf8..c61edcd3ca0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletContextImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import java.util.Enumeration; import java.util.Iterator; +import com.gargoylesoftware.htmlunit.NotYetImplementedException; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.host.Window; @@ -63,7 +64,7 @@ public Enumeration getApplets() { */ @Override public AudioClip getAudioClip(final URL url) { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.getAudioClip(URL)"); } /** @@ -71,7 +72,7 @@ public AudioClip getAudioClip(final URL url) { */ @Override public Image getImage(final URL url) { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.getImage(URL)"); } /** @@ -79,7 +80,7 @@ public Image getImage(final URL url) { */ @Override public InputStream getStream(final String key) { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.getStream(String)"); } /** @@ -87,7 +88,7 @@ public InputStream getStream(final String key) { */ @Override public Iterator getStreamKeys() { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.getStreamKeys()"); } /** @@ -95,7 +96,7 @@ public Iterator getStreamKeys() { */ @Override public void setStream(final String key, final InputStream stream) throws IOException { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.setStream(String, InputStream)"); } /** @@ -103,7 +104,7 @@ public void setStream(final String key, final InputStream stream) throws IOExcep */ @Override public void showDocument(final URL url) { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.showDocument(URL)"); } /** @@ -111,7 +112,7 @@ public void showDocument(final URL url) { */ @Override public void showDocument(final URL url, final String target) { - throw new RuntimeException("Not yet implemented!"); + throw new NotYetImplementedException("AppletContextImpl.showDocument(URL, String)"); } /** @@ -121,7 +122,7 @@ public void showDocument(final URL url, final String target) { public void showStatus(final String status) { // perhaps should we move status handling to WebWindow // on the other side this allows "orphaned" pages to be usable - final Window window = (Window) htmlPage_.getEnclosingWindow().getScriptableObject(); + final Window window = htmlPage_.getEnclosingWindow().getScriptableObject(); window.setStatus(status); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletStubImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletStubImpl.java index d5abdf0b28e..96289ee66ec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletStubImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/AppletStubImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import java.net.URL; import java.util.HashMap; +import com.gargoylesoftware.htmlunit.NotYetImplementedException; import com.gargoylesoftware.htmlunit.html.HtmlPage; /** @@ -94,7 +95,6 @@ public String getParameter(final String name) { */ @Override public boolean isActive() { - throw new RuntimeException( - "Not yet implemented! (com.gargoylesoftware.htmlunit.html.applets.AppletStubImpl.isActive())"); + throw new NotYetImplementedException("AppletStubImpl.isActive()"); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/package-info.java index 9fc797a043b..d2d24a02c29 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/applets/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/applets/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextInput.java b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextInput.java index deabe0082c2..0c308632e6c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java index 4bd825d4099..6dc2ca732d1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectableTextSelectionDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectionDelegate.java b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectionDelegate.java index 371b448722d..3f0b7ccff2f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectionDelegate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SelectionDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleRange.java b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleRange.java index 5b60cb04f35..7ab7533c422 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleRange.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleRange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleSelectionDelegate.java b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleSelectionDelegate.java index 511a0c255a5..0136c53a704 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleSelectionDelegate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/SimpleSelectionDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/package-info.java index 614c141ba21..f94c31daf30 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/impl/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/impl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/html/package-info.java index 807778a4a6e..fed8ee43b94 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParser.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParser.java new file mode 100644 index 00000000000..a7076f89373 --- /dev/null +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParser.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html.parser; + +import java.io.IOException; + +import org.xml.sax.SAXException; + +import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.WebWindow; +import com.gargoylesoftware.htmlunit.html.DomNode; +import com.gargoylesoftware.htmlunit.html.ElementFactory; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.XHtmlPage; + +/** + *

Interface for the parser used to parse HTML into a HtmlUnit-specific DOM (HU-DOM) tree.

+ * + * @author Christian Sell + * @author David K. Taylor + * @author Chris Erskine + * @author Ahmed Ashour + * @author Marc Guillemot + * @author Ethan Glasser-Camp + * @author Sudhan Moghe + * @author Ronald Brill + * @author Frank Danek + * @author Carsten Steul + */ +public interface HTMLParser { + + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * @param tagName an HTML element tag name + * @return a factory for creating HtmlElements representing the given tag + */ + ElementFactory getFactory(String tagName); + + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * @return a factory for creating SvgElements representing the given tag + */ + ElementFactory getSvgFactory(); + + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * Returns the pre-registered element factory corresponding to the specified tag, or an UnknownElementFactory. + * @param page the page + * @param namespaceURI the namespace URI + * @param qualifiedName the qualified name + * @param insideSvg is the node inside an SVG node or not + * @param svgSupport true if called from javascript createElementNS + * @return the pre-registered element factory corresponding to the specified tag, or an UnknownElementFactory + */ + ElementFactory getElementFactory(SgmlPage page, String namespaceURI, + String qualifiedName, boolean insideSvg, boolean svgSupport); + + /** + * Parses the HTML content from the given string into an object tree representation. + * + * @param parent the parent for the new nodes + * @param source the (X)HTML to be parsed + * @throws SAXException if a SAX error occurs + * @throws IOException if an IO error occurs + */ + void parseFragment(DomNode parent, String source) throws SAXException, IOException; + + /** + * Parses the HTML content from the given string into an object tree representation. + * + * @param parent where the new parsed nodes will be added to + * @param context the context to build the fragment context stack + * @param source the (X)HTML to be parsed + * @throws SAXException if a SAX error occurs + * @throws IOException if an IO error occurs + */ + void parseFragment(DomNode parent, DomNode context, String source) throws SAXException, IOException; + + /** + * Parses the HTML content from the specified WebResponse into an object tree representation. + * + * @param webResponse the response data + * @param webWindow the web window into which the page is to be loaded + * @return the page object which is the root of the DOM tree + * @throws IOException if there is an IO error + */ + HtmlPage parseHtml(WebResponse webResponse, WebWindow webWindow) throws IOException; + + /** + * Parses the XHTML content from the specified WebResponse into an object tree representation. + * + * @param webResponse the response data + * @param webWindow the web window into which the page is to be loaded + * @return the page object which is the root of the DOM tree + * @throws IOException if there is an IO error + */ + XHtmlPage parseXHtml(WebResponse webResponse, WebWindow webWindow) throws IOException; + +} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParserDOMBuilder.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParserDOMBuilder.java new file mode 100644 index 00000000000..ce4125c3197 --- /dev/null +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParserDOMBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html.parser; + +/** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + *

Interface for the parser.

+ * + * @author Christian Sell + * @author David K. Taylor + * @author Chris Erskine + * @author Ahmed Ashour + * @author Marc Guillemot + * @author Ethan Glasser-Camp + * @author Sudhan Moghe + * @author Ronald Brill + * @author Frank Danek + * @author Carsten Steul + */ +public interface HTMLParserDOMBuilder { + + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * Parses and then inserts the specified HTML content into the HTML content currently being parsed. + * @param html the HTML content to push + */ + void pushInputString(String html); +} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParserListener.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParserListener.java similarity index 87% rename from src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParserListener.java rename to src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParserListener.java index 18bc435b536..3ce14e80d97 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/HTMLParserListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/HTMLParserListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.html; +package com.gargoylesoftware.htmlunit.html.parser; import java.net.URL; @@ -70,7 +70,7 @@ void warning(String message, URL url, String html, */ class SimpleHTMLParserListener implements HTMLParserListener { - private static final Log LOG = LogFactory.getLog(HTMLParserListener.class); + private static final Log LOG = LogFactory.getLog(SimpleHTMLParserListener.class); @Override public void error(final String message, final URL url, final String html, @@ -87,18 +87,18 @@ public void warning(final String message, final URL url, final String html, private static String format(final String message, final URL url, final String html, final int line, final int column) { final StringBuilder builder = new StringBuilder(message); - builder.append(" ("); - builder.append(url.toExternalForm()); - builder.append(" "); - builder.append(line); - builder.append(":"); - builder.append(column); + builder.append(" (") + .append(url.toExternalForm()) + .append(' ') + .append(line) + .append(':') + .append(column); if (null != html) { - builder.append(" htmlSnippet: '"); - builder.append(html); - builder.append("'"); + builder.append(" htmlSnippet: '") + .append(html) + .append('\''); } - builder.append(")"); + builder.append(')'); return builder.toString(); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java new file mode 100644 index 00000000000..81c9965f26d --- /dev/null +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java @@ -0,0 +1,774 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html.parser.neko; + +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_ATTRIBUTE_LOWER_CASE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COMMAND_TAG; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_ISINDEX_TAG; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_MAIN_TAG; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.KEYGEN_AS_SELECT; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.META_X_UA_COMPATIBLE; + +import java.io.IOException; +import java.io.StringReader; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.apache.xerces.parsers.AbstractSAXParser; +import org.apache.xerces.xni.Augmentations; +import org.apache.xerces.xni.QName; +import org.apache.xerces.xni.XMLAttributes; +import org.apache.xerces.xni.XNIException; +import org.apache.xerces.xni.parser.XMLInputSource; +import org.apache.xerces.xni.parser.XMLParserConfiguration; +import org.w3c.dom.Node; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.ext.LexicalHandler; + +import com.gargoylesoftware.htmlunit.BrowserVersion; +import com.gargoylesoftware.htmlunit.ObjectInstantiationException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.html.DomComment; +import com.gargoylesoftware.htmlunit.html.DomDocumentType; +import com.gargoylesoftware.htmlunit.html.DomElement; +import com.gargoylesoftware.htmlunit.html.DomNode; +import com.gargoylesoftware.htmlunit.html.DomText; +import com.gargoylesoftware.htmlunit.html.ElementFactory; +import com.gargoylesoftware.htmlunit.html.Html; +import com.gargoylesoftware.htmlunit.html.HtmlBody; +import com.gargoylesoftware.htmlunit.html.HtmlElement; +import com.gargoylesoftware.htmlunit.html.HtmlForm; +import com.gargoylesoftware.htmlunit.html.HtmlHtml; +import com.gargoylesoftware.htmlunit.html.HtmlImage; +import com.gargoylesoftware.htmlunit.html.HtmlMeta; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlTable; +import com.gargoylesoftware.htmlunit.html.HtmlTableRow; +import com.gargoylesoftware.htmlunit.html.SubmittableElement; +import com.gargoylesoftware.htmlunit.html.XHtmlPage; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParser; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParserDOMBuilder; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParserListener; +import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLBodyElement; +import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; + +import net.sourceforge.htmlunit.cyberneko.HTMLConfiguration; +import net.sourceforge.htmlunit.cyberneko.HTMLElements; +import net.sourceforge.htmlunit.cyberneko.HTMLEventInfo; +import net.sourceforge.htmlunit.cyberneko.HTMLScanner; +import net.sourceforge.htmlunit.cyberneko.HTMLTagBalancingListener; + +/** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * The parser and DOM builder. This class subclasses Xerces's AbstractSAXParser and implements + * the ContentHandler interface. Thus all parser APIs are kept private. The ContentHandler methods + * consume SAX events to build the page DOM + * + * @author Christian Sell + * @author David K. Taylor + * @author Chris Erskine + * @author Ahmed Ashour + * @author Marc Guillemot + * @author Ethan Glasser-Camp + * @author Sudhan Moghe + * @author Ronald Brill + * @author Frank Danek + * @author Carsten Steul + */ +final class HtmlUnitNekoDOMBuilder extends AbstractSAXParser + implements ContentHandler, LexicalHandler, HTMLTagBalancingListener, HTMLParserDOMBuilder { + + // cache Neko Elements for performance and memory + private static final Map, HTMLElements> ELEMENTS; + static { + ELEMENTS = new HashMap<>(); + + Triple key; + HTMLElements value; + + final HTMLElements.Element command = new HTMLElements.Element(HTMLElements.COMMAND, "COMMAND", + HTMLElements.Element.EMPTY, HTMLElements.BODY, null); + final HTMLElements.Element isIndex = new HTMLElements.Element(HTMLElements.ISINDEX, "ISINDEX", + HTMLElements.Element.INLINE, HTMLElements.BODY, null); + final HTMLElements.Element main = new HTMLElements.Element(HTMLElements.MAIN, "MAIN", + HTMLElements.Element.INLINE, HTMLElements.BODY, null); + + key = Triple.of(Boolean.FALSE, Boolean.FALSE, Boolean.FALSE); + value = new HTMLElements(); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.FALSE, Boolean.FALSE, Boolean.TRUE); + value = new HTMLElements(); + value.setElement(main); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.FALSE, Boolean.TRUE, Boolean.FALSE); + value = new HTMLElements(); + value.setElement(isIndex); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.FALSE, Boolean.TRUE, Boolean.TRUE); + value = new HTMLElements(); + value.setElement(isIndex); + value.setElement(main); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.TRUE, Boolean.FALSE, Boolean.FALSE); + value = new HTMLElements(); + value.setElement(command); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.TRUE, Boolean.FALSE, Boolean.TRUE); + value = new HTMLElements(); + value.setElement(command); + value.setElement(main); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.TRUE, Boolean.TRUE, Boolean.FALSE); + value = new HTMLElements(); + value.setElement(command); + value.setElement(isIndex); + ELEMENTS.put(key, value); + + key = Triple.of(Boolean.TRUE, Boolean.TRUE, Boolean.TRUE); + value = new HTMLElements(); + value.setElement(command); + value.setElement(isIndex); + value.setElement(main); + ELEMENTS.put(key, value); + } + + private enum HeadParsed { YES, SYNTHESIZED, NO } + + private final HTMLParser htmlParser_; + private final HtmlPage page_; + + private Locator locator_; + private final Deque stack_ = new ArrayDeque<>(); + + /** Did the snippet tried to overwrite the start node? */ + private boolean snippetStartNodeOverwritten_; + private final int initialSize_; + private DomNode currentNode_; + private StringBuilder characters_; + private HtmlUnitNekoDOMBuilder.HeadParsed headParsed_ = HeadParsed.NO; + private HtmlElement body_; + private boolean lastTagWasSynthesized_; + private HtmlForm formWaitingForLostChildren_; + private boolean insideSvg_; + + private static final String FEATURE_AUGMENTATIONS = "http://cyberneko.org/html/features/augmentations"; + private static final String FEATURE_PARSE_NOSCRIPT + = "http://cyberneko.org/html/features/parse-noscript-content"; + + /** + * Parses and then inserts the specified HTML content into the HTML content currently being parsed. + * @param html the HTML content to push + */ + @Override + public void pushInputString(final String html) { + page_.registerParsingStart(); + page_.registerInlineSnippetParsingStart(); + try { + final WebResponse webResponse = page_.getWebResponse(); + final Charset charset = webResponse.getContentCharset(); + final String url = webResponse.getWebRequest().getUrl().toString(); + final XMLInputSource in = new XMLInputSource(null, url, null, new StringReader(html), charset.name()); + ((HTMLConfiguration) fConfiguration).evaluateInputSource(in); + } + finally { + page_.registerParsingEnd(); + page_.registerInlineSnippetParsingEnd(); + } + } + + /** + * Creates a new builder for parsing the specified response contents. + * @param node the location at which to insert the new content + * @param url the page's URL + */ + HtmlUnitNekoDOMBuilder(final HTMLParser htmlParser, + final DomNode node, final URL url, final String htmlContent) { + super(createConfiguration(node.getPage().getWebClient().getBrowserVersion())); + + htmlParser_ = htmlParser; + page_ = (HtmlPage) node.getPage(); + + currentNode_ = node; + for (final Node ancestor : currentNode_.getAncestors()) { + stack_.push((DomNode) ancestor); + } + + final WebClient webClient = page_.getWebClient(); + final HTMLParserListener listener = webClient.getHTMLParserListener(); + final boolean reportErrors = listener != null; + if (reportErrors) { + fConfiguration.setErrorHandler(new HtmlUnitNekoHTMLErrorHandler(listener, url, htmlContent)); + } + + try { + setFeature(FEATURE_AUGMENTATIONS, true); + if (!webClient.getBrowserVersion().hasFeature(HTML_ATTRIBUTE_LOWER_CASE)) { + setProperty("http://cyberneko.org/html/properties/names/attrs", "no-change"); + } + setFeature("http://cyberneko.org/html/features/report-errors", reportErrors); + setFeature(FEATURE_PARSE_NOSCRIPT, !webClient.isJavaScriptEnabled()); + setFeature(HTMLScanner.ALLOW_SELFCLOSING_IFRAME, false); + + setContentHandler(this); + setLexicalHandler(this); //comments and CDATA + } + catch (final SAXException e) { + throw new ObjectInstantiationException("unable to create HTML parser", e); + } + initialSize_ = stack_.size(); + } + + /** + * Create the configuration depending on the simulated browser + * @param webClient the current WebClient + * @return the configuration + */ + private static XMLParserConfiguration createConfiguration(final BrowserVersion browserVersion) { + final HTMLElements elements = ELEMENTS.get( + Triple.of(browserVersion.hasFeature(HTML_COMMAND_TAG), + browserVersion.hasFeature(HTML_ISINDEX_TAG), + browserVersion.hasFeature(HTML_MAIN_TAG))); + return new HTMLConfiguration(elements); + } + + /** + * {@inheritDoc} + */ + @Override + public void setDocumentLocator(final Locator locator) { + locator_ = locator; + } + + /** + * {@inheritDoc} + */ + @Override + public void startDocument() throws SAXException { + } + + /** {@inheritDoc} */ + @Override + public void startElement(final QName element, final XMLAttributes attributes, final Augmentations augs) + throws XNIException { + // augs might change so we store only the interesting part + lastTagWasSynthesized_ = isSynthesized(augs); + super.startElement(element, attributes, augs); + } + + /** + * {@inheritDoc} + */ + @Override + public void startElement(String namespaceURI, final String localName, String qName, final Attributes atts) + throws SAXException { + + if (snippetStartNodeOverwritten_) { + snippetStartNodeOverwritten_ = false; + return; + } + handleCharacters(); + + String tagLower = localName.toLowerCase(Locale.ROOT); + if (page_.isParsingHtmlSnippet() && ("html".equals(tagLower) || "body".equals(tagLower))) { + return; + } + + if ("head".equals(tagLower)) { + if (headParsed_ == HeadParsed.YES || page_.isParsingHtmlSnippet()) { + return; + } + + headParsed_ = lastTagWasSynthesized_ ? HeadParsed.SYNTHESIZED : HeadParsed.YES; + } + + if (namespaceURI != null) { + namespaceURI = namespaceURI.trim(); + } + + // add a head if none was there + else if (headParsed_ == HeadParsed.NO && ("body".equals(tagLower) || "frameset".equals(tagLower))) { + final ElementFactory factory = + htmlParser_.getElementFactory(page_, namespaceURI, "head", insideSvg_, false); + final DomElement newElement = factory.createElement(page_, "head", null); + currentNode_.appendChild(newElement); + headParsed_ = HeadParsed.SYNTHESIZED; + } + + // If we're adding a body element, keep track of any temporary synthetic ones + // that we may have had to create earlier (for document.write(), for example). + HtmlBody oldBody = null; + if ("body".equals(qName) && page_.getBody() instanceof HtmlBody) { + oldBody = (HtmlBody) page_.getBody(); + } + + // Need to reset this at each starting form tag because it could be set from a synthesized + // end tag. + if ("form".equals(tagLower)) { + formWaitingForLostChildren_ = null; + } + + // Add the new node. + if (!(page_ instanceof XHtmlPage) && Html.XHTML_NAMESPACE.equals(namespaceURI)) { + namespaceURI = null; + } + + final boolean keyGenAsSelect = "keygen".equals(tagLower) && page_.hasFeature(KEYGEN_AS_SELECT); + if (keyGenAsSelect) { + tagLower = "select"; + qName = "select"; + } + + final ElementFactory factory = + htmlParser_.getElementFactory(page_, namespaceURI, qName, insideSvg_, false); + if (factory == HtmlUnitNekoHtmlParser.SVG_FACTORY) { + namespaceURI = Html.SVG_NAMESPACE; + } + final DomElement newElement = factory.createElementNS(page_, namespaceURI, qName, atts, true); + newElement.setStartLocation(locator_.getLineNumber(), locator_.getColumnNumber()); + + // parse can't replace everything as it does not buffer elements while parsing + addNodeToRightParent(currentNode_, newElement); + + if ("svg".equals(tagLower)) { + insideSvg_ = true; + } + + // If we had an old synthetic body and we just added a real body element, quietly + // remove the old body and move its children to the real body element we just added. + if (oldBody != null) { + oldBody.quietlyRemoveAndMoveChildrenTo(newElement); + } + + if ("body".equals(tagLower)) { + body_ = (HtmlElement) newElement; + } + else if ("meta".equals(tagLower) && page_.hasFeature(META_X_UA_COMPATIBLE)) { + final HtmlMeta meta = (HtmlMeta) newElement; + if ("X-UA-Compatible".equals(meta.getHttpEquivAttribute())) { + final String content = meta.getContentAttribute(); + if (content.startsWith("IE=")) { + final String mode = content.substring(3).trim(); + final int version = page_.getWebClient().getBrowserVersion().getBrowserVersionNumeric(); + try { + int value = Integer.parseInt(mode); + if (value > version) { + value = version; + } + ((HTMLDocument) page_.getScriptableObject()).forceDocumentMode(value); + } + catch (final Exception e) { + // ignore + } + } + } + } + if (keyGenAsSelect) { + DomElement option = factory.createElementNS(page_, namespaceURI, "option", null, true); + option.appendChild(new DomText(page_, "High Grade")); + newElement.appendChild(option); + + option = factory.createElementNS(page_, namespaceURI, "option", null, true); + option.appendChild(new DomText(page_, "Medium Grade")); + newElement.appendChild(option); + } + currentNode_ = newElement; + stack_.push(currentNode_); + } + + /** + * Adds the new node to the right parent that is not necessary the currentNode in case of + * malformed HTML code. The method tries to emulate the behavior of Firefox. + */ + private void addNodeToRightParent(final DomNode currentNode, final DomElement newElement) { + final String currentNodeName = currentNode.getNodeName(); + final String newNodeName = newElement.getNodeName(); + + DomNode parent = currentNode; + + // If the new node is a table element and the current node isn't one search the stack for the + // correct parent. + if ("tr".equals(newNodeName) && !isTableChild(currentNodeName)) { + parent = findElementOnStack("tbody", "thead", "tfoot"); + } + else if (isTableChild(newNodeName) && !"table".equals(currentNodeName)) { + parent = findElementOnStack("table"); + } + else if (isTableCell(newNodeName) && !"tr".equals(currentNodeName)) { + parent = findElementOnStack("tr"); + } + + // If the parent changed and the old parent was a form it is now waiting for lost children. + if (parent != currentNode && "form".equals(currentNodeName)) { + formWaitingForLostChildren_ = (HtmlForm) currentNode; + } + + final String parentNodeName = parent.getNodeName(); + + if (("table".equals(parentNodeName) && !isTableChild(newNodeName)) + || (isTableChild(parentNodeName) && !"caption".equals(parentNodeName) + && !"colgroup".equals(parentNodeName) && !"tr".equals(newNodeName)) + || ("colgroup".equals(parentNodeName) && !"col".equals(newNodeName)) + || ("tr".equals(parentNodeName) && !isTableCell(newNodeName))) { + // If its a form or submittable just add it even though the resulting DOM is incorrect. + // Otherwise insert the element before the table. + if ("form".equals(newNodeName)) { + formWaitingForLostChildren_ = (HtmlForm) newElement; + parent.appendChild(newElement); + } + else if (newElement instanceof SubmittableElement) { + if (formWaitingForLostChildren_ != null) { + formWaitingForLostChildren_.addLostChild((HtmlElement) newElement); + } + parent.appendChild(newElement); + } + else { + parent = findElementOnStack("table"); + parent.insertBefore(newElement); + } + } + else if (formWaitingForLostChildren_ != null && "form".equals(parentNodeName)) { + // Do not append any children to invalid form. Submittable are inserted after the form, + // everything else before the table. + if (newElement instanceof SubmittableElement) { + formWaitingForLostChildren_.addLostChild((HtmlElement) newElement); + parent.getParentNode().appendChild(newElement); + } + else { + parent = findElementOnStack("table"); + parent.insertBefore(newElement); + } + } + else if (formWaitingForLostChildren_ != null && newElement instanceof SubmittableElement) { + formWaitingForLostChildren_.addLostChild((HtmlElement) newElement); + parent.appendChild(newElement); + } + else { + parent.appendChild(newElement); + } + } + + private DomNode findElementOnStack(final String... searchedElementNames) { + DomNode searchedNode = null; + for (final DomNode node : stack_) { + if (ArrayUtils.contains(searchedElementNames, node.getNodeName())) { + searchedNode = node; + break; + } + } + + if (searchedNode == null) { + searchedNode = stack_.peek(); // this is surely wrong but at least it won't throw a NPE + } + + return searchedNode; + } + + private static boolean isTableChild(final String nodeName) { + return "thead".equals(nodeName) || "tbody".equals(nodeName) + || "tfoot".equals(nodeName) || "caption".equals(nodeName) + || "colgroup".equals(nodeName); + } + + private static boolean isTableCell(final String nodeName) { + return "td".equals(nodeName) || "th".equals(nodeName); + } + + /** {@inheritDoc} */ + @Override + public void endElement(final QName element, final Augmentations augs) + throws XNIException { + // augs might change so we store only the interesting part + lastTagWasSynthesized_ = isSynthesized(augs); + super.endElement(element, augs); + } + + /** + * {@inheritDoc} + */ + @Override + public void endElement(final String namespaceURI, final String localName, final String qName) + throws SAXException { + + handleCharacters(); + + final String tagLower = localName.toLowerCase(Locale.ROOT); + + if (page_.isParsingHtmlSnippet()) { + if ("html".equals(tagLower) || "body".equals(tagLower)) { + return; + } + if (stack_.size() == initialSize_) { + snippetStartNodeOverwritten_ = true; + return; + } + } + + if ("svg".equals(tagLower)) { + insideSvg_ = false; + } + + // Need to reset this at each closing form tag because a valid form could start afterwards. + if ("form".equals(tagLower)) { + formWaitingForLostChildren_ = null; + } + + final DomNode previousNode = stack_.pop(); //remove currentElement from stack + previousNode.setEndLocation(locator_.getLineNumber(), locator_.getColumnNumber()); + + // special handling for form lost children (malformed HTML code where is synthesized) + if (previousNode instanceof HtmlForm && lastTagWasSynthesized_) { + formWaitingForLostChildren_ = (HtmlForm) previousNode; + } + + if (!stack_.isEmpty()) { + currentNode_ = stack_.peek(); + } + + final boolean postponed = page_.isParsingInlineHtmlSnippet(); + previousNode.onAllChildrenAddedToPage(postponed); + } + + /** {@inheritDoc} */ + @Override + public void characters(final char[] ch, final int start, final int length) throws SAXException { + if (characters_ == null) { + characters_ = new StringBuilder(); + } + characters_.append(ch, start, length); + } + + /** {@inheritDoc} */ + @Override + public void ignorableWhitespace(final char[] ch, final int start, final int length) throws SAXException { + if (characters_ == null) { + characters_ = new StringBuilder(); + } + characters_.append(ch, start, length); + } + + /** + * Picks up the character data accumulated so far and add it to the current element as a text node. + */ + private void handleCharacters() { + if (characters_ != null && characters_.length() != 0) { + if (currentNode_ instanceof HtmlHtml) { + // In HTML, the node only has two possible children: + // the and the ; any text is ignored. + characters_.setLength(0); + } + else { + // Use the normal behavior: append a text node for the accumulated text. + final String textValue = characters_.toString(); + final DomText text = new DomText(page_, textValue); + characters_.setLength(0); + + if (StringUtils.isNotBlank(textValue)) { + // malformed HTML: some text => text comes before the table + if (currentNode_ instanceof HtmlTableRow) { + final HtmlTableRow row = (HtmlTableRow) currentNode_; + final HtmlTable enclosingTable = row.getEnclosingTable(); + if (enclosingTable != null) { // may be null when called from Range.createContextualFragment + if (enclosingTable.getPreviousSibling() instanceof DomText) { + final DomText domText = (DomText) enclosingTable.getPreviousSibling(); + domText.setTextContent(domText + textValue); + } + else { + enclosingTable.insertBefore(text); + } + } + } + else if (currentNode_ instanceof HtmlTable) { + final HtmlTable enclosingTable = (HtmlTable) currentNode_; + if (enclosingTable.getPreviousSibling() instanceof DomText) { + final DomText domText = (DomText) enclosingTable.getPreviousSibling(); + domText.setTextContent(domText + textValue); + } + else { + enclosingTable.insertBefore(text); + } + } + else if (currentNode_ instanceof HtmlImage) { + currentNode_.setNextSibling(text); + } + else { + currentNode_.appendChild(text); + } + } + else { + currentNode_.appendChild(text); + } + } + } + } + + /** {@inheritDoc} */ + @Override + public void endDocument() throws SAXException { + handleCharacters(); + final DomNode currentPage = page_; + currentPage.setEndLocation(locator_.getLineNumber(), locator_.getColumnNumber()); + } + + /** {@inheritDoc} */ + @Override + public void startPrefixMapping(final String prefix, final String uri) throws SAXException { + } + + /** {@inheritDoc} */ + @Override + public void endPrefixMapping(final String prefix) throws SAXException { + } + + /** {@inheritDoc} */ + @Override + public void processingInstruction(final String target, final String data) throws SAXException { + } + + /** {@inheritDoc} */ + @Override + public void skippedEntity(final String name) throws SAXException { + } + + // LexicalHandler methods + + /** {@inheritDoc} */ + @Override + public void comment(final char[] ch, final int start, final int length) { + handleCharacters(); + final String data = new String(ch, start, length); + final DomComment comment = new DomComment(page_, data); + currentNode_.appendChild(comment); + } + + /** {@inheritDoc} */ + @Override + public void endCDATA() { + } + + /** {@inheritDoc} */ + @Override + public void endDTD() { + } + + /** {@inheritDoc} */ + @Override + public void endEntity(final String name) { + } + + /** {@inheritDoc} */ + @Override + public void startCDATA() { + } + + /** {@inheritDoc} */ + @Override + public void startDTD(final String name, final String publicId, final String systemId) { + final DomDocumentType type = new DomDocumentType(page_, name, publicId, systemId); + page_.setDocumentType(type); + + final Node child; + child = type; + page_.appendChild(child); + } + + /** {@inheritDoc} */ + @Override + public void startEntity(final String name) { + } + + /** + * {@inheritDoc} + */ + @Override + public void ignoredEndElement(final QName element, final Augmentations augs) { + // if real is reached, don't accept fields anymore as lost children + if ("form".equals(element.localpart)) { + formWaitingForLostChildren_ = null; + } + } + + /** + * {@inheritDoc} + */ + @Override + public void ignoredStartElement(final QName elem, final XMLAttributes attrs, final Augmentations augs) { + // when multiple body elements are encountered, the attributes of the discarded + // elements are used when not previously defined + if (body_ != null && "body".equalsIgnoreCase(elem.localpart) && attrs != null) { + copyAttributes(body_, attrs); + } + if (body_ != null && "html".equalsIgnoreCase(elem.localpart) && attrs != null) { + copyAttributes((DomElement) body_.getParentNode(), attrs); + } + } + + private static void copyAttributes(final DomElement to, final XMLAttributes attrs) { + final int length = attrs.getLength(); + for (int i = 0; i < length; i++) { + final String attrName = attrs.getLocalName(i).toLowerCase(Locale.ROOT); + if (to.getAttributes().getNamedItem(attrName) == null) { + to.setAttribute(attrName, attrs.getValue(i)); + if (attrName.startsWith("on") && to.getScriptableObject() instanceof HTMLBodyElement) { + final HTMLBodyElement jsBody = to.getScriptableObject(); + jsBody.createEventHandlerFromAttribute(attrName, attrs.getValue(i)); + } + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public void parse(final XMLInputSource inputSource) throws XNIException, IOException { + final HTMLParserDOMBuilder oldBuilder = page_.getDOMBuilder(); + page_.setDOMBuilder(this); + try { + super.parse(inputSource); + } + finally { + page_.setDOMBuilder(oldBuilder); + } + } + + HtmlElement getBody() { + return body_; + } + + private static boolean isSynthesized(final Augmentations augs) { + final HTMLEventInfo info = (augs == null) ? null + : (HTMLEventInfo) augs.getItem(FEATURE_AUGMENTATIONS); + return info != null && info.isSynthesized(); + } +} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java new file mode 100644 index 00000000000..2798e118831 --- /dev/null +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java @@ -0,0 +1,440 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html.parser.neko; + +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.PAGE_WAIT_LOAD_BEFORE_BODY; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.xerces.util.DefaultErrorHandler; +import org.apache.xerces.xni.QName; +import org.apache.xerces.xni.XNIException; +import org.apache.xerces.xni.parser.XMLErrorHandler; +import org.apache.xerces.xni.parser.XMLInputSource; +import org.apache.xerces.xni.parser.XMLParseException; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +import com.gargoylesoftware.htmlunit.ObjectInstantiationException; +import com.gargoylesoftware.htmlunit.Page; +import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.WebAssert; +import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.WebWindow; +import com.gargoylesoftware.htmlunit.html.DefaultElementFactory; +import com.gargoylesoftware.htmlunit.html.DomElement; +import com.gargoylesoftware.htmlunit.html.DomNode; +import com.gargoylesoftware.htmlunit.html.ElementFactory; +import com.gargoylesoftware.htmlunit.html.FrameWindow; +import com.gargoylesoftware.htmlunit.html.Html; +import com.gargoylesoftware.htmlunit.html.HtmlBody; +import com.gargoylesoftware.htmlunit.html.HtmlFrameSet; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.UnknownElementFactory; +import com.gargoylesoftware.htmlunit.html.XHtmlPage; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParser; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParserListener; +import com.gargoylesoftware.htmlunit.svg.SvgElementFactory; + +import net.sourceforge.htmlunit.cyberneko.HTMLScanner; +import net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer; + +/** + *

SAX parser implementation that uses the NekoHTML {@link net.sourceforge.htmlunit.cyberneko.HTMLConfiguration} + * to parse HTML into a HtmlUnit-specific DOM (HU-DOM) tree.

+ * + * @author Christian Sell + * @author David K. Taylor + * @author Chris Erskine + * @author Ahmed Ashour + * @author Marc Guillemot + * @author Ethan Glasser-Camp + * @author Sudhan Moghe + * @author Ronald Brill + * @author Frank Danek + * @author Carsten Steul + */ +public final class HtmlUnitNekoHtmlParser implements HTMLParser { + + /** + * The SVG factory. + */ + public static final SvgElementFactory SVG_FACTORY = new SvgElementFactory(); + + private static final Map ELEMENT_FACTORIES = new HashMap<>(); + + static { + final DefaultElementFactory defaultElementFactory = new DefaultElementFactory(); + for (final String tagName : DefaultElementFactory.SUPPORTED_TAGS_) { + ELEMENT_FACTORIES.put(tagName, defaultElementFactory); + } + } + + /** + * Ctor. + */ + public HtmlUnitNekoHtmlParser() { + // Empty. + } + + /** + * Parses the HTML content from the given string into an object tree representation. + * + * @param parent the parent for the new nodes + * @param source the (X)HTML to be parsed + * @throws SAXException if a SAX error occurs + * @throws IOException if an IO error occurs + */ + @Override + public void parseFragment(final DomNode parent, final String source) throws SAXException, IOException { + parseFragment(parent, parent, source); + } + + /** + * Parses the HTML content from the given string into an object tree representation. + * + * @param parent where the new parsed nodes will be added to + * @param context the context to build the fragment context stack + * @param source the (X)HTML to be parsed + * @throws SAXException if a SAX error occurs + * @throws IOException if an IO error occurs + */ + @Override + public void parseFragment(final DomNode parent, final DomNode context, final String source) + throws SAXException, IOException { + final Page page = parent.getPage(); + if (!(page instanceof HtmlPage)) { + return; + } + final HtmlPage htmlPage = (HtmlPage) page; + final URL url = htmlPage.getUrl(); + + final HtmlUnitNekoDOMBuilder domBuilder = new HtmlUnitNekoDOMBuilder(this, parent, url, source); + domBuilder.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment", true); + // build fragment context stack + DomNode node = context; + final List ancestors = new ArrayList<>(); + while (node != null && node.getNodeType() != Node.DOCUMENT_NODE) { + ancestors.add(0, new QName(null, node.getNodeName(), null, null)); + node = node.getParentNode(); + } + if (ancestors.isEmpty() || !"html".equals(ancestors.get(0).localpart)) { + ancestors.add(0, new QName(null, "html", null, null)); + } + if (ancestors.size() == 1 || !"body".equals(ancestors.get(1).localpart)) { + ancestors.add(1, new QName(null, "body", null, null)); + } + + domBuilder.setFeature(HTMLScanner.ALLOW_SELFCLOSING_TAGS, true); + domBuilder.setProperty(HTMLTagBalancer.FRAGMENT_CONTEXT_STACK, ancestors.toArray(new QName[] {})); + + final XMLInputSource in = new XMLInputSource(null, url.toString(), null, new StringReader(source), null); + + htmlPage.registerParsingStart(); + htmlPage.registerSnippetParsingStart(); + try { + domBuilder.parse(in); + } + finally { + htmlPage.registerParsingEnd(); + htmlPage.registerSnippetParsingEnd(); + } + } + + /** + * Parses the HTML content from the specified WebResponse into an object tree representation. + * + * @param webResponse the response data + * @param webWindow the web window into which the page is to be loaded + * @return the page object which is the root of the DOM tree + * @throws IOException if there is an IO error + */ + @Override + public HtmlPage parseHtml(final WebResponse webResponse, final WebWindow webWindow) throws IOException { + final HtmlPage page = new HtmlPage(webResponse, webWindow); + parse(webResponse, webWindow, page, false); + return page; + } + + /** + * Parses the XHTML content from the specified WebResponse into an object tree representation. + * + * @param webResponse the response data + * @param webWindow the web window into which the page is to be loaded + * @return the page object which is the root of the DOM tree + * @throws IOException if there is an IO error + */ + @Override + public XHtmlPage parseXHtml(final WebResponse webResponse, final WebWindow webWindow) throws IOException { + final XHtmlPage page = new XHtmlPage(webResponse, webWindow); + parse(webResponse, webWindow, page, true); + return page; + } + + private void parse(final WebResponse webResponse, final WebWindow webWindow, final HtmlPage page, + final boolean xhtml) + throws IOException { + + webWindow.setEnclosedPage(page); + + final URL url = webResponse.getWebRequest().getUrl(); + final HtmlUnitNekoDOMBuilder domBuilder = new HtmlUnitNekoDOMBuilder(this, page, url, null); + + Charset charset = webResponse.getContentCharsetOrNull(); + try { + if (charset == null) { + charset = StandardCharsets.ISO_8859_1; + } + else { + domBuilder.setFeature(HTMLScanner.IGNORE_SPECIFIED_CHARSET, true); + } + + // xml content is different + if (xhtml) { + domBuilder.setFeature(HTMLScanner.ALLOW_SELFCLOSING_TAGS, true); + domBuilder.setFeature(HTMLScanner.SCRIPT_STRIP_CDATA_DELIMS, true); + domBuilder.setFeature(HTMLScanner.STYLE_STRIP_CDATA_DELIMS, true); + } + } + catch (final Exception e) { + throw new ObjectInstantiationException("Error setting HTML parser feature", e); + } + + try (InputStream content = webResponse.getContentAsStream()) { + String encoding = null; + if (charset != null) { + encoding = charset.name(); + } + final XMLInputSource in = new XMLInputSource(null, url.toString(), null, content, encoding); + + page.registerParsingStart(); + try { + domBuilder.parse(in); + } + catch (final XNIException e) { + // extract enclosed exception + final Throwable origin = extractNestedException(e); + throw new RuntimeException("Failed parsing content from " + url, origin); + } + } + finally { + page.registerParsingEnd(); + } + + addBodyToPageIfNecessary(page, true, domBuilder.getBody() != null); + } + + /** + * Adds a body element to the current page, if necessary. Strictly speaking, this should + * probably be done by NekoHTML. See the bug linked below. If and when that bug is fixed, + * we may be able to get rid of this code. + * + * http://sourceforge.net/p/nekohtml/bugs/15/ + * @param page + * @param originalCall + * @param checkInsideFrameOnly true if the original page had body that was removed by JavaScript + */ + private void addBodyToPageIfNecessary( + final HtmlPage page, final boolean originalCall, final boolean checkInsideFrameOnly) { + // IE waits for the whole page to load before initializing bodies for frames. + final boolean waitToLoad = page.hasFeature(PAGE_WAIT_LOAD_BEFORE_BODY); + if (page.getEnclosingWindow() instanceof FrameWindow && originalCall && waitToLoad) { + return; + } + + // Find out if the document already has a body element (or frameset). + final Element doc = page.getDocumentElement(); + boolean hasBody = false; + for (Node child = doc.getFirstChild(); child != null; child = child.getNextSibling()) { + if (child instanceof HtmlBody || child instanceof HtmlFrameSet) { + hasBody = true; + break; + } + } + + // If the document does not have a body, add it. + if (!hasBody && !checkInsideFrameOnly) { + final DomElement body = getFactory("body").createElement(page, "body", null); + doc.appendChild(body); + } + + // If this is IE, we need to initialize the bodies of any frames, as well. + // This will already have been done when emulating FF (see above). + if (waitToLoad) { + for (final FrameWindow frame : page.getFrames()) { + final Page containedPage = frame.getEnclosedPage(); + if (containedPage != null && containedPage.isHtmlPage()) { + addBodyToPageIfNecessary((HtmlPage) containedPage, false, false); + } + } + } + } + + /** + * Extract nested exception within an XNIException (Nekohtml uses reflection and generated + * exceptions are wrapped many times within XNIException and InvocationTargetException) + * + * @param e the original XNIException + * @return the cause exception + */ + static Throwable extractNestedException(final Throwable e) { + Throwable originalException = e; + Throwable cause = ((XNIException) e).getException(); + while (cause != null) { + originalException = cause; + if (cause instanceof XNIException) { + cause = ((XNIException) cause).getException(); + } + else if (cause instanceof InvocationTargetException) { + cause = cause.getCause(); + } + else { + cause = null; + } + } + return originalException; + } + + /** + * {@inheritDoc} + */ + @Override + public ElementFactory getSvgFactory() { + return SVG_FACTORY; + } + + /** + * {@inheritDoc} + */ + @Override + public ElementFactory getFactory(final String tagName) { + final ElementFactory result = ELEMENT_FACTORIES.get(tagName); + + if (result != null) { + return result; + } + return UnknownElementFactory.instance; + } + + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * Returns the pre-registered element factory corresponding to the specified tag, or an UnknownElementFactory. + * @param page the page + * @param namespaceURI the namespace URI + * @param qualifiedName the qualified name + * @param insideSvg is the node inside an SVG node or not + * @param svgSupport true if called from javascript createElementNS + * @return the pre-registered element factory corresponding to the specified tag, or an UnknownElementFactory + */ + @Override + public ElementFactory getElementFactory(final SgmlPage page, final String namespaceURI, + final String qualifiedName, final boolean insideSvg, final boolean svgSupport) { + if (insideSvg) { + return SVG_FACTORY; + } + + if (namespaceURI == null || namespaceURI.isEmpty() + || Html.XHTML_NAMESPACE.equals(namespaceURI) + || Html.SVG_NAMESPACE.equals(namespaceURI) + || !qualifiedName.contains(":")) { + + String tagName = qualifiedName; + final int index = tagName.indexOf(':'); + if (index == -1) { + tagName = tagName.toLowerCase(Locale.ROOT); + } + else { + tagName = tagName.substring(index + 1); + } + final ElementFactory factory; + if (svgSupport && !"svg".equals(tagName) && Html.SVG_NAMESPACE.equals(namespaceURI)) { + factory = SVG_FACTORY; + } + else { + factory = ELEMENT_FACTORIES.get(tagName); + } + + if (factory != null) { + return factory; + } + } + return UnknownElementFactory.instance; + } +} + +/** + * Utility to transmit parsing errors to a {@link HTMLParserListener}. + */ +class HtmlUnitNekoHTMLErrorHandler implements XMLErrorHandler { + private final HTMLParserListener listener_; + private final URL url_; + private String html_; + + HtmlUnitNekoHTMLErrorHandler(final HTMLParserListener listener, final URL url, final String htmlContent) { + WebAssert.notNull("listener", listener); + WebAssert.notNull("url", url); + listener_ = listener; + url_ = url; + html_ = htmlContent; + } + + /** @see DefaultErrorHandler#error(String,String,XMLParseException) */ + @Override + public void error(final String domain, final String key, + final XMLParseException exception) throws XNIException { + listener_.error(exception.getMessage(), + url_, + html_, + exception.getLineNumber(), + exception.getColumnNumber(), + key); + } + + /** @see DefaultErrorHandler#warning(String,String,XMLParseException) */ + @Override + public void warning(final String domain, final String key, + final XMLParseException exception) throws XNIException { + listener_.warning(exception.getMessage(), + url_, + html_, + exception.getLineNumber(), + exception.getColumnNumber(), + key); + } + + @Override + public void fatalError(final String domain, final String key, + final XMLParseException exception) throws XNIException { + listener_.error(exception.getMessage(), + url_, + html_, + exception.getLineNumber(), + exception.getColumnNumber(), + key); + } +} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/budget/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/package-info.java similarity index 70% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/budget/package-info.java rename to src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/package-info.java index a2691115914..87470c3c8a8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/budget/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/neko/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ /** - * Implementations of the Budget JavaScript host objects - users of HtmlUnit shouldn't - * need anything in this package. + * Contains the neko html parser. */ -package com.gargoylesoftware.htmlunit.javascript.host.budget; +package com.gargoylesoftware.htmlunit.html.parser.neko; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/CanSetReadOnlyStatus.java b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/package-info.java similarity index 60% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/CanSetReadOnlyStatus.java rename to src/main/java/com/gargoylesoftware/htmlunit/html/parser/package-info.java index 81660d6c72e..668ffb583b2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/CanSetReadOnlyStatus.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/parser/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,20 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.javascript.configuration; /** - * Status for {@link CanSetReadOnly}. - * - * @author Ahmed Ashour + * Contains the html parser interface. */ -public enum CanSetReadOnlyStatus { - /** Allow to set the value. */ - YES, - - /** Ignore setting the value. */ - IGNORE, - - /** Throw a runtime exception. */ - EXCEPTION -} +package com.gargoylesoftware.htmlunit.html.parser; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/HtmlUnitPrefixResolver.java b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/HtmlUnitPrefixResolver.java index feccb2a0b32..5e5148f8df9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/HtmlUnitPrefixResolver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/HtmlUnitPrefixResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/LowerCaseFunction.java b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/LowerCaseFunction.java index c40ae58b636..78920809aa1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/LowerCaseFunction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/LowerCaseFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathAdapter.java b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathAdapter.java index ac2f79b0cca..72ed3fc0353 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathAdapter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,25 +64,23 @@ private void initFunctionTable() { * @param attributeCaseSensitive whether or not the attributes should be case-sensitive * @throws TransformerException if a syntax or other error occurs */ - XPathAdapter(String exprString, final SourceLocator locator, final PrefixResolver prefixResolver, - ErrorListener errorListener, final boolean caseSensitive, final boolean attributeCaseSensitive) + XPathAdapter(final String exprString, final SourceLocator locator, final PrefixResolver prefixResolver, + final ErrorListener errorListener, final boolean caseSensitive, final boolean attributeCaseSensitive) throws TransformerException { initFunctionTable(); - if (errorListener == null) { - errorListener = new DefaultErrorHandler(); + ErrorListener errListener = errorListener; + if (errListener == null) { + errListener = new DefaultErrorHandler(); } - - exprString = preProcessXPath(exprString, caseSensitive, attributeCaseSensitive); - - final XPathParser parser = new XPathParser(errorListener, locator); + final XPathParser parser = new XPathParser(errListener, locator); final Compiler compiler = new Compiler(errorListener, locator, funcTable_); - parser.initXPath(compiler, exprString, prefixResolver); + final String expression = preProcessXPath(exprString, caseSensitive, attributeCaseSensitive); + parser.initXPath(compiler, expression, prefixResolver); final Expression expr = compiler.compile(0); - mainExp_ = expr; if (locator instanceof ExpressionNode) { @@ -99,34 +97,39 @@ private void initFunctionTable() { * @param attributeCaseSensitive whether or not the attributes should be case-sensitive * @return the processed XPath expression */ - private static String preProcessXPath(String xpath, final boolean caseSensitive, + private static String preProcessXPath(final String xpath, final boolean caseSensitive, final boolean attributeCaseSensitive) { + + String path; if (!caseSensitive) { - final char[] charArray = xpath.toCharArray(); - processOutsideBrackets(charArray); - xpath = new String(charArray); + path = processOutsideBrackets(xpath); + } + else { + path = xpath; } if (!attributeCaseSensitive) { - final Matcher matcher = PREPROCESS_XPATH_PATTERN.matcher(xpath); + final Matcher matcher = PREPROCESS_XPATH_PATTERN.matcher(path); while (matcher.find()) { final String attribute = matcher.group(1); - xpath = xpath.replace(attribute, attribute.toLowerCase(Locale.ROOT)); + path = path.replace(attribute, attribute.toLowerCase(Locale.ROOT)); } } - return xpath; + return path; } /** * Lower case any character outside the brackets. - * @param array the array to change + * @param xpath the XPath expression to change */ - private static void processOutsideBrackets(final char[] array) { - final int length = array.length; + private static String processOutsideBrackets(final String xpath) { + final char[] charArray = xpath.toCharArray(); + + final int length = charArray.length; int insideBrackets = 0; for (int i = 0; i < length; i++) { - final char ch = array[i]; + final char ch = charArray[i]; switch (ch) { case '[': case '(': @@ -140,10 +143,11 @@ private static void processOutsideBrackets(final char[] array) { default: if (insideBrackets == 0) { - array[i] = Character.toLowerCase(ch); + charArray[i] = Character.toLowerCase(ch); } } } + return new String(charArray); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathUtils.java b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathHelper.java similarity index 86% rename from src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathUtils.java rename to src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathHelper.java index 75d4a957882..43d072b22c4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathUtils.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/XPathHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html.xpath; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XPATH_ATTRIBUTE_CASE_SENSITIVE; - import java.util.ArrayList; import java.util.List; @@ -40,14 +38,14 @@ * @author Ahmed Ashour * @author Chuck Dumont */ -public final class XPathUtils { +public final class XPathHelper { private static ThreadLocal PROCESS_XPATH_ = ThreadLocal.withInitial(() -> Boolean.FALSE); /** * Private to avoid instantiation. */ - private XPathUtils() { + private XPathHelper() { // Empty. } @@ -58,18 +56,20 @@ private XPathUtils() { * @param node 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 caseSensitiveXpathAttributes true if the browser handles xpath attribute names case sensitive * @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 node, final String xpathExpr, + final PrefixResolver resolver, final boolean caseSensitiveXpathAttributes) { if (xpathExpr == null) { - throw new NullPointerException("Null is not a valid XPath expression"); + throw new IllegalArgumentException("Null is not a valid XPath expression"); } PROCESS_XPATH_.set(Boolean.TRUE); final List list = new ArrayList<>(); try { - final XObject result = evaluateXPath(node, xpathExpr, resolver); + final XObject result = evaluateXPath(node, xpathExpr, resolver, caseSensitiveXpathAttributes); if (result instanceof XNodeSet) { final NodeList nodelist = ((XNodeSet) result).nodelist(); @@ -112,11 +112,13 @@ public static boolean isProcessingXPath() { * @param contextNode the node to start searching from * @param str a valid XPath string * @param a prefix resolver to use for resolving namespace prefixes, or null + * @param caseSensitiveXpathAttributes true if the browser handles xpath attribute names case sensitive * @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 String str, final PrefixResolver prefixResolver, + final boolean caseSensitiveXpathAttributes) throws TransformerException { final XPathContext xpathSupport = new XPathContext(); final Node xpathExpressionContext; if (contextNode.getNodeType() == Node.DOCUMENT_NODE) { @@ -132,9 +134,8 @@ private static XObject evaluateXPath(final DomNode contextNode, } final boolean caseSensitive = contextNode.getPage().hasCaseSensitiveTagNames(); - final boolean attributeCaseSensitive = caseSensitive - || contextNode.getPage().getWebClient() - .getBrowserVersion().hasFeature(XPATH_ATTRIBUTE_CASE_SENSITIVE); + final boolean attributeCaseSensitive = caseSensitive || caseSensitiveXpathAttributes; + final XPathAdapter xpath = new XPathAdapter(str, null, resolver, null, caseSensitive, attributeCaseSensitive); final int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/package-info.java index eb35fe983a5..0831b7702d5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/html/xpath/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,6 @@ */ /** - * XPath adapter implementation for the Htmlunit DOM. + * XPath adapter implementation for the HtmlUnit DOM. */ package com.gargoylesoftware.htmlunit.html.xpath; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java index 198a8a358a6..118d4b3ef38 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java index cbef22f826f..32fd78ab27a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java index 25d79d8e6d2..87382199f80 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieStore.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieStore.java index ebb0d26568a..7ac934712bf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieStore.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitCookieStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitDomainHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitDomainHandler.java index 9b8436c61dc..4edf271018a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitDomainHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitDomainHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitExpiresHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitExpiresHandler.java index c8173b230b0..fdcb2436e0b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitExpiresHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitExpiresHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,16 +46,18 @@ final class HtmlUnitExpiresHandler extends BasicExpiresHandler { // simplified patterns from BrowserCompatSpec, with yy patterns before similar yyyy patterns private static final String[] DEFAULT_DATE_PATTERNS = new String[] { + "EEE MMM dd yyyy HH mm ss 'GMT'Z", "EEE dd MMM yy HH mm ss zzz", "EEE dd MMM yyyy HH mm ss zzz", "EEE MMM d HH mm ss yyyy", "EEE dd MMM yy HH mm ss z ", "EEE dd MMM yyyy HH mm ss z ", "EEE dd MM yy HH mm ss z ", - "EEE dd MM yyyy HH mm ss z " + "EEE dd MM yyyy HH mm ss z ", }; private static final String[] EXTENDED_DATE_PATTERNS_1 = new String[] { + "EEE MMM dd yyyy HH mm ss 'GMT'Z", "EEE dd MMM yy HH mm ss zzz", "EEE dd MMM yyyy HH mm ss zzz", "EEE MMM d HH mm ss yyyy", @@ -67,6 +69,7 @@ final class HtmlUnitExpiresHandler extends BasicExpiresHandler { }; private static final String[] EXTENDED_DATE_PATTERNS_2 = new String[] { + "EEE MMM dd yyyy HH mm ss 'GMT'Z", "EEE dd MMM yy HH mm ss zzz", "EEE dd MMM yyyy HH mm ss zzz", "EEE MMM d HH mm ss yyyy", @@ -75,7 +78,7 @@ final class HtmlUnitExpiresHandler extends BasicExpiresHandler { "EEE dd MM yy HH mm ss z ", "EEE dd MM yyyy HH mm ss z ", "EEE dd MMM yy HH MM ss z", - "MMM dd yy HH mm ss", + "MMM dd yy HH mm ss" }; private final BrowserVersion browserVersion_; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java index eadbdddcbf1..3d9219ac36c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitPathHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitPathHandler.java index e1902890b8c..bc2bf5cbc44 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitPathHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitPathHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitRedirectStrategie.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitRedirectStrategie.java index 1fdac114330..a2bb864a31a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitRedirectStrategie.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitRedirectStrategie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java index e08ac8bc2e7..03cc8cfc1aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,9 +36,9 @@ import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLSocket; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; +import javax.net.ssl.X509ExtendedTrustManager; import org.apache.http.HttpHost; import org.apache.http.conn.ConnectTimeoutException; @@ -107,7 +107,7 @@ public static SSLConnectionSocketFactory buildSSLSocketFactory(final WebClientOp protocol = "SSL"; } final SSLContext sslContext = SSLContext.getInstance(protocol); - sslContext.init(getKeyManagers(options), new TrustManager[]{new InsecureTrustManager()}, null); + sslContext.init(getKeyManagers(options), new X509ExtendedTrustManager[] {new InsecureTrustManager()}, null); return new HtmlUnitSSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE, useInsecureSSL, sslClientProtocols, sslClientCipherSuites); @@ -240,8 +240,9 @@ private static KeyManager[] getKeyManagers(final WebClientOptions options) { * * @author Daniel Gredler * @author Marc Guillemot + * @author Ronald Brill */ -class InsecureTrustManager implements X509TrustManager { +class InsecureTrustManager extends X509ExtendedTrustManager { private final Set acceptedIssuers_ = new HashSet<>(); /** @@ -262,6 +263,34 @@ public void checkServerTrusted(final X509Certificate[] chain, final String authT acceptedIssuers_.addAll(Arrays.asList(chain)); } + @Override + public void checkClientTrusted(final X509Certificate[] chain, + final String authType, final Socket socket) throws CertificateException { + // Everyone is trusted! + acceptedIssuers_.addAll(Arrays.asList(chain)); + } + + @Override + public void checkClientTrusted(final X509Certificate[] chain, + final String authType, final SSLEngine sslEngine) throws CertificateException { + // Everyone is trusted! + acceptedIssuers_.addAll(Arrays.asList(chain)); + } + + @Override + public void checkServerTrusted(final X509Certificate[] chain, + final String authType, final Socket socket) throws CertificateException { + // Everyone is trusted! + acceptedIssuers_.addAll(Arrays.asList(chain)); + } + + @Override + public void checkServerTrusted(final X509Certificate[] chain, + final String authType, final SSLEngine sslEngine) throws CertificateException { + // Everyone is trusted! + acceptedIssuers_.addAll(Arrays.asList(chain)); + } + /** * {@inheritDoc} */ @@ -274,6 +303,6 @@ public X509Certificate[] getAcceptedIssuers() { if (acceptedIssuers_.isEmpty()) { return new X509Certificate[0]; } - return acceptedIssuers_.toArray(new X509Certificate[acceptedIssuers_.size()]); + return acceptedIssuers_.toArray(new X509Certificate[0]); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java index 8fdb610367c..08f7abff604 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/SocksConnectionSocketFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/SocksConnectionSocketFactory.java index d7428a197e9..0f3ad56268b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/SocksConnectionSocketFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/SocksConnectionSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/package-info.java index c26418cb9ed..50ce583c73c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/httpclient/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/httpclient/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/AbstractJavaScriptEngine.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/AbstractJavaScriptEngine.java index 562c2575413..4229e9cf84d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/AbstractJavaScriptEngine.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/AbstractJavaScriptEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameAdapter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameAdapter.java index 8fcba0804a2..30ce6fd1c3e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameAdapter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameImpl.java index 271af0b9308..fc209641c07 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebugFrameImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ public void onEnter(final Context cx, final Scriptable activation, final Scripta final String line = getFirstLine(cx); final String source = getSourceName(cx); - sb.append(source).append(":").append(line).append(" "); + sb.append(source).append(':').append(line).append(' '); Scriptable parent = activation.getParentScope(); while (parent != null) { @@ -87,7 +87,7 @@ public void onEnter(final Context cx, final Scriptable activation, final Scripta parent = parent.getParentScope(); } final String functionName = getFunctionName(thisObj); - sb.append(functionName).append("("); + sb.append(functionName).append('('); final int nbParams = functionOrScript_.getParamCount(); for (int i = 0; i < nbParams; i++) { final String argAsString; @@ -102,7 +102,7 @@ public void onEnter(final Context cx, final Scriptable activation, final Scripta sb.append(", "); } } - sb.append(")"); + sb.append(')'); LOG.trace(sb); } @@ -144,16 +144,22 @@ public void onExceptionThrown(final Context cx, final Throwable t) { if (LOG.isTraceEnabled()) { if (t instanceof JavaScriptException) { final JavaScriptException e = (JavaScriptException) t; - LOG.trace(getSourceName(cx) + ":" + getFirstLine(cx) - + " Exception thrown: " + Context.toString(e.details())); + if (LOG.isTraceEnabled()) { + LOG.trace(getSourceName(cx) + ":" + getFirstLine(cx) + + " Exception thrown: " + Context.toString(e.details())); + } } else if (t instanceof EcmaError) { final EcmaError e = (EcmaError) t; - LOG.trace(getSourceName(cx) + ":" + getFirstLine(cx) - + " Exception thrown: " + Context.toString(e.details())); + if (LOG.isTraceEnabled()) { + LOG.trace(getSourceName(cx) + ":" + getFirstLine(cx) + + " Exception thrown: " + Context.toString(e.details())); + } } else { - LOG.trace(getSourceName(cx) + ":" + getFirstLine(cx) + " Exception thrown: " + t.getCause()); + if (LOG.isTraceEnabled()) { + LOG.trace(getSourceName(cx) + ":" + getFirstLine(cx) + " Exception thrown: " + t.getCause()); + } } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerAdapter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerAdapter.java index e34bb2a13c5..bcafd7defd2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerAdapter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerImpl.java index 344932de6e9..9db63801b88 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DebuggerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DefaultJavaScriptErrorListener.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DefaultJavaScriptErrorListener.java index bb82fa554d8..547ac30d975 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/DefaultJavaScriptErrorListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/DefaultJavaScriptErrorListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage; /** - * Default implementation of {@link JavaScriptErrorListener} that does only - * logging in some cases. + * Default implementation of {@link JavaScriptErrorListener} that does + * default logging. * * @author Ronald Brill */ @@ -34,23 +34,64 @@ public class DefaultJavaScriptErrorListener implements JavaScriptErrorListener, private static final Log LOG = LogFactory.getLog(DefaultJavaScriptErrorListener.class); + /** + * {@inheritDoc} + */ @Override public void scriptException(final HtmlPage page, final ScriptException scriptException) { + if (LOG.isErrorEnabled()) { + LOG.error("Error during JavaScript execution", scriptException); + } } + /** + * {@inheritDoc} + */ @Override public void timeoutError(final HtmlPage page, final long allowedTime, final long executionTime) { + if (LOG.isErrorEnabled()) { + LOG.error("Timeout during JavaScript execution after " + + executionTime + "ms; allowed only " + allowedTime + "ms"); + } } + /** + * {@inheritDoc} + */ @Override public void malformedScriptURL(final HtmlPage page, final String url, final MalformedURLException malformedURLException) { - LOG.error("Unable to build URL for script src tag [" + url + "]", malformedURLException); + if (LOG.isErrorEnabled()) { + LOG.error("Unable to build URL for script src tag [" + url + "]", malformedURLException); + } } + /** + * {@inheritDoc} + */ @Override public void loadScriptError(final HtmlPage page, final URL scriptUrl, final Exception exception) { - LOG.error("Error loading JavaScript from [" + scriptUrl + "].", exception); + if (LOG.isErrorEnabled()) { + LOG.error("Error loading JavaScript from [" + scriptUrl + "].", exception); + } } + /** + * {@inheritDoc} + */ + @Override + public void warn(final String message, final String sourceName, + final int line, final String lineSource, final int lineOffset) { + if (LOG.isWarnEnabled()) { + final StringBuilder msg = new StringBuilder() + .append("warning: message=[").append(message) + .append("] sourceName=[").append(sourceName) + .append("] line=[").append(line) + .append("] lineSource=[").append(lineSource) + .append("] lineOffset=[").append(lineOffset) + .append("]"); + + LOG.warn(msg.toString()); + } + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/FunctionWrapper.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/FunctionWrapper.java index c92715976db..832a83906a0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/FunctionWrapper.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/FunctionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -178,5 +178,4 @@ public Object getDefaultValue(final Class hint) { public boolean hasInstance(final Scriptable instance) { return wrapped_.hasInstance(instance); } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HiddenFunctionObject.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HiddenFunctionObject.java index 22676d3552e..861414fc998 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HiddenFunctionObject.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HiddenFunctionObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript; -import java.lang.reflect.Member; +import java.lang.reflect.Executable; import net.sourceforge.htmlunit.corejs.javascript.FunctionObject; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; @@ -29,7 +29,7 @@ class HiddenFunctionObject extends FunctionObject { /** * Constructor. */ - HiddenFunctionObject(final String name, final Member methodOrConstructor, final Scriptable scope) { + HiddenFunctionObject(final String name, final Executable methodOrConstructor, final Scriptable scope) { super(name, methodOrConstructor, scope); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java index 519263787c8..439581ef338 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +16,16 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ARGUMENTS_READ_ONLY_ACCESSED_FROM_FUNCTION; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ARRAY_CONSTRUCTION_PROPERTIES; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ENUM_NUMBERS_FIRST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ERROR_STACK; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IGNORES_LAST_LINE_CONTAINING_UNCOMMENTED; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PRE_WIDTH_STRING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PROPERTY_DESCRIPTOR_NAME; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PROPERTY_DESCRIPTOR_NEW_LINE; +import java.io.Serializable; +import java.util.Map; + import com.gargoylesoftware.htmlunit.BrowserVersion; +import com.gargoylesoftware.htmlunit.ScriptException; import com.gargoylesoftware.htmlunit.ScriptPreProcessor; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlElement; @@ -32,10 +33,13 @@ import com.gargoylesoftware.htmlunit.javascript.regexp.HtmlUnitRegExpProxy; import net.sourceforge.htmlunit.corejs.javascript.Callable; +import net.sourceforge.htmlunit.corejs.javascript.ClassShutter; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.ContextFactory; import net.sourceforge.htmlunit.corejs.javascript.ErrorReporter; import net.sourceforge.htmlunit.corejs.javascript.Evaluator; +import net.sourceforge.htmlunit.corejs.javascript.EvaluatorException; import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.Script; import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; @@ -50,6 +54,7 @@ * @author Andre Soereng * @author Ahmed Ashour * @author Marc Guillemot + * @author Ronald Brill */ public class HtmlUnitContextFactory extends ContextFactory { @@ -59,9 +64,8 @@ public class HtmlUnitContextFactory extends ContextFactory { private final BrowserVersion browserVersion_; private long timeout_; private Debugger debugger_; - private final ErrorReporter errorReporter_; private final WrapFactory wrapFactory_ = new HtmlUnitWrapFactory(); - private boolean deminifyFunctionCode_ = false; + private boolean deminifyFunctionCode_; /** * Creates a new instance of HtmlUnitContextFactory. @@ -71,7 +75,6 @@ public class HtmlUnitContextFactory extends ContextFactory { public HtmlUnitContextFactory(final WebClient webClient) { webClient_ = webClient; browserVersion_ = webClient.getBrowserVersion(); - errorReporter_ = new StrictErrorReporter(); } /** @@ -138,12 +141,15 @@ public boolean isDeminifyFunctionCode() { */ private class TimeoutContext extends Context { private long startTime_; + protected TimeoutContext(final ContextFactory factory) { super(factory); } + public void startClock() { startTime_ = System.currentTimeMillis(); } + public void terminateScriptIfNecessary() { if (timeout_ > 0) { final long currentTime = System.currentTimeMillis(); @@ -154,6 +160,7 @@ public void terminateScriptIfNecessary() { } } } + @Override protected Script compileString(String source, final Evaluator compiler, final ErrorReporter compilationErrorReporter, final String sourceName, @@ -267,12 +274,23 @@ protected String preProcess( @Override protected Context makeContext() { final TimeoutContext cx = new TimeoutContext(this); - if (browserVersion_.hasFeature(JS_PRE_WIDTH_STRING)) { - cx.setLanguageVersion(Context.VERSION_1_8); - } - else { - cx.setLanguageVersion(Context.VERSION_ES6); - } + cx.setLanguageVersion(Context.VERSION_ES6); + + // make sure no java classes are usable from js + cx.setClassShutter(new ClassShutter() { + @Override + public boolean visibleToScripts(final String fullClassName) { + final Map activeXObjectMap = webClient_.getActiveXObjectMap(); + if (activeXObjectMap != null) { + for (String mappedClass : activeXObjectMap.values()) { + if (fullClassName.equals(mappedClass)) { + return true; + } + } + } + return false; + } + }); // Use pure interpreter mode to get observeInstructionCount() callbacks. cx.setOptimizationLevel(-1); @@ -280,7 +298,7 @@ protected Context makeContext() { // Set threshold on how often we want to receive the callbacks cx.setInstructionObserverThreshold(INSTRUCTION_COUNT_THRESHOLD); - configureErrorReporter(cx); + cx.setErrorReporter(new HtmlUnitErrorReporter(webClient_.getJavaScriptErrorListener())); cx.setWrapFactory(wrapFactory_); if (debugger_ != null) { @@ -295,15 +313,6 @@ protected Context makeContext() { return cx; } - /** - * Configures the {@link ErrorReporter} on the context. - * @param context the context to configure - * @see Context#setErrorReporter(ErrorReporter) - */ - protected void configureErrorReporter(final Context context) { - context.setErrorReporter(errorReporter_); - } - /** * Run-time calls this when instruction counting is enabled and the counter * reaches limit set by setInstructionObserverThreshold(). A script can be @@ -331,6 +340,25 @@ protected Object doTopCall(final Callable callable, return super.doTopCall(callable, cx, scope, thisObj, args); } + /** + * Same as {@link ContextFactory}{@link #call(ContextAction)} but with handling + * of some exceptions. + * + * @param return type of the action + * @param action the contextAction + * @param page the page + * @return the result of the call + */ + public final T callSecured(final ContextAction action, final HtmlPage page) { + try { + return call(action); + } + catch (final StackOverflowError e) { + webClient_.getJavaScriptErrorListener().scriptException(page, new ScriptException(page, e)); + return null; + } + } + /** * {@inheritDoc} */ @@ -350,9 +378,9 @@ protected boolean hasFeature(final Context cx, final int featureIndex) { case Context.FEATURE_HTMLUNIT_ERROR_STACK: return browserVersion_.hasFeature(JS_ERROR_STACK); case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK: - return browserVersion_.hasFeature(JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK); + return true; case Context.FEATURE_HTMLUNIT_ENUM_NUMBERS_FIRST: - return browserVersion_.hasFeature(JS_ENUM_NUMBERS_FIRST); + return true; case Context.FEATURE_HTMLUNIT_MEMBERBOX_NAME: return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NAME); case Context.FEATURE_HTMLUNIT_MEMBERBOX_NEWLINE: @@ -363,4 +391,70 @@ protected boolean hasFeature(final Context cx, final int featureIndex) { return super.hasFeature(cx, featureIndex); } } + + private static final class HtmlUnitErrorReporter implements ErrorReporter, Serializable { + + private final JavaScriptErrorListener javaScriptErrorListener_; + + /** + * Ctor. + * + * @param javaScriptErrorListener the listener to be used + */ + HtmlUnitErrorReporter(final JavaScriptErrorListener javaScriptErrorListener) { + javaScriptErrorListener_ = javaScriptErrorListener; + } + + /** + * Logs a warning. + * + * @param message the message to be displayed + * @param sourceName the name of the source file + * @param line the line number + * @param lineSource the source code that failed + * @param lineOffset the line offset + */ + @Override + public void warning( + final String message, final String sourceName, final int line, + final String lineSource, final int lineOffset) { + javaScriptErrorListener_.warn(message, sourceName, line, lineSource, lineOffset); + } + + /** + * Logs an error. + * + * @param message the message to be displayed + * @param sourceName the name of the source file + * @param line the line number + * @param lineSource the source code that failed + * @param lineOffset the line offset + */ + @Override + public void error(final String message, final String sourceName, final int line, + final String lineSource, final int lineOffset) { + // no need to log here, this is only used to create the exception + // the exception gets logged if not catched later on + throw new EvaluatorException(message, sourceName, line, lineSource, lineOffset); + } + + /** + * Logs a runtime error. + * + * @param message the message to be displayed + * @param sourceName the name of the source file + * @param line the line number + * @param lineSource the source code that failed + * @param lineOffset the line offset + * @return an evaluator exception + */ + @Override + public EvaluatorException runtimeError( + final String message, final String sourceName, final int line, + final String lineSource, final int lineOffset) { + // no need to log here, this is only used to create the exception + // the exception gets logged if not catched later on + return new EvaluatorException(message, sourceName, line, lineSource, lineOffset); + } + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitScriptable.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitScriptable.java index 020154113c2..92e56cc97da 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitScriptable.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitScriptable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitWrapFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitWrapFactory.java index c44733fd70c..6318db8e658 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitWrapFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitWrapFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java index 69e40bdef38..08841b964aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,11 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ERROR_STACK_TRACE_LIMIT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FUNCTION_TOSOURCE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_PROTOTYPE_SAME_AS_HTML_IMAGE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_Iterator; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OBJECT_GET_OWN_PROPERTY_SYMBOLS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_REFLECT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SYMBOL; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SYMBOL_FF45; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_ACTIVEXOBJECT_HIDDEN; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_CONTAINS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_INCLUDES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_REPEAT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STRING_STARTS_ENDS_WITH; @@ -34,11 +31,10 @@ import java.io.IOException; import java.io.ObjectInputStream; -import java.lang.reflect.Member; +import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.ArrayDeque; import java.util.ArrayList; -import java.util.Arrays; import java.util.Deque; import java.util.HashMap; import java.util.List; @@ -63,11 +59,9 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.ClassConfiguration.PropertyInfo; import com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration; import com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject; -import com.gargoylesoftware.htmlunit.javascript.host.ArrayCustom; import com.gargoylesoftware.htmlunit.javascript.host.DateCustom; import com.gargoylesoftware.htmlunit.javascript.host.NumberCustom; import com.gargoylesoftware.htmlunit.javascript.host.Reflect; -import com.gargoylesoftware.htmlunit.javascript.host.StringCustom; import com.gargoylesoftware.htmlunit.javascript.host.Window; import com.gargoylesoftware.htmlunit.javascript.host.intl.Intl; @@ -77,6 +71,7 @@ import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.FunctionObject; import net.sourceforge.htmlunit.corejs.javascript.IdFunctionObject; +import net.sourceforge.htmlunit.corejs.javascript.RhinoException; import net.sourceforge.htmlunit.corejs.javascript.Script; import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; @@ -143,7 +138,9 @@ public JavaScriptEngine(final WebClient webClient) { webClient_ = webClient; contextFactory_ = new HtmlUnitContextFactory(webClient); initTransientFields(); + jsConfig_ = JavaScriptConfiguration.getInstance(webClient.getBrowserVersion()); + RhinoException.useMozillaStackStyle(true); } /** @@ -170,27 +167,22 @@ public HtmlUnitContextFactory getContextFactory() { public void initialize(final WebWindow webWindow) { WebAssert.notNull("webWindow", webWindow); - final ContextAction action = new ContextAction() { - @Override - public Object run(final Context cx) { - try { - init(webWindow, cx); - } - catch (final Exception e) { - LOG.error("Exception while initializing JavaScript for the page", e); - throw new ScriptException(null, e); // BUG: null is not useful. - } - - return null; + getContextFactory().call(cx -> { + try { + init(webWindow, cx); } - }; - - getContextFactory().call(action); + catch (final Exception e) { + LOG.error("Exception while initializing JavaScript for the page", e); + throw new ScriptException(null, e); // BUG: null is not useful. + } + return null; + }); } /** * Returns the JavaScriptExecutor. - * @return the JavaScriptExecutor. + * @return the JavaScriptExecutor or null if javascript is disabled + * or no executor was required so far. */ public JavaScriptExecutor getJavaScriptExecutor() { return javaScriptExecutor_; @@ -210,7 +202,7 @@ private void init(final WebWindow webWindow, final Context context) throws Excep final Window window = new Window(); ((SimpleScriptable) window).setClassName("Window"); - context.initStandardObjects(window); + context.initSafeStandardObjects(window); final ClassConfiguration windowConfig = jsConfig_.getClassConfiguration("Window"); if (windowConfig.getJsConstructor() != null) { @@ -224,30 +216,17 @@ private void init(final WebWindow webWindow, final Context context) throws Excep } // remove some objects, that Rhino defines in top scope but that we don't want - deleteProperties(window, "java", "javax", "org", "com", "edu", "net", - "JavaAdapter", "JavaImporter", "Continuation", "Packages", "getClass"); + deleteProperties(window, "Continuation"); if (!browserVersion.hasFeature(JS_XML)) { deleteProperties(window, "XML", "XMLList", "Namespace", "QName"); } - if (!browserVersion.hasFeature(JS_Iterator)) { - deleteProperties(window, "Iterator", "StopIteration"); - } + deleteProperties(window, "Iterator", "StopIteration"); if (!browserVersion.hasFeature(JS_SYMBOL)) { deleteProperties(window, "Symbol"); } - if (browserVersion.hasFeature(JS_SYMBOL_FF45)) { - final ScriptableObject sym = (ScriptableObject) ScriptableObject.getProperty(window, "Symbol"); - final List toDelete = Arrays.asList("hasInstance", "isConcatSpreadable", "replace", - "search", "split", "string", "toStringTag", "unscopables"); - for (String propName : toDelete) { - sym.setAttributes(propName, ScriptableObject.EMPTY); - sym.delete(propName); - } - } - final ScriptableObject errorObject = (ScriptableObject) ScriptableObject.getProperty(window, "Error"); if (browserVersion.hasFeature(JS_ERROR_STACK_TRACE_LIMIT)) { errorObject.defineProperty("stackTraceLimit", 10, ScriptableObject.EMPTY); @@ -299,7 +278,7 @@ private void init(final WebWindow webWindow, final Context context) throws Excep } for (final ClassConfiguration config : jsConfig_.getAll()) { - final Member jsConstructor = config.getJsConstructor(); + final Executable jsConstructor = config.getJsConstructor(); final String jsClassName = config.getClassName(); Scriptable prototype = prototypesPerJSName.get(jsClassName); final String hostClassSimpleName = config.getHostClassSimpleName(); @@ -313,18 +292,10 @@ private void init(final WebWindow webWindow, final Context context) throws Excep } switch (hostClassSimpleName) { - case "WebKitAnimationEvent": - prototype = prototypesPerJSName.get("AnimationEvent"); - break; - case "WebKitMutationObserver": prototype = prototypesPerJSName.get("MutationObserver"); break; - case "WebKitTransitionEvent": - prototype = prototypesPerJSName.get("TransitionEvent"); - break; - case "webkitURL": prototype = prototypesPerJSName.get("URL"); break; @@ -353,9 +324,7 @@ private void init(final WebWindow webWindow, final Context context) throws Excep function = new RecursiveFunctionObject(jsClassName, jsConstructor, window); } - if ("WebKitAnimationEvent".equals(hostClassSimpleName) - || "WebKitMutationObserver".equals(hostClassSimpleName) - || "WebKitTransitionEvent".equals(hostClassSimpleName) + if ("WebKitMutationObserver".equals(hostClassSimpleName) || "webkitURL".equals(hostClassSimpleName) || "Image".equals(hostClassSimpleName) || "Option".equals(hostClassSimpleName)) { @@ -455,26 +424,23 @@ private void init(final WebWindow webWindow, final Context context) throws Excep } // Rhino defines too much methods for us, particularly since implementation of ECMAScript5 - removePrototypeProperties(window, "String", "equals", "equalsIgnoreCase"); + final ScriptableObject stringPrototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, "String"); + deleteProperties(stringPrototype, "equals", "equalsIgnoreCase"); + + final ScriptableObject numberPrototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, "Number"); + final ScriptableObject datePrototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, "Date"); + if (!browserVersion.hasFeature(STRING_INCLUDES)) { - removePrototypeProperties(window, "String", "includes"); + deleteProperties(stringPrototype, "includes"); } if (!browserVersion.hasFeature(STRING_REPEAT)) { - removePrototypeProperties(window, "String", "repeat"); + deleteProperties(stringPrototype, "repeat"); } if (!browserVersion.hasFeature(STRING_STARTS_ENDS_WITH)) { - removePrototypeProperties(window, "String", "startsWith"); - removePrototypeProperties(window, "String", "endsWith"); + deleteProperties(stringPrototype, "startsWith", "endsWith"); } if (!browserVersion.hasFeature(STRING_TRIM_LEFT_RIGHT)) { - removePrototypeProperties(window, "String", "trimLeft"); - removePrototypeProperties(window, "String", "trimRight"); - } - if (browserVersion.hasFeature(STRING_CONTAINS)) { - final ScriptableObject stringPrototype = - (ScriptableObject) ScriptableObject.getClassPrototype(window, "String"); - stringPrototype.defineFunctionProperties(new String[] {"contains"}, - StringCustom.class, ScriptableObject.EMPTY); + deleteProperties(stringPrototype, "trimLeft", "trimRight"); } // only FF has toSource @@ -482,19 +448,21 @@ private void init(final WebWindow webWindow, final Context context) throws Excep deleteProperties(window, "uneval"); removePrototypeProperties(window, "Object", "toSource"); removePrototypeProperties(window, "Array", "toSource"); - removePrototypeProperties(window, "Date", "toSource"); + deleteProperties(datePrototype, "toSource"); removePrototypeProperties(window, "Function", "toSource"); - removePrototypeProperties(window, "Number", "toSource"); - removePrototypeProperties(window, "String", "toSource"); + deleteProperties(numberPrototype, "toSource"); + deleteProperties(stringPrototype, "toSource"); } if (browserVersion.hasFeature(JS_WINDOW_ACTIVEXOBJECT_HIDDEN)) { ((IdFunctionObject) ScriptableObject.getProperty(window, "Object")).delete("assign"); + + // TODO + deleteProperties(window, "WeakSet"); } deleteProperties(window, "isXMLName"); NativeFunctionToStringFunction.installFix(window, webClient.getBrowserVersion()); - final ScriptableObject datePrototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, "Date"); datePrototype.defineFunctionProperties(new String[] {"toLocaleDateString", "toLocaleTimeString"}, DateCustom.class, ScriptableObject.DONTENUM); @@ -502,14 +470,10 @@ private void init(final WebWindow webWindow, final Context context) throws Excep ((ScriptableObject) ScriptableObject.getProperty(window, "Object")).delete("getOwnPropertySymbols"); } - if (browserVersion.hasFeature(JS_ARRAY_FROM)) { - final ScriptableObject arrayPrototype = (ScriptableObject) ScriptRuntime.name(context, window, "Array"); - arrayPrototype.defineFunctionProperties(new String[] {"from"}, - ArrayCustom.class, ScriptableObject.DONTENUM); + if (!browserVersion.hasFeature(JS_ARRAY_FROM)) { + deleteProperties((ScriptableObject) ScriptableObject.getProperty(window, "Array"), "from", "of"); } - final ScriptableObject numberPrototype - = (ScriptableObject) ScriptableObject.getClassPrototype(window, "Number"); numberPrototype.defineFunctionProperties(new String[] {"toLocaleString"}, NumberCustom.class, ScriptableObject.DONTENUM); @@ -641,11 +605,11 @@ private static void configureConstants(final ClassConfiguration config, final Sc private static void configureProperties(final ClassConfiguration config, final ScriptableObject scriptable) { final Map propertyMap = config.getPropertyMap(); - for (final String propertyName : propertyMap.keySet()) { - final PropertyInfo info = propertyMap.get(propertyName); + for (final Entry propertyEntry : propertyMap.entrySet()) { + final PropertyInfo info = propertyEntry.getValue(); final Method readMethod = info.getReadMethod(); final Method writeMethod = info.getWriteMethod(); - scriptable.defineProperty(propertyName, null, readMethod, writeMethod, ScriptableObject.EMPTY); + scriptable.defineProperty(propertyEntry.getKey(), null, readMethod, writeMethod, ScriptableObject.EMPTY); } } @@ -734,7 +698,7 @@ public Script compile(final HtmlPage owningPage, final Scriptable scope, final S LOG.trace("Javascript compile " + sourceName + newline + sourceCode + newline); } - final ContextAction action = new HtmlUnitContextAction(scope, owningPage) { + final ContextAction action = new HtmlUnitContextAction(scope, owningPage) { @Override public Object doRun(final Context cx) { return cx.compileString(sourceCode, sourceName, startLine, null); @@ -746,7 +710,7 @@ protected String getSourceCode(final Context cx) { } }; - return (Script) getContextFactory().call(action); + return (Script) getContextFactory().callSecured(action, owningPage); } /** @@ -783,7 +747,7 @@ public Object execute(final HtmlPage page, final Script script) { * @return the result of executing the specified code */ public Object execute(final HtmlPage page, final Scriptable scope, final Script script) { - final ContextAction action = new HtmlUnitContextAction(scope, page) { + final ContextAction action = new HtmlUnitContextAction(scope, page) { @Override public Object doRun(final Context cx) { return script.exec(cx, scope); @@ -795,7 +759,7 @@ protected String getSourceCode(final Context cx) { } }; - return getContextFactory().call(action); + return getContextFactory().callSecured(action, page); } /** @@ -831,7 +795,7 @@ public Object callFunction( public Object callFunction(final HtmlPage page, final Function function, final Scriptable scope, final Scriptable thisObject, final Object[] args) { - final ContextAction action = new HtmlUnitContextAction(scope, page) { + final ContextAction action = new HtmlUnitContextAction(scope, page) { @Override public Object doRun(final Context cx) { if (ScriptRuntime.hasTopCall(cx)) { @@ -844,7 +808,7 @@ protected String getSourceCode(final Context cx) { return cx.decompileFunction(function, 2); } }; - return getContextFactory().call(action); + return getContextFactory().callSecured(action, page); } private static Scriptable getScope(final HtmlPage page, final DomNode node) { @@ -869,7 +833,7 @@ public boolean isScriptRunning() { * ContextAction should be preferred because according to Rhino doc it * "guarantees proper association of Context instances with the current thread and is faster". */ - private abstract class HtmlUnitContextAction implements ContextAction { + private abstract class HtmlUnitContextAction implements ContextAction { private final Scriptable scope_; private final HtmlPage page_; @@ -1012,13 +976,12 @@ protected void handleJavaScriptException(final ScriptException scriptException, } } } - getWebClient().getJavaScriptErrorListener().scriptException(page, scriptException); + final WebClient webClient = getWebClient(); + webClient.getJavaScriptErrorListener().scriptException(page, scriptException); // Throw a Java exception if the user wants us to. - if (getWebClient().getOptions().isThrowExceptionOnScriptError()) { + if (webClient.getOptions().isThrowExceptionOnScriptError()) { throw scriptException; } - // Log the error; ScriptException instances provide good debug info. - LOG.info("Caught script exception", scriptException); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptErrorListener.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptErrorListener.java index 91c1229668b..39bd3659bba 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptErrorListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptErrorListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,8 +51,7 @@ public interface JavaScriptErrorListener { * @param url the malformed url * @param malformedURLException the occurred exception */ - void malformedScriptURL(HtmlPage page, String url, - MalformedURLException malformedURLException); + void malformedScriptURL(HtmlPage page, String url, MalformedURLException malformedURLException); /** * Informs about an exception during load of a javascript file refereed from a page. @@ -62,4 +61,15 @@ void malformedScriptURL(HtmlPage page, String url, * @param exception the occurred exception */ void loadScriptError(HtmlPage page, URL scriptUrl, Exception exception); + + /** + * Informs about a javascript warning. + * + * @param message the message to be displayed + * @param sourceName the name of the source file + * @param line the line number + * @param lineSource the source code that failed + * @param lineOffset the line offset + */ + void warn(String message, String sourceName, int line, String lineSource, int lineOffset); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/MethodWrapper.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/MethodWrapper.java index 39d03f55ad4..38f17c26802 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/MethodWrapper.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/MethodWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/NamedNodeMap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/NamedNodeMap.java index 5643e335353..c8d6cf9f15a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/NamedNodeMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/NamedNodeMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomElement; @@ -49,7 +48,7 @@ public class NamedNodeMap extends SimpleScriptable { /** * We need default constructors to build the prototype instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public NamedNodeMap() { attributes_ = null; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java index f0a8ee68a68..9f5fc10cd10 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/NativeFunctionToStringFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NATIVE_FUNCTION_TOSTRING_COMPACT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NATIVE_FUNCTION_TOSTRING_NEW_LINE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NATIVE_FUNCTION_TOSTRING_NL; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -55,6 +56,13 @@ else if (browserVersion.hasFeature(JS_NATIVE_FUNCTION_TOSTRING_COMPACT)) { final Function newToString = new NativeFunctionToStringFunctionChrome(originalToString); ScriptableObject.putProperty(fnPrototype, "toString", newToString); } + else if (browserVersion.hasFeature(JS_NATIVE_FUNCTION_TOSTRING_NL)) { + final ScriptableObject fnPrototype = + (ScriptableObject) ScriptableObject.getClassPrototype(window, "Function"); + final Function originalToString = (Function) ScriptableObject.getProperty(fnPrototype, "toString"); + final Function newToString = new NativeFunctionToStringFunctionFF(originalToString); + ScriptableObject.putProperty(fnPrototype, "toString", newToString); + } } NativeFunctionToStringFunction(final Function wrapped) { @@ -92,7 +100,23 @@ public Object call(final Context cx, final Scriptable scope, final Scriptable th final String functionName = ((BaseFunction) thisObj).getFunctionName(); return "function " + functionName + "() { [native code] }"; } - return s; + return s.replace("function anonymous() {", "function anonymous(\n) {"); + } + } + + static class NativeFunctionToStringFunctionFF extends FunctionWrapper { + + NativeFunctionToStringFunctionFF(final Function wrapped) { + super(wrapped); + } + + /** + * {@inheritDoc} + */ + @Override + public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { + final String s = (String) super.call(cx, scope, thisObj, args); + return s.replace("function anonymous() {", "function anonymous(\n) {"); } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/PostponedAction.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/PostponedAction.java index 0ef00e9a0eb..69144d9b582 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/PostponedAction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/PostponedAction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/RecursiveFunctionObject.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/RecursiveFunctionObject.java index e32f5aa9a7e..7e0ab9448d2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/RecursiveFunctionObject.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/RecursiveFunctionObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WEBGL_CONTEXT_EVENT_CONSTANTS; +import java.lang.reflect.Executable; import java.lang.reflect.Member; import java.util.LinkedHashSet; import java.util.Set; @@ -44,7 +45,7 @@ public class RecursiveFunctionObject extends FunctionObject { * @param methodOrConstructor a {@link Member} that defines the object * @param scope the enclosing scope of function */ - public RecursiveFunctionObject(final String name, final Member methodOrConstructor, + public RecursiveFunctionObject(final String name, final Executable methodOrConstructor, final Scriptable scope) { super(name, methodOrConstructor, scope); } @@ -85,7 +86,7 @@ public Object[] getIds() { } } } - return objects.toArray(new Object[objects.size()]); + return objects.toArray(new Object[0]); } /** @@ -116,15 +117,9 @@ public String getFunctionName() { case "webkitSpeechRecognition": return "SpeechRecognition"; - case "WebKitAnimationEvent": - return "AnimationEvent"; - case "WebKitMutationObserver": return "MutationObserver"; - case "WebKitTransitionEvent": - return "TransitionEvent"; - case "webkitMediaStream": return "MediaStream"; @@ -135,7 +130,7 @@ public String getFunctionName() { return "SpeechGrammarList"; case "webkitSpeechRecognitionError": - return "SpeechRecognitionError"; + return "SpeechRecognitionErrorEvent"; case "webkitSpeechRecognitionEvent": return "SpeechRecognitionEvent"; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/ScriptableWrapper.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/ScriptableWrapper.java index 171a6855ec2..094f4315d88 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/ScriptableWrapper.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/ScriptableWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/SilentJavaScriptErrorListener.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/SilentJavaScriptErrorListener.java new file mode 100644 index 00000000000..5f443d252c1 --- /dev/null +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/SilentJavaScriptErrorListener.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.javascript; + +import java.io.Serializable; +import java.net.MalformedURLException; +import java.net.URL; + +import com.gargoylesoftware.htmlunit.ScriptException; +import com.gargoylesoftware.htmlunit.html.HtmlPage; + +/** + * Silent implementation of {@link JavaScriptErrorListener} that does no logging at all. + * + * @author Ronald Brill + */ +public class SilentJavaScriptErrorListener implements JavaScriptErrorListener, Serializable { + + @Override + public void scriptException(final HtmlPage page, final ScriptException scriptException) { + } + + @Override + public void timeoutError(final HtmlPage page, final long allowedTime, final long executionTime) { + } + + @Override + public void malformedScriptURL(final HtmlPage page, final String url, + final MalformedURLException malformedURLException) { + } + + @Override + public void loadScriptError(final HtmlPage page, final URL scriptUrl, final Exception exception) { + } + + @Override + public void warn(final String message, final String sourceName, + final int line, final String lineSource, final int lineOffset) { + } +} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptable.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptable.java index 20d6d293e78..2068189884d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptable.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLIMAGE_HTMLELEMENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLIMAGE_HTMLUNKNOWNELEMENT; -import java.lang.reflect.Method; import java.util.Deque; import org.apache.commons.logging.Log; @@ -30,14 +29,11 @@ import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlImage; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnly; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.host.Window; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLUnknownElement; import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; import net.sourceforge.htmlunit.corejs.javascript.Undefined; @@ -110,7 +106,7 @@ protected Object getWithPreemption(final String name) { @Override public boolean has(final int index, final Scriptable start) { final Object found = get(index, start); - if (Undefined.instance != found && Scriptable.NOT_FOUND != found) { + if (!Undefined.isUndefined(found) && Scriptable.NOT_FOUND != found) { return true; } return super.has(index, start); @@ -387,38 +383,4 @@ public void setCaseSensitive(final boolean caseSensitive) { ((SimpleScriptable) prototype).setCaseSensitive(caseSensitive); } } - - @Override - protected boolean isReadOnlySettable(final String name, final Object value) { - for (final Method m : getClass().getMethods()) { - final JsxGetter jsxGetter = m.getAnnotation(JsxGetter.class); - if (jsxGetter != null) { - String methodProperty; - if (jsxGetter.propertyName().isEmpty()) { - final int prefix = m.getName().startsWith("is") ? 2 : 3; - methodProperty = m.getName().substring(prefix); - methodProperty = Character.toLowerCase(methodProperty.charAt(0)) + methodProperty.substring(1); - } - else { - methodProperty = jsxGetter.propertyName(); - } - if (methodProperty.equals(name)) { - final CanSetReadOnly canSetReadOnly = m.getAnnotation(CanSetReadOnly.class); - if (canSetReadOnly != null) { - switch (canSetReadOnly.value()) { - case YES: - return true; - case IGNORE: - return false; - case EXCEPTION: - throw ScriptRuntime.typeError3("msg.set.prop.no.setter", - name, getClassName(), Context.toString(value)); - default: - } - } - } - } - } - return true; - } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptableProxy.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptableProxy.java index 8068937f54e..f5a52c37ce0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptableProxy.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/SimpleScriptableProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/StrictErrorHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/StrictErrorHandler.java deleted file mode 100644 index d33069b7757..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/StrictErrorHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript; - -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXParseException; - -/** - * An error handler that throws an exception for all problems no matter how minor. - * - * @author Mike Bowler - */ -public class StrictErrorHandler implements ErrorHandler { - - /** - * A warning occurred. - * - * @param rethrow an exception which will be rethrown - * @throws SAXParseException always - */ - @Override - public void warning(final SAXParseException rethrow) throws SAXParseException { - throw rethrow; - } - - /** - * An error occurred. - * - * @param rethrow an exception which will be rethrown - * @throws SAXParseException always - */ - @Override - public void error(final SAXParseException rethrow) throws SAXParseException { - throw rethrow; - } - - /** - * A fatal error occurred. - * - * @param rethrow an exception which will be rethrown - * @throws SAXParseException always - */ - @Override - public void fatalError(final SAXParseException rethrow) throws SAXParseException { - throw rethrow; - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/StrictErrorReporter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/StrictErrorReporter.java deleted file mode 100644 index 0cde9c09637..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/StrictErrorReporter.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript; - -import java.io.Serializable; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import net.sourceforge.htmlunit.corejs.javascript.ErrorReporter; -import net.sourceforge.htmlunit.corejs.javascript.EvaluatorException; - -/** - * A JavaScript error reporter that will log all warnings and errors, no matter how trivial. - * - * @author Mike Bowler - * @author Marc Guillemot - * @author Ronald Brill - */ -public class StrictErrorReporter implements ErrorReporter, Serializable { - - private static final Log LOG = LogFactory.getLog(StrictErrorReporter.class); - - /** - * Logs a warning. - * - * @param message the message to be displayed - * @param sourceName the name of the source file - * @param line the line number - * @param lineSource the source code that failed - * @param lineOffset the line offset - */ - @Override - public void warning( - final String message, final String sourceName, final int line, - final String lineSource, final int lineOffset) { - LOG.warn(format("warning", message, sourceName, line, lineSource, lineOffset)); - } - - /** - * Logs an error. - * - * @param message the message to be displayed - * @param sourceName the name of the source file - * @param line the line number - * @param lineSource the source code that failed - * @param lineOffset the line offset - */ - @Override - public void error(final String message, final String sourceName, final int line, - final String lineSource, final int lineOffset) { - LOG.error(format("error", message, sourceName, line, lineSource, lineOffset)); - throw new EvaluatorException(message, sourceName, line, lineSource, lineOffset); - } - - /** - * Logs a runtime error. - * - * @param message the message to be displayed - * @param sourceName the name of the source file - * @param line the line number - * @param lineSource the source code that failed - * @param lineOffset the line offset - * @return an evaluator exception - */ - @Override - public EvaluatorException runtimeError( - final String message, final String sourceName, final int line, - final String lineSource, final int lineOffset) { - LOG.error(format("runtimeError", message, sourceName, line, lineSource, lineOffset)); - return new EvaluatorException(message, sourceName, line, lineSource, lineOffset); - } - - private static String format( - final String prefix, final String message, final String sourceName, - final int line, final String lineSource, final int lineOffset) { - return prefix + ": message=[" + message + "] sourceName=[" + sourceName + "] line=[" + line - + "] lineSource=[" + lineSource + "] lineOffset=[" + lineOffset + "]"; - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/TimeoutError.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/TimeoutError.java index 8d35eebf3a4..df5f077cf8d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/TimeoutError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/TimeoutError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java index 41317e02426..6c297dd00e1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BackgroundJavaScriptFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ * JavaScript engine. * * @author Ronald Brill + * @author Atsushi Nakagawa */ public class BackgroundJavaScriptFactory { @@ -73,13 +74,14 @@ public JavaScriptJob createJavaScriptJob(final int initialDelay, final Integer p * @param label the label for the job * @param window the window to which the job belongs * @param function the JavaScript code to execute + * @param args the arguments to pass into the function call * * @return JavaScriptJob the created job */ public JavaScriptFunctionJob createJavaScriptJob(final int initialDelay, final Integer period, final String label, - final WebWindow window, final Function function) { - return new JavaScriptFunctionJob(initialDelay, period, label, window, function); + final WebWindow window, final Function function, final Object[] args) { + return new JavaScriptFunctionJob(initialDelay, period, label, window, function, args); } /** @@ -90,7 +92,7 @@ public JavaScriptFunctionJob createJavaScriptJob(final int initialDelay, * @return JavaScriptJob the created job */ public JavaScriptJob createJavascriptXMLHttpRequestJob(final ContextFactory contextFactory, - final ContextAction action) { + final ContextAction action) { return new JavascriptXMLHttpRequestJob(contextFactory, action); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BasicJavaScriptJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BasicJavaScriptJob.java index 40a8647edc3..1bea38dca8b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BasicJavaScriptJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/BasicJavaScriptJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DefaultJavaScriptExecutor.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DefaultJavaScriptExecutor.java index c98cae9dacd..f703534d243 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DefaultJavaScriptExecutor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DefaultJavaScriptExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ import java.lang.ref.WeakReference; import java.util.LinkedList; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -33,14 +34,12 @@ */ public class DefaultJavaScriptExecutor implements JavaScriptExecutor { - // TODO: is there utility in not having these as transient? private final transient WeakReference webClient_; + private final transient List> jobManagerList_; - private transient List> jobManagerList_ = new LinkedList<>(); + private final transient AtomicBoolean shutdown_; - private volatile boolean shutdown_ = false; - - private transient Thread eventLoopThread_ = null; + private transient Thread eventLoopThread_; /** Logging support. */ private static final Log LOG = LogFactory.getLog(DefaultJavaScriptExecutor.class); @@ -51,6 +50,8 @@ public class DefaultJavaScriptExecutor implements JavaScriptExecutor { */ public DefaultJavaScriptExecutor(final WebClient webClient) { webClient_ = new WeakReference<>(webClient); + jobManagerList_ = new LinkedList<>(); + shutdown_ = new AtomicBoolean(); } /** @@ -106,14 +107,17 @@ private void killThread() { protected JavaScriptJobManager getJobManagerWithEarliestJob() { JavaScriptJobManager javaScriptJobManager = null; JavaScriptJob earliestJob = null; - // iterate over the list and find the earliest job to run. - for (WeakReference weakReference : jobManagerList_) { - final JavaScriptJobManager jobManager = weakReference.get(); - if (jobManager != null) { - final JavaScriptJob newJob = jobManager.getEarliestJob(); - if (newJob != null && (earliestJob == null || earliestJob.compareTo(newJob) > 0)) { - earliestJob = newJob; - javaScriptJobManager = jobManager; + + synchronized (jobManagerList_) { + // iterate over the list and find the earliest job to run. + for (WeakReference weakReference : jobManagerList_) { + final JavaScriptJobManager jobManager = weakReference.get(); + if (jobManager != null) { + final JavaScriptJob newJob = jobManager.getEarliestJob(); + if (newJob != null && (earliestJob == null || earliestJob.compareTo(newJob) > 0)) { + earliestJob = newJob; + javaScriptJobManager = jobManager; + } } } } @@ -127,7 +131,7 @@ public void run() { // this has to be a multiple of 10ms // otherwise the VM has to fight with the OS to get such small periods final long sleepInterval = 10; - while (!shutdown_ && !Thread.currentThread().isInterrupted() && webClient_.get() != null) { + while (!shutdown_.get() && !Thread.currentThread().isInterrupted() && webClient_.get() != null) { final JavaScriptJobManager jobManager = getJobManagerWithEarliestJob(); if (jobManager != null) { @@ -153,7 +157,7 @@ public void run() { } // check for cancel - if (shutdown_ || Thread.currentThread().isInterrupted() || webClient_.get() == null) { + if (shutdown_.get() || Thread.currentThread().isInterrupted() || webClient_.get() == null) { break; } @@ -180,32 +184,35 @@ public void addWindow(final WebWindow newWindow) { } } - private synchronized void updateJobMangerList(final JavaScriptJobManager newJobManager) { - for (WeakReference weakReference : jobManagerList_) { - final JavaScriptJobManager manager = weakReference.get(); - if (newJobManager == manager) { - return; - } - } - + private void updateJobMangerList(final JavaScriptJobManager newJobManager) { final List> managers = new LinkedList<>(); - for (WeakReference weakReference : jobManagerList_) { - final JavaScriptJobManager manager = weakReference.get(); - if (null != manager) { - managers.add(weakReference); + synchronized (jobManagerList_) { + for (WeakReference weakReference : jobManagerList_) { + final JavaScriptJobManager manager = weakReference.get(); + if (newJobManager == manager) { + return; + } + if (null != weakReference.get()) { + managers.add(weakReference); + } } + + managers.add(new WeakReference<>(newJobManager)); + + jobManagerList_.clear(); + jobManagerList_.addAll(managers); } - managers.add(new WeakReference<>(newJobManager)); - jobManagerList_ = managers; } /** Notes that this thread has been shutdown. */ @Override public void shutdown() { - shutdown_ = true; + shutdown_.set(true); killThread(); webClient_.clear(); - jobManagerList_.clear(); + synchronized (jobManagerList_) { + jobManagerList_.clear(); + } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DownloadBehaviorJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DownloadBehaviorJob.java index 0f1fec53972..84b1547cd2d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DownloadBehaviorJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/DownloadBehaviorJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,6 @@ import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.ContextFactory; import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; @@ -73,18 +71,16 @@ public void run() { LOG.debug("Downloaded content: " + StringUtils.abbreviate(content, 512)); } final Object[] args = new Object[] {content}; - final ContextAction action = new ContextAction() { - @Override - public Object run(final Context cx) { - callback_.call(cx, scope, scope, args); - return null; - } - }; final ContextFactory cf = ((JavaScriptEngine) client_.getJavaScriptEngine()).getContextFactory(); - cf.call(action); + cf.call(cx -> { + callback_.call(cx, scope, scope, args); + return null; + }); } catch (final IOException e) { - LOG.error("Behavior #default#download: Cannot download " + url_, e); + if (LOG.isErrorEnabled()) { + LOG.error("Behavior #default#download: Cannot download " + url_, e); + } } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutionJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutionJob.java index ad9139b2061..31eac59e13a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutionJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutionJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutor.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutor.java index 956deb38943..32c8db7d526 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.background; -import java.io.Serializable; - import com.gargoylesoftware.htmlunit.WebWindow; /** @@ -25,7 +23,7 @@ * @author Kostadin Chikov * @author Ronald Brill */ -public interface JavaScriptExecutor extends Runnable, Serializable { +public interface JavaScriptExecutor extends Runnable { /** * Register a window with the eventLoop. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java index 4f3a40fde78..41692fe35ad 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptFunctionJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,11 +24,14 @@ /** * A {@link JavaScriptJob} created from a {@link Function} object. * @author Brad Clarke + * @author Ronald Brill + * @author Atsushi Nakagawa */ class JavaScriptFunctionJob extends JavaScriptExecutionJob { /** The JavaScript code to execute. */ private final Function function_; + private final Object[] args_; /** * Creates a new JavaScript execution job, where the JavaScript code to execute is a function. @@ -37,11 +40,13 @@ class JavaScriptFunctionJob extends JavaScriptExecutionJob { * @param label the label for the job * @param window the window to which the job belongs * @param function the JavaScript code to execute + * @param args the arguments to pass into the function call */ JavaScriptFunctionJob(final int initialDelay, final Integer period, final String label, - final WebWindow window, final Function function) { + final WebWindow window, final Function function, final Object[] args) { super(initialDelay, period, label, window); function_ = function; + args_ = args; } /** {@inheritDoc} */ @@ -49,7 +54,7 @@ class JavaScriptFunctionJob extends JavaScriptExecutionJob { protected void runJavaScript(final HtmlPage page) { final DomElement doc = page.getDocumentElement(); final Scriptable scriptable = page.getEnclosingWindow().getScriptableObject(); - page.executeJavaScriptFunction(function_, scriptable, new Object[0], doc); + page.executeJavaScriptFunction(function_, scriptable, args_, doc); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJob.java index c14bf5f5f99..64cb5a7d206 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManager.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManager.java index 5cfbd1c33cc..d986c1b878c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManager.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerImpl.java index f4ef7e1aacf..ec5e14add74 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptJobManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ class JavaScriptJobManagerImpl implements JavaScriptJobManager { private transient ArrayList cancelledJobs_ = new ArrayList<>(); - private transient JavaScriptJob currentlyRunningJob_ = null; + private transient JavaScriptJob currentlyRunningJob_; /** A counter used to generate the IDs assigned to {@link JavaScriptJob}s. */ private static final AtomicInteger NEXT_JOB_ID_ = new AtomicInteger(1); @@ -309,7 +309,7 @@ private void printQueue() { */ @Override public synchronized String jobStatusDump(final JavaScriptJobFilter filter) { - final StringBuilder status = new StringBuilder(); + final StringBuilder status = new StringBuilder(110); final String lineSeparator = System.lineSeparator(); status.append("------ JavaScript job status -----"); status.append(lineSeparator); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptStringJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptStringJob.java index dfc22ef77d9..8f836896718 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptStringJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavaScriptStringJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavascriptXMLHttpRequestJob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavascriptXMLHttpRequestJob.java index 626fb113577..a5cf08f4d5b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavascriptXMLHttpRequestJob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/JavascriptXMLHttpRequestJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ */ final class JavascriptXMLHttpRequestJob extends BasicJavaScriptJob { private final ContextFactory contextFactory_; - private final ContextAction action_; + private final ContextAction action_; - JavascriptXMLHttpRequestJob(final ContextFactory contextFactory, final ContextAction action) { + JavascriptXMLHttpRequestJob(final ContextFactory contextFactory, final ContextAction action) { super(); contextFactory_ = contextFactory; action_ = action; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/package-info.java index deb5a6bb7da..9db4fb7bd21 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/background/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/AbstractJavaScriptConfiguration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/AbstractJavaScriptConfiguration.java index 003e7200a54..ef3a2583734 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/AbstractJavaScriptConfiguration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/AbstractJavaScriptConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,9 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.lang.annotation.Annotation; @@ -108,14 +107,11 @@ public static ClassConfiguration getClassConfiguration(final Class[] domClasses_; private final boolean jsObject_; private final String className_; @@ -78,7 +78,7 @@ public ClassConfiguration(final Class hostClass, f extendedClassName_ = extendedClassName; } - void setJSConstructor(final Member jsConstructor) { + void setJSConstructor(final Executable jsConstructor) { if (jsConstructor_ != null) { throw new IllegalStateException("Can not have two constructors for " + jsConstructor_.getDeclaringClass().getName()); @@ -122,9 +122,13 @@ public void addConstant(final String name) { } constants_.add(new ConstantInfo(name, value, flag)); } - catch (final Exception e) { - throw Context.reportRuntimeError("Cannot get field '" + name + "' for type: " - + getHostClass().getName()); + catch (final NoSuchFieldException e) { + throw Context.reportRuntimeError("Cannot get field '" + name + "' for type: " + getHostClass().getName() + + "reason: " + e.getMessage()); + } + catch (final IllegalAccessException e) { + throw Context.reportRuntimeError("Cannot get field '" + name + "' for type: " + getHostClass().getName() + + "reason: " + e.getMessage()); } } @@ -220,7 +224,7 @@ public String getHostClassSimpleName() { * Gets the JavaScript constructor method in {@link #getHostClass()}. * @return the JavaScript constructor method in {@link #getHostClass()} */ - public Member getJsConstructor() { + public Executable getJsConstructor() { return jsConstructor_; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java index c56434f1bc9..9d25d26d58e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import com.gargoylesoftware.htmlunit.javascript.NamedNodeMap; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject; -import com.gargoylesoftware.htmlunit.javascript.host.Animation; import com.gargoylesoftware.htmlunit.javascript.host.ApplicationCache; import com.gargoylesoftware.htmlunit.javascript.host.AudioScheduledSourceNode; import com.gargoylesoftware.htmlunit.javascript.host.BarProp; @@ -57,14 +56,12 @@ import com.gargoylesoftware.htmlunit.javascript.host.Plugin; import com.gargoylesoftware.htmlunit.javascript.host.PluginArray; import com.gargoylesoftware.htmlunit.javascript.host.Promise; -import com.gargoylesoftware.htmlunit.javascript.host.Proxy; import com.gargoylesoftware.htmlunit.javascript.host.PushManager; import com.gargoylesoftware.htmlunit.javascript.host.PushSubscription; import com.gargoylesoftware.htmlunit.javascript.host.PushSubscriptionOptions; import com.gargoylesoftware.htmlunit.javascript.host.ReadableStream; import com.gargoylesoftware.htmlunit.javascript.host.Screen; import com.gargoylesoftware.htmlunit.javascript.host.ScreenOrientation; -import com.gargoylesoftware.htmlunit.javascript.host.Set; import com.gargoylesoftware.htmlunit.javascript.host.SharedWorker; import com.gargoylesoftware.htmlunit.javascript.host.SimpleArray; import com.gargoylesoftware.htmlunit.javascript.host.Storage; @@ -75,28 +72,15 @@ import com.gargoylesoftware.htmlunit.javascript.host.TouchList; import com.gargoylesoftware.htmlunit.javascript.host.URL; import com.gargoylesoftware.htmlunit.javascript.host.URLSearchParams; -import com.gargoylesoftware.htmlunit.javascript.host.WeakMap; -import com.gargoylesoftware.htmlunit.javascript.host.WeakSet; import com.gargoylesoftware.htmlunit.javascript.host.WebSocket; import com.gargoylesoftware.htmlunit.javascript.host.Window; import com.gargoylesoftware.htmlunit.javascript.host.XPathExpression; import com.gargoylesoftware.htmlunit.javascript.host.webkitURL; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase; +import com.gargoylesoftware.htmlunit.javascript.host.animations.Animation; +import com.gargoylesoftware.htmlunit.javascript.host.animations.AnimationEvent; +import com.gargoylesoftware.htmlunit.javascript.host.animations.KeyframeEffect; import com.gargoylesoftware.htmlunit.javascript.host.arrays.Atomics; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.DataView; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Float32Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Float64Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Int16Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Int32Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Int8Array; import com.gargoylesoftware.htmlunit.javascript.host.arrays.SharedArrayBuffer; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint16Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint32Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8Array; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8ClampedArray; -import com.gargoylesoftware.htmlunit.javascript.host.budget.BudgetService; import com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasCaptureMediaStream; import com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasCaptureMediaStreamTrack; import com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasGradient; @@ -159,7 +143,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.css.CaretPosition; import com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration; import com.gargoylesoftware.htmlunit.javascript.host.css.MediaQueryList; -import com.gargoylesoftware.htmlunit.javascript.host.css.MozCSSKeyframesRule; import com.gargoylesoftware.htmlunit.javascript.host.css.StyleMedia; import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheet; import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList; @@ -208,7 +191,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.dom.XPathEvaluator; import com.gargoylesoftware.htmlunit.javascript.host.dom.XPathNSResolver; import com.gargoylesoftware.htmlunit.javascript.host.dom.XPathResult; -import com.gargoylesoftware.htmlunit.javascript.host.event.AnimationEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.ApplicationCacheErrorEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.AudioProcessingEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.BeforeInstallPromptEvent; @@ -245,8 +227,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.MouseEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.MouseScrollEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.MouseWheelEvent; -import com.gargoylesoftware.htmlunit.javascript.host.event.MozContactChangeEvent; -import com.gargoylesoftware.htmlunit.javascript.host.event.MozSettingsEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.MutationEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.OfflineAudioCompletionEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.PageTransitionEvent; @@ -270,11 +250,9 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.UIEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.UserProximityEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.WebGLContextEvent; -import com.gargoylesoftware.htmlunit.javascript.host.event.WebKitAnimationEvent; -import com.gargoylesoftware.htmlunit.javascript.host.event.WebKitTransitionEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.WebkitSpeechRecognitionError; +import com.gargoylesoftware.htmlunit.javascript.host.event.WebkitSpeechRecognitionEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.WheelEvent; -import com.gargoylesoftware.htmlunit.javascript.host.event.webkitSpeechRecognitionError; -import com.gargoylesoftware.htmlunit.javascript.host.event.webkitSpeechRecognitionEvent; import com.gargoylesoftware.htmlunit.javascript.host.fetch.Headers; import com.gargoylesoftware.htmlunit.javascript.host.fetch.Request; import com.gargoylesoftware.htmlunit.javascript.host.fetch.Response; @@ -357,7 +335,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.media.VTTCue; import com.gargoylesoftware.htmlunit.javascript.host.media.VideoPlaybackQuality; import com.gargoylesoftware.htmlunit.javascript.host.media.WaveShaperNode; -import com.gargoylesoftware.htmlunit.javascript.host.media.webkitMediaStream; +import com.gargoylesoftware.htmlunit.javascript.host.media.WebkitMediaStream; import com.gargoylesoftware.htmlunit.javascript.host.media.midi.MIDIAccess; import com.gargoylesoftware.htmlunit.javascript.host.media.midi.MIDIInput; import com.gargoylesoftware.htmlunit.javascript.host.media.midi.MIDIInputMap; @@ -368,16 +346,15 @@ import com.gargoylesoftware.htmlunit.javascript.host.media.presentation.PresentationAvailability; import com.gargoylesoftware.htmlunit.javascript.host.media.presentation.PresentationConnection; import com.gargoylesoftware.htmlunit.javascript.host.media.presentation.PresentationRequest; +import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.MozRTCIceCandidate; +import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.MozRTCPeerConnection; +import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.MozRTCSessionDescription; import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.RTCCertificate; import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.RTCIceCandidate; import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.RTCPeerConnection; import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.RTCSessionDescription; import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.RTCStatsReport; -import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.mozRTCIceCandidate; -import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.mozRTCPeerConnection; -import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.mozRTCSessionDescription; -import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.webkitRTCPeerConnection; -import com.gargoylesoftware.htmlunit.javascript.host.moz.MozPowerManager; +import com.gargoylesoftware.htmlunit.javascript.host.media.rtc.WebkitRTCPeerConnection; import com.gargoylesoftware.htmlunit.javascript.host.network.NetworkInformation; import com.gargoylesoftware.htmlunit.javascript.host.payment.PaymentAddress; import com.gargoylesoftware.htmlunit.javascript.host.payment.PaymentRequest; @@ -398,9 +375,9 @@ import com.gargoylesoftware.htmlunit.javascript.host.speech.SpeechSynthesisErrorEvent; import com.gargoylesoftware.htmlunit.javascript.host.speech.SpeechSynthesisUtterance; import com.gargoylesoftware.htmlunit.javascript.host.speech.SpeechSynthesisVoice; -import com.gargoylesoftware.htmlunit.javascript.host.speech.webkitSpeechGrammar; -import com.gargoylesoftware.htmlunit.javascript.host.speech.webkitSpeechGrammarList; -import com.gargoylesoftware.htmlunit.javascript.host.speech.webkitSpeechRecognition; +import com.gargoylesoftware.htmlunit.javascript.host.speech.WebkitSpeechGrammar; +import com.gargoylesoftware.htmlunit.javascript.host.speech.WebkitSpeechGrammarList; +import com.gargoylesoftware.htmlunit.javascript.host.speech.WebkitSpeechRecognition; import com.gargoylesoftware.htmlunit.javascript.host.svg.*; import com.gargoylesoftware.htmlunit.javascript.host.worker.ServiceWorker; import com.gargoylesoftware.htmlunit.javascript.host.worker.ServiceWorkerContainer; @@ -431,14 +408,13 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati AbstractList.class, ActiveXObject.class, AnalyserNode.class, ANGLE_instanced_arrays.class, Animation.class, AnimationEvent.class, ApplicationCache.class, ApplicationCacheErrorEvent.class, - Atomics.class, Attr.class, - Audio.class, AudioBuffer.class, + Atomics.class, + Attr.class, Audio.class, AudioBuffer.class, AudioBufferSourceNode.class, AudioContext.class, AudioDestinationNode.class, AudioListener.class, AudioNode.class, AudioParam.class, AudioProcessingEvent.class, AudioScheduledSourceNode.class, BarProp.class, BaseAudioContext.class, BatteryManager.class, BeforeInstallPromptEvent.class, BeforeUnloadEvent.class, BiquadFilterNode.class, Blob.class, BlobEvent.class, BroadcastChannel.class, - BudgetService.class, Cache.class, CacheStorage.class, CanvasCaptureMediaStream.class, CanvasCaptureMediaStreamTrack.class, CanvasGradient.class, CanvasPattern.class, CanvasRenderingContext2D.class, CaretPosition.class, @@ -468,7 +444,7 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati FileSystem.class, FileSystemDirectoryEntry.class, FileSystemDirectoryReader.class, FileSystemEntry.class, FileSystemFileEntry.class, FocusEvent.class, FontFace.class, - FontFaceSet.class, FormData.class, FormField.class, GainNode.class, Gamepad.class, + FontFaceSet.class, FormData.class, GainNode.class, Gamepad.class, GamepadButton.class, GamepadEvent.class, Geolocation.class, HashChangeEvent.class, Headers.class, History.class, HTMLAllCollection.class, HTMLAnchorElement.class, HTMLAppletElement.class, HTMLAreaElement.class, HTMLAudioElement.class, @@ -507,8 +483,8 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati InputDeviceCapabilities.class, InputEvent.class, InstallTrigger.class, IntersectionObserver.class, IntersectionObserverEntry.class, - KeyboardEvent.class, LocalMediaStream.class, - Location.class, com.gargoylesoftware.htmlunit.javascript.host.Map.class, + KeyboardEvent.class, KeyframeEffect.class, + LocalMediaStream.class, Location.class, MediaDeviceInfo.class, MediaDevices.class, MediaElementAudioSourceNode.class, MediaEncryptedEvent.class, MediaError.class, MediaKeyError.class, MediaKeyMessageEvent.class, MediaKeys.class, MediaKeySession.class, @@ -519,9 +495,7 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati MessageEvent.class, MessagePort.class, MIDIAccess.class, MIDIConnectionEvent.class, MIDIInput.class, MIDIInputMap.class, MIDIMessageEvent.class, MIDIOutput.class, MIDIOutputMap.class, MIDIPort.class, MimeType.class, MimeTypeArray.class, MouseEvent.class, MouseScrollEvent.class, - MouseWheelEvent.class, MozContactChangeEvent.class, MozCSSKeyframesRule.class, - MozPowerManager.class, mozRTCIceCandidate.class, - mozRTCPeerConnection.class, mozRTCSessionDescription.class, MozSettingsEvent.class, + MouseWheelEvent.class, MozRTCIceCandidate.class, MozRTCPeerConnection.class, MozRTCSessionDescription.class, MSGestureEvent.class, MutationEvent.class, MutationObserver.class, MutationRecord.class, NamedNodeMap.class, Namespace.class, NamespaceCollection.class, @@ -541,21 +515,21 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati PresentationAvailability.class, PresentationConnection.class, PresentationConnectionAvailableEvent.class, PresentationConnectionCloseEvent.class, PresentationRequest.class, ProcessingInstruction.class, ProgressEvent.class, Promise.class, PromiseRejectionEvent.class, - Proxy.class, PushManager.class, + PushManager.class, PushSubscription.class, PushSubscriptionOptions.class, RadioNodeList.class, Range.class, ReadableStream.class, RemotePlayback.class, Request.class, Response.class, RowContainer.class, RTCCertificate.class, RTCDataChannelEvent.class, RTCIceCandidate.class, RTCPeerConnection.class, RTCPeerConnectionIceEvent.class, RTCSessionDescription.class, RTCStatsReport.class, Screen.class, ScreenOrientation.class, ScriptProcessorNode.class, SecurityPolicyViolationEvent.class, Selection.class, ServiceWorker.class, ServiceWorkerContainer.class, - ServiceWorkerRegistration.class, Set.class, ShadowRoot.class, - SharedArrayBuffer.class, + ServiceWorkerRegistration.class, + ShadowRoot.class, SharedArrayBuffer.class, SharedWorker.class, SimpleArray.class, SourceBuffer.class, SourceBufferList.class, SpeechSynthesis.class, SpeechSynthesisErrorEvent.class, SpeechSynthesisEvent.class, SpeechSynthesisUtterance.class, SpeechSynthesisVoice.class, StereoPannerNode.class, Storage.class, StorageEvent.class, StorageManager.class, StyleMedia.class, StyleSheet.class, StyleSheetList.class, SubtleCrypto.class, - SVGAElement.class, SVGAltGlyphElement.class, SVGAngle.class, SVGAnimatedAngle.class, + SVGAElement.class, SVGAngle.class, SVGAnimatedAngle.class, SVGAnimatedBoolean.class, SVGAnimatedEnumeration.class, SVGAnimatedInteger.class, SVGAnimatedLength.class, SVGAnimatedLengthList.class, SVGAnimatedNumber.class, SVGAnimatedNumberList.class, SVGAnimatedPreserveAspectRatio.class, SVGAnimatedRect.class, SVGAnimatedString.class, @@ -563,7 +537,7 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati SVGAnimateMotionElement.class, SVGAnimateTransformElement.class, SVGAnimationElement.class, SVGCircleElement.class, SVGClipPathElement.class, SVGComponentTransferFunctionElement.class, - SVGDefsElement.class, SVGDescElement.class, SVGDiscardElement.class, SVGDocument.class, SVGElement.class, + SVGDefsElement.class, SVGDescElement.class, SVGDiscardElement.class, SVGElement.class, SVGEllipseElement.class, SVGFEBlendElement.class, SVGFEColorMatrixElement.class, SVGFEComponentTransferElement.class, SVGFECompositeElement.class, SVGFEConvolveMatrixElement.class, SVGFEDiffuseLightingElement.class, SVGFEDisplacementMapElement.class, SVGFEDistantLightElement.class, @@ -599,7 +573,7 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati UIEvent.class, URL.class, URLSearchParams.class, UserProximityEvent.class, ValidityState.class, VideoPlaybackQuality.class, - VTTCue.class, WaveShaperNode.class, WeakMap.class, WeakSet.class, WebGL2RenderingContext.class, + VTTCue.class, WaveShaperNode.class, WebGL2RenderingContext.class, WEBGL_compressed_texture_s3tc.class, WEBGL_debug_renderer_info.class, WebGLActiveInfo.class, WebGLBuffer.class, WebGLContextEvent.class, WebGLFramebuffer.class, WebGLProgram.class, WebGLQuery.class, @@ -608,22 +582,14 @@ public final class JavaScriptConfiguration extends AbstractJavaScriptConfigurati WebGLSampler.class, WebGLShader.class, WebGLShaderPrecisionFormat.class, WebGLSync.class, WebGLTexture.class, WebGLTransformFeedback.class, WebGLUniformLocation.class, WebGLVertexArrayObject.class, - WebKitAnimationEvent.class, - WebKitCSSMatrix.class, webkitMediaStream.class, WebKitMutationObserver.class, - webkitRTCPeerConnection.class, webkitSpeechGrammar.class, - webkitSpeechGrammarList.class, webkitSpeechRecognition.class, webkitSpeechRecognitionError.class, - webkitSpeechRecognitionEvent.class, WebKitTransitionEvent.class, webkitURL.class, + WebKitCSSMatrix.class, WebkitMediaStream.class, WebKitMutationObserver.class, + WebkitRTCPeerConnection.class, WebkitSpeechGrammar.class, + WebkitSpeechGrammarList.class, WebkitSpeechRecognition.class, WebkitSpeechRecognitionError.class, + WebkitSpeechRecognitionEvent.class, webkitURL.class, WebSocket.class, WheelEvent.class, Window.class, Worker.class, XMLDocument.class, XMLHttpRequest.class, XMLHttpRequestEventTarget.class, XMLHttpRequestUpload.class, XMLSerializer.class, XPathEvaluator.class, XPathExpression.class, - XPathNSResolver.class, XPathResult.class, XSLTProcessor.class, - - // we will use the Rhino stuff as soon as possible - ArrayBuffer.class, ArrayBufferView.class, ArrayBufferViewBase.class, - DataView.class, - Float32Array.class, Float64Array.class, - Int16Array.class, Int32Array.class, Int8Array.class, - Uint16Array.class, Uint32Array.class, Uint8Array.class, Uint8ClampedArray.class + XPathNSResolver.class, XPathResult.class, XSLTProcessor.class }; /** Cache of browser versions and their corresponding JavaScript configurations. */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClass.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClass.java index 4313bd58639..d9e828967fd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClass.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -66,7 +65,6 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClasses.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClasses.java index ad9631f9f0a..eb2b36ea34b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClasses.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxClasses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstant.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstant.java index 2f78a83db4f..fe83b060904 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstant.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,7 +39,6 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstructor.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstructor.java index 16153a96489..dbba4489805 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstructor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxConstructor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -41,7 +40,6 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxFunction.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxFunction.java index 309ffa87eff..552efbab231 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxFunction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,8 +39,7 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxGetter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxGetter.java index 05e2620518a..a0d0b2ffa3c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxGetter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxGetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,8 +39,7 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxSetter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxSetter.java index 7ba0ad336af..2cb0e2eb118 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxSetter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxSetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,8 +39,7 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticFunction.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticFunction.java index c04bbe2f150..7ea428a55e0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticFunction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,8 +39,7 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticGetter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticGetter.java index c0e434409e0..4c8dc925bc2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticGetter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JsxStaticGetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,7 +39,6 @@ SupportedBrowser[] value() default { CHROME, FF, - IE, - EDGE + IE }; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java index 8c212eee546..c395fd642fe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,15 +27,12 @@ public enum SupportedBrowser { /** Internet Explorer 11. */ IE, - /** Edge. */ - EDGE, - /** All versions of Firefox. */ FF, - /** Firefox 45. */ - FF45, + /** Firefox 60. */ + FF60, - /** Firefox 52. */ - FF52 + /** Firefox 68. */ + FF68 } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/package-info.java index c244287fea2..8e033f83096 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObject.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObject.java index cc8d5aeb650..7c0dba22714 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObject.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,7 +85,7 @@ public static Scriptable jsConstructor( throw Context.reportRuntimeError( "ActiveXObject Error: constructor must have one or two String parameters."); } - if (args[0] == Undefined.instance) { + if (Undefined.isUndefined(args[0])) { throw Context.reportRuntimeError("ActiveXObject Error: constructor parameter is undefined."); } if (!(args[0] instanceof String)) { @@ -127,7 +127,9 @@ public static Scriptable jsConstructor( } } - LOG.warn("Automation server can't create object for '" + activeXName + "'."); + if (LOG.isWarnEnabled()) { + LOG.warn("Automation server can't create object for '" + activeXName + "'."); + } throw Context.reportRuntimeError("Automation server can't create object for '" + activeXName + "'."); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObjectImpl.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObjectImpl.java index ee339684192..a72b52fe013 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObjectImpl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ActiveXObjectImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java index 642ed08e3a1..b214b5b9306 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ApplicationCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -29,8 +28,6 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - /** *

A collection of offline resources as defined in the HTML5 spec. * Intended to support offline web applications.

@@ -44,27 +41,27 @@ * @see Offline Resources in Firefox * @see Mozilla Documentation */ -@JsxClass({CHROME, IE, EDGE}) +@JsxClass({CHROME, IE}) @JsxClass(className = "OfflineResourceList", value = FF) public class ApplicationCache extends EventTarget { /** The object isn't associated with an application cache. */ - @JsxConstant({CHROME, IE}) + @JsxConstant public static final short UNCACHED = 0; /** The application cache is not in the process of being updated. */ - @JsxConstant({CHROME, IE}) + @JsxConstant public static final short IDLE = 1; /** The application cache manifest is being fetched and checked for updates. */ - @JsxConstant({CHROME, IE}) + @JsxConstant public static final short CHECKING = 2; /** Resources are being downloaded to be added to the cache. */ - @JsxConstant({CHROME, IE}) + @JsxConstant public static final short DOWNLOADING = 3; /** There is a new version of the application cache available. */ - @JsxConstant({CHROME, IE}) + @JsxConstant public static final short UPDATEREADY = 4; /** The application cache group is now obsolete. */ - @JsxConstant({CHROME, IE}) + @JsxConstant public static final short OBSOLETE = 5; private short status_ = UNCACHED; @@ -72,7 +69,7 @@ public class ApplicationCache extends EventTarget { /** * The constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public ApplicationCache() { } @@ -224,10 +221,7 @@ private Object getHandlerForJavaScript(final String eventName) { } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler == null || handler instanceof Scriptable) { - getEventListenersContainer().setEventHandler(eventName, handler); - } - // Otherwise, fail silently. + getEventListenersContainer().setEventHandler(eventName, handler); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ArrayCustom.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ArrayCustom.java deleted file mode 100644 index ef6d2bd6168..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ArrayCustom.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host; - -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.Function; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * Contains some missing features of Rhino NativeArray. - * - * @author Ahmed Ashour - * @author Ronald Brill - */ -public final class ArrayCustom { - - private ArrayCustom() { } - - /** - * Creates a new Array instance from an array-like or iterable object. - * @param context the JavaScript context - * @param thisObj the scriptable - * @param args the arguments passed into the method - * @param function the function - * @return converted string - */ - public static Scriptable from( - final Context context, final Scriptable thisObj, final Object[] args, final Function function) { - final Object arrayLike = args[0]; - Object[] array = null; - if (arrayLike instanceof Scriptable) { - final Scriptable scriptable = (Scriptable) arrayLike; - final Object length = scriptable.get("length", scriptable); - if (length != Scriptable.NOT_FOUND) { - final int size = (int) Context.toNumber(length); - array = new Object[size]; - for (int i = 0; i < size; i++) { - array[i] = scriptable.get(i, scriptable); - } - } - else { - final List list = new ArrayList<>(); - if (Iterator.iterate(context, thisObj, scriptable, - value -> { - if (value != Undefined.instance) { - list.add(value); - } - })) { - array = list.toArray(); - } - } - } - else if (arrayLike instanceof String) { - final String string = (String) arrayLike; - array = new Object[string.length()]; - for (int i = 0; i < array.length; i++) { - array[i] = string.charAt(i); - } - } - if (array == null) { - array = new Object[0]; - } - return context.newArray(thisObj, array); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/AudioScheduledSourceNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/AudioScheduledSourceNode.java index 948d3376179..d011fcf0b06 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/AudioScheduledSourceNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/AudioScheduledSourceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class AudioScheduledSourceNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BarProp.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BarProp.java index 5df661c3f97..5f589da43ff 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BarProp.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BarProp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class BarProp extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BatteryManager.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BatteryManager.java index 2fbf1619791..910ebb9d0a8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BatteryManager.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BatteryManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BroadcastChannel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BroadcastChannel.java index f186b479fe3..a5781a8d96e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BroadcastChannel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/BroadcastChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Cache.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Cache.java index 437c2518835..fe899e86bc4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Cache.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/CacheStorage.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/CacheStorage.java index bcdc6081b50..285b7fb89b0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/CacheStorage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/CacheStorage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRect.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRect.java index 43e75ed4f79..cfc3b9fce50 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRect.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -32,7 +31,7 @@ * @author Ronald Brill * @see MSDN Documentation */ -@JsxClass({IE, EDGE}) +@JsxClass(IE) @JsxClass(className = "DOMRect", value = {CHROME, FF}) public class ClientRect extends SimpleScriptable { @@ -44,7 +43,7 @@ public class ClientRect extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public ClientRect() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRectList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRectList.java index c1656045f58..05772654c26 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRectList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ClientRectList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLIENTRECTLIST_DEFAUL_VALUE_FROM_FIRST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLIENTRECTLIST_THROWS_IF_ITEM_NOT_FOUND; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -39,9 +38,8 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass(className = "DOMRectList", isJSObject = false, value = CHROME) -@JsxClass(isJSObject = false, value = FF) -@JsxClass({IE, EDGE}) +@JsxClass(className = "DOMRectList", value = {CHROME, FF}) +@JsxClass(IE) public class ClientRectList extends SimpleScriptable { private final List clientRects_; @@ -49,7 +47,7 @@ public class ClientRectList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public ClientRectList() { clientRects_ = new ArrayList<>(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Console.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Console.java index ef349f63987..748289ebe0e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Console.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Console.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CONSOLE_HANDLE_WINDOW; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -31,16 +30,17 @@ import com.gargoylesoftware.htmlunit.WebWindow; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import net.sourceforge.htmlunit.corejs.javascript.BaseFunction; +import net.sourceforge.htmlunit.corejs.javascript.ConsString; import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.Delegator; import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.NativeArray; import net.sourceforge.htmlunit.corejs.javascript.NativeFunction; import net.sourceforge.htmlunit.corejs.javascript.NativeObject; +import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; @@ -50,7 +50,7 @@ * @author Andrea Martino */ @JsxClass(isJSObject = false, value = {FF, CHROME}) -@JsxClass({IE, EDGE}) +@JsxClass(IE) public class Console extends SimpleScriptable { private static final Map TIMERS = new HashMap<>(); @@ -61,7 +61,6 @@ public class Console extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor(EDGE) public Console() { } @@ -73,6 +72,44 @@ public void setWebWindow(final WebWindow webWindow) { webWindow_ = webWindow; } + /** + * This method writes an error message to the console if the + * assertion is false. If the assertion is true, nothing happens. + * @param cx the JavaScript context + * @param thisObj the scriptable + * @param args the arguments passed into the method + * @param funObj the function + */ + @JsxFunction(functionName = "assert") + public static void assertMethod(final Context cx, final Scriptable thisObj, + final Object[] args, final Function funObj) { + if (args.length < 1 || ScriptRuntime.toBoolean(args[0])) { + return; + } + + if (args.length == 1) { + log(cx, thisObj, new String[] {"Assertion failed"}, null); + return; + } + + final Object[] data; + final Object first = args[1]; + if (first instanceof String + || first instanceof ConsString + || first instanceof ScriptableObject && ("String".equals(((Scriptable) first).getClassName()))) { + data = new Object[args.length - 1]; + data[0] = "Assertion failed: " + first.toString(); + System.arraycopy(args, 2, data, 1, data.length - 1); + } + else { + data = new Object[args.length]; + data[0] = "Assertion failed:"; + System.arraycopy(args, 1, data, 1, data.length - 1); + } + + log(cx, thisObj, data, null); + } + /** * This method performs logging to the console at {@code log} level. * @param cx the JavaScript context @@ -287,7 +324,7 @@ public void timeStamp(final String label) { private static class ConsoleFormatter implements Formatter { private static void appendNativeArray(final NativeArray a, final StringBuilder sb, final int level) { - sb.append("["); + sb.append('['); if (level < 3) { for (int i = 0; i < a.size(); i++) { if (i > 0) { @@ -299,7 +336,7 @@ private static void appendNativeArray(final NativeArray a, final StringBuilder s } } } - sb.append("]"); + sb.append(']'); } private static void appendNativeObject(final NativeObject obj, final StringBuilder sb, final int level) { @@ -308,9 +345,9 @@ private static void appendNativeObject(final NativeObject obj, final StringBuild // root level Firefox puts brackets outside it. This is not the // case when a native object is printed as part of an array or // inside another object. - sb.append("("); + sb.append('('); } - sb.append("{"); + sb.append('{'); if (level < 3) { final Object[] ids = obj.getIds(); if (ids != null && ids.length > 0) { @@ -320,15 +357,15 @@ private static void appendNativeObject(final NativeObject obj, final StringBuild sb.append(", "); } sb.append(key); - sb.append(":"); + sb.append(": "); appendValue(obj.get(key), sb, level + 1); needsSeparator = true; } } } - sb.append("}"); + sb.append('}'); if (level == 0) { - sb.append(")"); + sb.append(')'); } } @@ -349,13 +386,13 @@ private static void appendNativeObject(final NativeObject obj, final StringBuild */ private static void appendValue(final Object val, final StringBuilder sb, final int level) { if (val instanceof NativeFunction) { - sb.append("("); + sb.append('('); // Remove unnecessary new lines and spaces from the function final Pattern p = Pattern.compile("[ \\t]*\\r?\\n[ \\t]*", Pattern.MULTILINE); final Matcher m = p.matcher(((NativeFunction) val).toString()); sb.append(m.replaceAll(" ").trim()); - sb.append(")"); + sb.append(')'); } else if (val instanceof BaseFunction) { sb.append("function "); @@ -372,7 +409,7 @@ else if (val instanceof Delegator) { if (level == 0) { sb.append("[object "); sb.append(((Delegator) val).getDelegee().getClassName()); - sb.append("]"); + sb.append(']'); } else { sb.append("({})"); @@ -382,7 +419,7 @@ else if (val instanceof SimpleScriptable) { if (level == 0) { sb.append("[object "); sb.append(((SimpleScriptable) val).getClassName()); - sb.append("]"); + sb.append(']'); } else { sb.append("({})"); @@ -415,7 +452,7 @@ else if (val instanceof Number) { */ private static String quote(final CharSequence s) { final StringBuilder sb = new StringBuilder(); - sb.append("\""); + sb.append('\"'); for (int i = 0; i < s.length(); i++) { final char ch = s.charAt(i); switch (ch) { @@ -449,7 +486,7 @@ private static String quote(final CharSequence s) { } } } - sb.append("\""); + sb.append('\"'); return sb.toString(); } @@ -497,7 +534,7 @@ public String parameterAsString(final Object o) { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < ((NativeArray) o).size(); i++) { if (i > 0) { - sb.append(","); + sb.append(','); } sb.append(formatToString(((NativeArray) o).get(i))); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java index 78140a3b28d..67fe975eb5a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,7 @@ import java.util.Date; import java.util.Locale; -import java.util.TimeZone; -import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.FastDateFormat; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -39,9 +37,8 @@ */ public final class DateCustom { - private static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone("UTC"); - - private DateCustom() { } + private DateCustom() { + } /** * Converts a date to a string, returning the "date" portion using the operating system's locale's conventions. @@ -94,20 +91,6 @@ public static String toLocaleTimeString( return format.format(getDateValue(thisObj)); } - /** - * Converts a date to a UTC string. Special version for IE - * @param context the JavaScript context - * @param thisObj the scriptable - * @param args the arguments passed into the method - * @param function the function - * @return converted string - */ - public static String toUTCString( - final Context context, final Scriptable thisObj, final Object[] args, final Function function) { - final Date date = new Date(getDateValue(thisObj)); - return DateFormatUtils.format(date, "EEE, d MMM yyyy HH:mm:ss z", UTC_TIME_ZONE, Locale.ENGLISH); - } - 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/com/gargoylesoftware/htmlunit/javascript/host/Element.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java index 0ef97199d99..8d5ca2e6279 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,16 +17,14 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_BOUNDINGCLIENTRECT_THROWS_IF_DISCONNECTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ELEMENT_GET_ATTRIBUTE_RETURNS_EMPTY; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_HTML_ADD_CHILD_FOR_NULL_VALUE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_CR_NL; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_LF; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OUTER_HTML_NULL_AS_STRING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OUTER_HTML_REMOVES_CHILDREN_FOR_DETACHED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OUTER_HTML_THROWS_FOR_DETACHED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.QUERYSELECTORALL_NOT_IN_QUIRKS; import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.IOException; @@ -46,7 +44,6 @@ import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomText; -import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlElement.DisplayStyle; import com.gargoylesoftware.htmlunit.javascript.NamedNodeMap; @@ -304,7 +301,7 @@ public boolean hasAttribute(final String name) { * {@inheritDoc} */ @Override - @JsxFunction({CHROME, FF, EDGE}) + @JsxFunction({CHROME, FF}) public boolean hasAttributes() { return super.hasAttributes(); } @@ -427,7 +424,7 @@ public void setDefaults(final ComputedCSSStyleDeclaration style) { * {@inheritDoc} */ @Override - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public HTMLCollection getChildren() { return super.getChildren(); } @@ -436,7 +433,7 @@ public HTMLCollection getChildren() { * Gets the token list of class attribute. * @return the token list of class attribute */ - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public DOMTokenList getClassList() { return new DOMTokenList(this, "class"); } @@ -657,7 +654,7 @@ protected boolean isMatching(final DomNode node) { return false; } String classAttribute = ((HtmlElement) node).getAttributeDirect("class"); - if (classAttribute == DomElement.ATTRIBUTE_NOT_DEFINED) { + if (classAttribute == ATTRIBUTE_NOT_DEFINED) { return false; // probably better performance as most of elements won't have a class attribute } @@ -733,7 +730,7 @@ protected TextRange createTextRange() { * * @see MSDN */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public Object insertAdjacentElement(final String where, final Object insertedElement) { if (insertedElement instanceof Node) { final DomNode childNode = ((Node) insertedElement).getDomNodeOrDie(); @@ -760,7 +757,7 @@ public Object insertAdjacentElement(final String where, final Object insertedEle * * @see MSDN */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public void insertAdjacentText(final String where, final String text) { final Object[] values = getInsertAdjacentLocation(where); final DomNode node = (DomNode) values[0]; @@ -866,7 +863,7 @@ public void insertAdjacentHTML(final String position, final String text) { */ private static void parseHtmlSnippet(final DomNode target, final String source) { try { - HTMLParser.parseFragment(target, source); + target.getPage().getWebClient().getPageCreator().getHtmlParser().parseFragment(target, source); } catch (final IOException e) { LogFactory.getLog(HtmlElement.class).error("Unexpected exception occurred while parsing HTML snippet", e); @@ -913,10 +910,10 @@ public void setInnerHTML(final Object value) { } domNode.removeAllChildren(); + getWindow().clearComputedStylesUpToRoot(this); final boolean addChildForNull = getBrowserVersion().hasFeature(JS_INNER_HTML_ADD_CHILD_FOR_NULL_VALUE); if ((value == null && addChildForNull) || (value != null && !"".equals(value))) { - final String valueAsString = Context.toString(value); parseHtmlSnippet(domNode, valueAsString); } @@ -1036,7 +1033,7 @@ else if (html) { if (scriptObject instanceof HTMLElement) { htmlElement = scriptObject; } - builder.append("<").append(tag); + builder.append('<').append(tag); // Add the attributes. IE does not use quotes, FF does. for (final DomAttr attr : element.getAttributesMap().values()) { if (!attr.getSpecified()) { @@ -1045,27 +1042,27 @@ else if (html) { final String name = attr.getName(); final String value = PRINT_NODE_QUOTE_PATTERN.matcher(attr.getValue()).replaceAll("""); - builder.append(' ').append(name).append("="); - builder.append("\""); + builder.append(' ').append(name).append('='); + builder.append('\"'); builder.append(value); - builder.append("\""); + builder.append('\"'); } - builder.append(">"); + builder.append('>'); // Add the children. final boolean isHtml = html && !(scriptObject instanceof HTMLScriptElement) && !(scriptObject instanceof HTMLStyleElement); printChildren(builder, node, isHtml); if (null == htmlElement || !htmlElement.isEndTagForbidden()) { - builder.append(""); + builder.append("'); } } else { if (node instanceof HtmlElement) { final HtmlElement element = (HtmlElement) node; if ("p".equals(element.getTagName())) { - if (getBrowserVersion().hasFeature(JS_INNER_TEXT_CR_NL)) { - builder.append("\r\n"); // \r\n because it's to implement something IE specific + if (getBrowserVersion().hasFeature(JS_INNER_TEXT_LF)) { + builder.append('\n'); // \r\n because it's to implement something IE specific } else { int i = builder.length() - 1; @@ -1073,7 +1070,7 @@ else if (html) { i--; } builder.setLength(i + 1); - builder.append("\n"); + builder.append('\n'); } } if (!"script".equals(element.getTagName())) { @@ -1096,13 +1093,14 @@ protected boolean isEndTagForbidden() { * Returns the element ID. * @return the ID of this element */ - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public String getId() { return getDomNodeOrDie().getId(); } /** - * {@inheritDoc} + * Sets the id value for this element. + * @param newId the newId value for this element */ @JsxSetter({CHROME, FF}) public void setId(final String newId) { @@ -1228,20 +1226,24 @@ protected void setStyle(final String style) { * is just to prevent scripts that call that method from failing */ @JsxFunction({CHROME, FF}) - public void scrollIntoView() { /* do nothing at the moment */ } + public void scrollIntoView() { + /* do nothing at the moment */ + } /** * Implement the {@code scrollIntoViewIfNeeded()} JavaScript function but don't actually do * anything. */ @JsxFunction(CHROME) - public void scrollIntoViewIfNeeded() { /* do nothing at the moment */ } + public void scrollIntoViewIfNeeded() { + /* do nothing at the moment */ + } /** * {@inheritDoc} */ @Override - @JsxGetter({CHROME, FF52, EDGE}) + @JsxGetter({CHROME, FF}) public Object getPrefix() { return super.getPrefix(); } @@ -1250,7 +1252,7 @@ public Object getPrefix() { * {@inheritDoc} */ @Override - @JsxGetter({CHROME, FF52, EDGE}) + @JsxGetter({CHROME, FF}) public Object getLocalName() { return super.getLocalName(); } @@ -1259,7 +1261,7 @@ public Object getLocalName() { * {@inheritDoc} */ @Override - @JsxGetter({CHROME, FF52, EDGE}) + @JsxGetter({CHROME, FF}) public Object getNamespaceURI() { return super.getNamespaceURI(); } @@ -1448,7 +1450,6 @@ public void setOnwebkitfullscreenerror(final Object onwebkitfullscreenerror) { * Returns the {@code onwheel} event handler for this element. * @return the {@code onwheel} event handler for this element */ - @JsxGetter({CHROME, FF}) public Function getOnwheel() { return getEventHandler("wheel"); } @@ -1457,7 +1458,6 @@ public Function getOnwheel() { * Sets the {@code onwheel} event handler for this element. * @param onwheel the {@code onwheel} event handler for this element */ - @JsxSetter({CHROME, FF}) public void setOnwheel(final Object onwheel) { setEventHandler("wheel", onwheel); } @@ -1952,11 +1952,30 @@ public void setOnpointerup(final Object onpointerup) { * {@inheritDoc} */ @Override - @JsxFunction({CHROME, FF, EDGE}) + @JsxFunction({CHROME, FF}) public void remove() { super.remove(); } + /** + * Mock for the moment. + * @param retargetToElement if true, all events are targeted directly to this element; + * if false, events can also fire at descendants of this element + */ + @JsxFunction(FF) + public void setCapture(final boolean retargetToElement) { + // empty + } + + /** + * Mock for the moment. + * @return true for success + */ + @JsxFunction(FF) + public boolean releaseCapture() { + return true; + } + /** * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, * just before this ChildNode. @@ -2006,7 +2025,7 @@ public static void replaceWith(final Context context, final Scriptable thisObj, * @param function the function * @return the value */ - @JsxFunction({CHROME, FF, EDGE}) + @JsxFunction({CHROME, FF}) public static boolean matches( final Context context, final Scriptable thisObj, final Object[] args, final Function function) { final String selectorString = (String) args[0]; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/External.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/External.java index 5eb743df823..084b1eeda26 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/External.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/External.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,8 @@ */ package com.gargoylesoftware.htmlunit.javascript.host; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IS_SEARCH_PROVIDER_INSTALLED_ZERO; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -22,6 +23,8 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; +import net.sourceforge.htmlunit.corejs.javascript.Undefined; + /** * A JavaScript object for {@code External}. * @@ -29,7 +32,7 @@ * @author Ronald Brill * @author Ahmed Ashour */ -@JsxClass(FF) +@JsxClass(CHROME) @JsxClass(isJSObject = false) public class External extends SimpleScriptable { @@ -43,16 +46,16 @@ public External() { /** * Empty implementation. */ - @JsxFunction(IE) - public void AutoCompleteSaveForm() { + @JsxFunction(value = IE, functionName = "AutoCompleteSaveForm") + public void autoCompleteSaveForm() { // dummy } /** * Empty implementation. */ - @JsxFunction - public void AddSearchProvider() { + @JsxFunction(functionName = "AddSearchProvider") + public void addSearchProvider() { // dummy } @@ -60,8 +63,11 @@ public void AddSearchProvider() { * Empty implementation. * @return 0 */ - @JsxFunction - public int IsSearchProviderInstalled() { - return 0; + @JsxFunction(functionName = "IsSearchProviderInstalled") + public Object isSearchProviderInstalled() { + if (getBrowserVersion().hasFeature(JS_IS_SEARCH_PROVIDER_INSTALLED_ZERO)) { + return 0; + } + return Undefined.instance; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFace.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFace.java index d2a809ead09..b666e8d186c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFace.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFaceSet.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFaceSet.java index 00b67edd02d..28862c81ebe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFaceSet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/FontFaceSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Gamepad.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Gamepad.java index 3aaa10d9155..8f92e9d2369 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Gamepad.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Gamepad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class Gamepad extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/GamepadButton.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/GamepadButton.java index 631231f62b9..e09063093d6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/GamepadButton.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/GamepadButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class GamepadButton extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java index a665b3288bd..edc2941ec43 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/History.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import java.io.IOException; import java.net.MalformedURLException; @@ -56,7 +54,7 @@ public class History extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public History() { } @@ -168,7 +166,7 @@ public void pushState(final Object object, final String title, final String url) * Returns the {@code scrollRestoration} property. * @return the {@code scrollRestoration} property */ - @JsxGetter({CHROME, FF52}) + @JsxGetter({CHROME, FF}) public String getScrollRestoration() { return scrollRestoration_; } @@ -176,7 +174,7 @@ public String getScrollRestoration() { /** * @param scrollRestoration the new value */ - @JsxSetter({CHROME, FF52}) + @JsxSetter({CHROME, FF}) public void setScrollRestoration(final String scrollRestoration) { if (SCROLL_RESTAURATION_AUTO.equals(scrollRestoration)) { scrollRestoration_ = SCROLL_RESTAURATION_AUTO; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ImageBitmap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ImageBitmap.java index b03c493d2bd..2ea66d44b54 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ImageBitmap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ImageBitmap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/InstallTrigger.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/InstallTrigger.java index 0501df6287e..52a3b69d52f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/InstallTrigger.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/InstallTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java index a28980ceb77..1ccc9e8b156 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Iterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,20 +14,14 @@ */ package com.gargoylesoftware.htmlunit.javascript.host; -import java.util.function.Consumer; - import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import net.sourceforge.htmlunit.corejs.javascript.BaseFunction; import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.ES6Iterator; import net.sourceforge.htmlunit.corejs.javascript.FunctionObject; import net.sourceforge.htmlunit.corejs.javascript.NativeArray; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; -import net.sourceforge.htmlunit.corejs.javascript.SymbolKey; -import net.sourceforge.htmlunit.corejs.javascript.SymbolScriptable; import net.sourceforge.htmlunit.corejs.javascript.Undefined; /** @@ -58,9 +52,9 @@ public Iterator(final String className, final java.util.Iterator iterator) { public void setParentScope(final Scriptable scope) { super.setParentScope(scope); try { - final FunctionObject functionObject = new FunctionObject("next", getClass().getDeclaredMethod("next"), - scope); - defineProperty("next", functionObject, ScriptableObject.DONTENUM); + final FunctionObject functionObject = new FunctionObject(ES6Iterator.NEXT_METHOD, + getClass().getDeclaredMethod(ES6Iterator.NEXT_METHOD), scope); + defineProperty(ES6Iterator.NEXT_METHOD, functionObject, ScriptableObject.DONTENUM); } catch (final Exception e) { Context.throwAsScriptRuntimeEx(e); @@ -98,89 +92,8 @@ public Object getDefaultValue(final Class hint) { value = Undefined.instance; done = true; } - object.defineProperty("done", done, ScriptableObject.EMPTY); - object.defineProperty("value", value, ScriptableObject.EMPTY); + object.defineProperty(ES6Iterator.VALUE_PROPERTY, value, ScriptableObject.EMPTY); + object.defineProperty(ES6Iterator.DONE_PROPERTY, done, ScriptableObject.EMPTY); return object; } - - /** - * Helper to support objects implementing the iterator interface. - * - * @param context the Context - * @param thisObj the this Object - * @param scriptable the scriptable - * @param processor the method to be called for every object - * @return true if @@iterator property was available - */ - public static boolean iterate(final Context context, - final Scriptable thisObj, - final Scriptable scriptable, - final Consumer processor) { - - if (scriptable instanceof ES6Iterator) { - ScriptableObject next = (ScriptableObject) ScriptableObject.callMethod(scriptable, "next", null); - boolean done = (boolean) next.get(ES6Iterator.DONE_PROPERTY); - Object value = next.get(ES6Iterator.VALUE_PROPERTY); - - while (!done) { - processor.accept(value); - - next = (ScriptableObject) ScriptableObject.callMethod(scriptable, "next", null); - done = (boolean) next.get(ES6Iterator.DONE_PROPERTY); - value = next.get(ES6Iterator.VALUE_PROPERTY); - } - return true; - } - - if (!(scriptable instanceof SymbolScriptable)) { - return false; - } - final Object iterator = ((SymbolScriptable) scriptable).get(SymbolKey.ITERATOR, scriptable); - if (iterator == Scriptable.NOT_FOUND) { - return false; - } - - final Object obj = ((BaseFunction) iterator).call(context, thisObj.getParentScope(), scriptable, new Object[0]); - - if (obj instanceof Iterator) { - final Iterator it = (Iterator) obj; - SimpleScriptable next = it.next(); - boolean done = (boolean) next.get(ES6Iterator.DONE_PROPERTY); - Object value = next.get(ES6Iterator.VALUE_PROPERTY); - - while (!done) { - processor.accept(value); - - next = it.next(); - done = (boolean) next.get(ES6Iterator.DONE_PROPERTY); - value = next.get(ES6Iterator.VALUE_PROPERTY); - } - return true; - } - if (obj instanceof Scriptable) { - // handle user defined iterator - final Scriptable scriptableIterator = (Scriptable) obj; - final Object nextFunct = scriptableIterator.get(ES6Iterator.NEXT_METHOD, (Scriptable) obj); - if (!(nextFunct instanceof BaseFunction)) { - throw ScriptRuntime.typeError("undefined is not a function"); - } - final Object nextObj = ((BaseFunction) nextFunct) - .call(context, thisObj.getParentScope(), scriptableIterator, new Object[0]); - - ScriptableObject next = (ScriptableObject) nextObj; - boolean done = (boolean) next.get(ES6Iterator.DONE_PROPERTY); - Object value = next.get(ES6Iterator.VALUE_PROPERTY); - - while (!done) { - processor.accept(value); - - next = (ScriptableObject) ((BaseFunction) nextFunct) - .call(context, thisObj.getParentScope(), scriptableIterator, new Object[0]); - done = (boolean) next.get(ES6Iterator.DONE_PROPERTY); - value = next.get(ES6Iterator.VALUE_PROPERTY); - } - return true; - } - return false; - } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java index 1c078d839b0..fbe5a36f3bd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Location.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,9 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LOCATION_HASH_IS_DECODED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LOCATION_HASH_RETURNS_HASH_FOR_EMPTY_DEFINED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LOCATION_HREF_HASH_IS_ENCODED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LOCATION_RELOAD_REFERRER; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.URL_ABOUT_BLANK_HAS_BLANK_PATH; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.URL_ABOUT_BLANK_HAS_EMPTY_PATH; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.io.IOException; @@ -87,7 +86,7 @@ public class Location extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Location() { } @@ -137,12 +136,10 @@ public void reload(final boolean force) throws IOException { final HtmlPage htmlPage = (HtmlPage) getWindow(getStartingScope()).getWebWindow().getEnclosedPage(); final WebRequest request = htmlPage.getWebResponse().getWebRequest(); - String referer = htmlPage.getUrl().toExternalForm(); - request.setAdditionalHeader(HttpHeader.REFERER, referer); - - referer = UrlUtils.getUrlWithNewQuery(htmlPage.getUrl(), null).toExternalForm(); - referer = StringUtils.stripEnd(referer, "/"); - request.setAdditionalHeader(HttpHeader.ORIGIN, referer); + if (getBrowserVersion().hasFeature(JS_LOCATION_RELOAD_REFERRER)) { + final String referer = htmlPage.getUrl().toExternalForm(); + request.setAdditionalHeader(HttpHeader.REFERER, referer); + } final WebWindow webWindow = window_.getWebWindow(); webWindow.getWebClient().download(webWindow, "", request, true, false, "JS location.reload"); @@ -243,7 +240,9 @@ public void setHref(final String newLocation) throws IOException { webWindow.getWebClient().download(webWindow, "", request, true, false, "JS set location"); } catch (final MalformedURLException e) { - LOG.error("setHref('" + newLocation + "') got MalformedURLException", e); + if (LOG.isErrorEnabled()) { + LOG.error("setHref('" + newLocation + "') got MalformedURLException", e); + } throw e; } } @@ -432,9 +431,6 @@ public void setHost(final String host) throws Exception { @JsxGetter public String getPathname() { if (WebClient.URL_ABOUT_BLANK == getUrl()) { - if (getBrowserVersion().hasFeature(URL_ABOUT_BLANK_HAS_EMPTY_PATH)) { - return ""; - } if (getBrowserVersion().hasFeature(URL_ABOUT_BLANK_HAS_BLANK_PATH)) { return "blank"; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Map.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Map.java deleted file mode 100644 index b5539a3eb9a..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Map.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host; - -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MAP_CONSTRUCTOR_IGNORE_ARGUMENT; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; - -import java.util.LinkedHashMap; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnly; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnlyStatus; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.Delegator; -import net.sourceforge.htmlunit.corejs.javascript.Function; -import net.sourceforge.htmlunit.corejs.javascript.NativeArray; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; -import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; -import net.sourceforge.htmlunit.corejs.javascript.Symbol; -import net.sourceforge.htmlunit.corejs.javascript.SymbolKey; -import net.sourceforge.htmlunit.corejs.javascript.SymbolScriptable; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * A JavaScript object for {@code Map}. - * - * @author Ahmed Ashour - * @author Ronald Brill - */ -@JsxClass -public class Map extends SimpleScriptable implements SymbolScriptable { - - private static final String MAP_ITERATOR_NAME = "Map Iterator"; - private static Iterator ITERATOR_PROTOTYPE_; - private java.util.Map map_ = new LinkedHashMap<>(); - - /** - * Creates an instance. - */ - public Map() { - } - - /** - * Creates an instance. - * @param arrayLike an Array or other iterable object - */ - @JsxConstructor - public Map(final Object arrayLike) { - if (arrayLike == Undefined.instance) { - return; - } - - final Context context = Context.getCurrentContext(); - final Window window = (Window) ScriptRuntime.getTopCallScope(context); - if (window.getBrowserVersion().hasFeature(JS_MAP_CONSTRUCTOR_IGNORE_ARGUMENT)) { - return; - } - - if (arrayLike instanceof NativeArray) { - final NativeArray array = (NativeArray) arrayLike; - for (int i = 0; i < array.getLength(); i++) { - final Object entryObject = array.get(i); - if (entryObject instanceof NativeArray) { - final Object[] entry = toArray((NativeArray) entryObject); - if (entry.length > 0) { - final Object key = entry[0]; - final Object value = entry.length > 1 ? entry[1] : null; - set(key, value); - } - } - else { - throw Context.reportRuntimeError("TypeError: object is not iterable (" - + entryObject.getClass().getName() + ")"); - } - } - return; - } - - if (arrayLike instanceof Map) { - final Map map = (Map) arrayLike; - map_.putAll(map.map_); - return; - } - - if (arrayLike instanceof Scriptable) { - final Scriptable scriptable = (Scriptable) arrayLike; - if (Iterator.iterate(Context.getCurrentContext(), this, scriptable, - value -> { - if (Undefined.instance != value && value instanceof NativeArray) { - final Object[] entry = toArray((NativeArray) value); - if (entry.length > 0) { - final Object key = entry[0]; - if (Undefined.instance != key) { - final Object entryValue = entry.length > 1 ? entry[1] : null; - set(key, entryValue); - } - } - } - else { - throw Context.reportRuntimeError("TypeError: object is not iterable (" - + value.getClass().getName() + ")"); - } - })) { - return; - } - } - - throw Context.reportRuntimeError("TypeError: object is not iterable (" + arrayLike.getClass().getName() + ")"); - } - - /** - * Replacement of {@link NativeArray#toArray()}. - */ - private static Object[] toArray(final NativeArray narray) { - final long longLen = narray.getLength(); - if (longLen > Integer.MAX_VALUE) { - throw new IllegalStateException(); - } - - final int len = (int) longLen; - final Object[] arr = new Object[len]; - for (int i = 0; i < len; i++) { - arr[i] = ScriptableObject.getProperty(narray, i); - } - return arr; - } - - /** - * Returns the size. - * @return the size - */ - @JsxGetter - @CanSetReadOnly(CanSetReadOnlyStatus.IGNORE) - public int getSize() { - return map_.size(); - } - - /** - * Returns the value of the given key. - * @param key the key - * @return the value - */ - @Override - @JsxFunction - public Object get(final Object key) { - Object o = map_.get(key); - if (o == null) { - o = Undefined.instance; - } - return o; - } - - /** - * Adds the specified pair. - * @param key the key - * @param value the value - * @return the Map object. - */ - @JsxFunction - public Map set(Object key, final Object value) { - if (key instanceof Delegator) { - key = ((Delegator) key).getDelegee(); - } - if (key == NOT_FOUND) { - key = Undefined.instance; - } - map_.put(key, value); - return this; - } - - /** - * Removes all elements. - */ - @JsxFunction - public void clear() { - map_.clear(); - } - - /** - * Removed the specified element. - * @param key the key - * @return whether the element has been successfully removed - */ - @JsxFunction - public boolean delete(final Object key) { - return map_.remove(key) != null; - } - - /** - * Returns whether an element with the specified key exists or not. - * @param key the key - * @return whether the element exists or not - */ - @JsxFunction - public boolean has(final Object key) { - return map_.remove(key) != null; - } - - /** - * Returns a new {@code Iterator} object that contains the {@code [key, value]} pairs for each element in the - * Map object in insertion order. - * @return a new {@code Iterator} object - */ - @JsxFunction({CHROME, FF, EDGE}) - public Object entries() { - final SimpleScriptable object = new Iterator(MAP_ITERATOR_NAME, map_.entrySet().iterator()); - object.setParentScope(getParentScope()); - setIteratorPrototype(object); - return object; - } - - /** - * Returns a new {@code Iterator} object that contains the keys for each element in the Map object - * in insertion order. - * @return a new {@code Iterator} object - */ - @JsxFunction({CHROME, FF, EDGE}) - public Object keys() { - final SimpleScriptable object = new Iterator(MAP_ITERATOR_NAME, map_.keySet().iterator()); - object.setParentScope(getParentScope()); - setIteratorPrototype(object); - return object; - } - - /** - * Returns a new {@code Iterator} object that contains the values for each element in the Map object - * in insertion order. - * @return a new {@code Iterator} object - */ - @JsxFunction({CHROME, FF, EDGE}) - public Object values() { - final SimpleScriptable object = new Iterator(MAP_ITERATOR_NAME, map_.values().iterator()); - object.setParentScope(getParentScope()); - setIteratorPrototype(object); - return object; - } - - private static void setIteratorPrototype(final Scriptable scriptable) { - if (ITERATOR_PROTOTYPE_ == null) { - ITERATOR_PROTOTYPE_ = new Iterator(MAP_ITERATOR_NAME, null); - } - scriptable.setPrototype(ITERATOR_PROTOTYPE_); - } - - /** - * Executes a provided function once per each value in the {@link Map} object, in insertion order. - * @param callback {@link Function} to execute for each element. - * @param thisArg Value to use as this when executing callback (optional) - */ - @JsxFunction - public void forEach(final Function callback, final Object thisArg) { - if (getBrowserVersion().hasFeature(JS_MAP_CONSTRUCTOR_IGNORE_ARGUMENT)) { - return; - } - - final Scriptable thisArgument; - if (thisArg instanceof Scriptable) { - thisArgument = (Scriptable) thisArg; - } - else { - thisArgument = getWindow(); - } - - for (final java.util.Map.Entry entry : map_.entrySet()) { - callback.call(Context.getCurrentContext(), getParentScope(), thisArgument, - new Object[] {entry.getValue(), entry.getKey(), this}); - } - } - - /** - * {@inheritDoc} - */ - @Override - public Object get(final Symbol key, final Scriptable start) { - if (SymbolKey.ITERATOR.equals(key)) { - return ScriptableObject.getProperty(start, "entries"); - } - return super.get(key, start); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean has(final Symbol key, final Scriptable start) { - if (SymbolKey.ITERATOR.equals(key)) { - return true; - } - return super.has(key, start); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageChannel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageChannel.java index 6dd14dffb6d..4e53c9ca409 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageChannel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessageChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java index 77b95993465..4e1c02bffcf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MessagePort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.net.URL; @@ -31,10 +30,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; import com.gargoylesoftware.htmlunit.javascript.host.event.MessageEvent; -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.ContextFactory; -import net.sourceforge.htmlunit.corejs.javascript.Function; /** * A JavaScript object for {@code MessagePort}. @@ -49,7 +45,7 @@ public class MessagePort extends EventTarget { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MessagePort() { } @@ -84,10 +80,7 @@ private Object getHandlerForJavaScript(final String eventName) { } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler == null || handler instanceof Function) { - getEventListenersContainer().setEventHandler(eventName, handler); - } - // Otherwise, fail silently. + getEventListenersContainer().setEventHandler(eventName, handler); } /** @@ -112,15 +105,8 @@ public void postMessage(final String message, final Object transfer) { final PostponedAction action = new PostponedAction(w.getWebWindow().getEnclosedPage()) { @Override public void execute() throws Exception { - final ContextAction contextAction = new ContextAction() { - @Override - public Object run(final Context cx) { - return port1_.dispatchEvent(event); - } - }; - final ContextFactory cf = jsEngine.getContextFactory(); - cf.call(contextAction); + cf.call(cx -> port1_.dispatchEvent(event)); } }; jsEngine.addPostponedAction(action); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeType.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeType.java index 8450f6f9e42..cb717446bf3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeType.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -42,7 +41,7 @@ public class MimeType extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MimeType() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeTypeArray.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeTypeArray.java index 154b50b02c0..1a5b0724510 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeTypeArray.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/MimeTypeArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -35,7 +34,7 @@ public class MimeTypeArray extends SimpleArray { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MimeTypeArray() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Namespace.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Namespace.java index 746f649bbc9..c0c2142fe56 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Namespace.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Namespace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NamespaceCollection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NamespaceCollection.java index a4cae66f32b..e53739cacc4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NamespaceCollection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NamespaceCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NativeFunctionPrefixResolver.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NativeFunctionPrefixResolver.java index 1acc109b733..50bc4460937 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NativeFunctionPrefixResolver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NativeFunctionPrefixResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java index 6576e9d3b5f..505848bd0bf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NAVIGATOR_DO_NOT_TRACK_UNSPECIFIED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -51,7 +50,7 @@ public class Navigator extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Navigator() { } @@ -159,7 +158,7 @@ public String getProduct() { * @see Mozilla Doc * @return false */ - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public String getProductSub() { return getBrowserVersion().getProductSub(); } @@ -293,7 +292,7 @@ public String getVendor() { * Returns the {@code vendorSub} property. * @return the {@code vendorSub} property */ - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public String getVendorSub() { return ""; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Netscape.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Netscape.java index 7f79e29081f..c8fa687af90 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Netscape.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Netscape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Notification.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Notification.java index 25f6bdd6f19..28b0af6d777 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Notification.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Notification.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NumberCustom.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NumberCustom.java index bbadd4952ce..1c651928b46 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NumberCustom.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/NumberCustom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,8 @@ */ public final class NumberCustom { - private NumberCustom() { } + private NumberCustom() { + } /** * Returns a string with a language sensitive representation of this number. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserver.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserver.java index 4600ccbb35c..6d933efd4e7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class PerformanceObserver extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserverEntryList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserverEntryList.java index eca8e6ec6de..276a681ce8d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserverEntryList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PerformanceObserverEntryList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class PerformanceObserverEntryList extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java index 4eea22aaf58..9bc17755745 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PermissionStatus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,8 +25,9 @@ * A JavaScript object for {@code PermissionStatus}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class PermissionStatus extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java index 58340450ae5..a6f1ddd6bd6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Permissions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,8 +25,9 @@ * A JavaScript object for {@code Permissions}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class Permissions extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Plugin.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Plugin.java index 00d22689189..24308bce858 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Plugin.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Plugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -41,7 +40,7 @@ public class Plugin extends SimpleArray { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Plugin() { } @@ -100,7 +99,7 @@ public String getName() { * Gets the plugin's version. * @return the name */ - @JsxGetter({IE, FF, EDGE}) + @JsxGetter({IE, FF}) public String getVersion() { return version_; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PluginArray.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PluginArray.java index ede52f38d22..755421de8af 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PluginArray.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PluginArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -36,7 +35,7 @@ public class PluginArray extends SimpleArray { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PluginArray() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Promise.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Promise.java index 470fcb8d457..2cc7afb62d1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Promise.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Promise.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.KEY_STARTING_SCOPE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.ArrayDeque; @@ -24,6 +23,9 @@ import java.util.Deque; import java.util.List; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory; +import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.background.BasicJavaScriptJob; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +35,9 @@ import net.sourceforge.htmlunit.corejs.javascript.BaseFunction; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.Function; +import net.sourceforge.htmlunit.corejs.javascript.IteratorLikeIterable; import net.sourceforge.htmlunit.corejs.javascript.JavaScriptException; import net.sourceforge.htmlunit.corejs.javascript.NativeArray; import net.sourceforge.htmlunit.corejs.javascript.NativeObject; @@ -50,7 +54,7 @@ * @author Marc Guillemot * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class Promise extends SimpleScriptable { private enum PromiseState { PENDING, FULFILLED, REJECTED } @@ -86,7 +90,8 @@ public Promise(final Window window) { @JsxConstructor public Promise(final Object object) { if (!(object instanceof Function)) { - throw ScriptRuntime.typeError("Promise resolver is not a function"); + throw ScriptRuntime.typeError("Promise resolver '" + + ScriptRuntime.toString(object) + "' is not a function"); } final Function fun = (Function) object; @@ -178,7 +183,15 @@ private static Promise create(final Scriptable thisObj, final Object[] args, fin final Object arg = args[0]; if (arg instanceof NativeObject) { final NativeObject nativeObject = (NativeObject) arg; - promise = new Promise(nativeObject.get("then", nativeObject)); + final Object thenFunction = nativeObject.get("then", nativeObject); + if (thenFunction != NOT_FOUND) { + promise = new Promise(thenFunction); + } + else { + promise = new Promise(); + promise.value_ = arg; + promise.state_ = state; + } } else { promise = new Promise(); @@ -279,7 +292,7 @@ else if (promise.state_ == PromiseState.PENDING) { @JsxStaticFunction public static Promise all(final Context context, final Scriptable thisObj, final Object[] args, final Function function) { - return all(false, thisObj, args); + return all(false, context, thisObj, args); } /** @@ -295,37 +308,43 @@ public static Promise all(final Context context, final Scriptable thisObj, final @JsxStaticFunction public static Promise race(final Context context, final Scriptable thisObj, final Object[] args, final Function function) { - return all(true, thisObj, args); + return all(true, context, thisObj, args); } - private static Promise all(final boolean race, final Scriptable thisObj, final Object[] args) { + private static Promise all(final boolean race, + final Context context, final Scriptable thisObj, final Object[] args) { final Window window = getWindow(thisObj); final Promise returnPromise = new Promise(window); if (args.length == 0) { returnPromise.all_ = new Promise[0]; } - else if (args[0] instanceof NativeArray) { - final NativeArray array = (NativeArray) args[0]; - final int length = (int) array.getLength(); - returnPromise.all_ = new Promise[length]; - for (int i = 0; i < length; i++) { - final Object o = array.get(i); - if (o instanceof Promise) { - returnPromise.all_[i] = (Promise) o; - if (returnPromise.all_[i].dependentPromises_ == null) { - returnPromise.all_[i].dependentPromises_ = new ArrayList(2); + else { + // Call the "[Symbol.iterator]" property as a function. + final Object ito = ScriptRuntime.callIterator(args[0], context, window); + final ArrayList promises = new ArrayList<>(); + if (!Undefined.isUndefined(ito)) { + // run through all the iterated values and add them! + try (IteratorLikeIterable it = new IteratorLikeIterable(context, window, ito)) { + for (Object val : it) { + if (val instanceof Promise) { + final Promise promis = (Promise) val; + promises.add(promis); + if (promis.dependentPromises_ == null) { + promis.dependentPromises_ = new ArrayList(2); + } + promis.dependentPromises_.add(returnPromise); + } + else { + promises.add(create(thisObj, new Object[] {val}, PromiseState.FULFILLED)); + } } - returnPromise.all_[i].dependentPromises_.add(returnPromise); - } - else { - returnPromise.all_[i] = create(thisObj, new Object[] {o}, PromiseState.FULFILLED); } + + returnPromise.all_ = promises.toArray(new Promise[promises.size()]); } } - else { - // TODO - } + returnPromise.race_ = race; returnPromise.settleAll(window); @@ -350,68 +369,79 @@ public Promise then(final Object onFulfilled, final Object onRejected) { @Override public void run() { - final Context cx = Context.enter(); - try { - Function toExecute = null; - if (thisPromise.state_ == PromiseState.FULFILLED && onFulfilled instanceof Function) { - toExecute = (Function) onFulfilled; - } - else if (thisPromise.state_ == PromiseState.REJECTED && onRejected instanceof Function) { - toExecute = (Function) onRejected; - } - - try { - final Object callbackResult; - if (toExecute == null) { - final Promise dummy = new Promise(); - dummy.state_ = thisPromise.state_; - dummy.value_ = thisPromise.value_; - callbackResult = dummy; + final WebClient client = window.getWebWindow().getWebClient(); + final HtmlUnitContextFactory cf = ((JavaScriptEngine) client + .getJavaScriptEngine()).getContextFactory(); + + final ContextAction contextAction = new ContextAction() { + @Override + public Object run(final Context cx) { + Function toExecute = null; + if (thisPromise.state_ == PromiseState.FULFILLED && onFulfilled instanceof Function) { + toExecute = (Function) onFulfilled; } - else { - // KEY_STARTING_SCOPE maintains a stack of scopes - @SuppressWarnings("unchecked") - Deque stack = (Deque) cx.getThreadLocal(KEY_STARTING_SCOPE); - if (null == stack) { - stack = new ArrayDeque<>(); - cx.putThreadLocal(KEY_STARTING_SCOPE, stack); - } - stack.push(window); - try { - callbackResult = toExecute.call(cx, window, thisPromise, new Object[] {value_}); - } - finally { - stack.pop(); + else if (thisPromise.state_ == PromiseState.REJECTED && onRejected instanceof Function) { + toExecute = (Function) onRejected; + } + + try { + final Object callbackResult; + if (toExecute == null) { + final Promise dummy = new Promise(); + dummy.state_ = thisPromise.state_; + dummy.value_ = thisPromise.value_; + callbackResult = dummy; } + else { + // KEY_STARTING_SCOPE maintains a stack of scopes + @SuppressWarnings("unchecked") + Deque stack = (Deque) cx.getThreadLocal(KEY_STARTING_SCOPE); + if (null == stack) { + stack = new ArrayDeque<>(); + cx.putThreadLocal(KEY_STARTING_SCOPE, stack); + } + stack.push(window); + try { + if (ScriptRuntime.hasTopCall(cx)) { + callbackResult = toExecute.call(cx, window, thisPromise, new Object[] {value_}); + } + else { + callbackResult = ScriptRuntime.doTopCall(toExecute, cx, window, thisPromise, + new Object[] {value_}, cx.isStrictMode()); + } + } + finally { + stack.pop(); + } - window.getWebWindow().getWebClient().getJavaScriptEngine().processPostponedActions(); - } - if (callbackResult instanceof Promise) { - final Promise resultPromise = (Promise) callbackResult; - if (resultPromise.state_ == PromiseState.FULFILLED) { - returnPromise.settle(true, resultPromise.value_, window); + window.getWebWindow().getWebClient().getJavaScriptEngine().processPostponedActions(); } - else if (resultPromise.state_ == PromiseState.REJECTED) { - returnPromise.settle(false, resultPromise.value_, window); + if (callbackResult instanceof Promise) { + final Promise resultPromise = (Promise) callbackResult; + if (resultPromise.state_ == PromiseState.FULFILLED) { + returnPromise.settle(true, resultPromise.value_, window); + } + else if (resultPromise.state_ == PromiseState.REJECTED) { + returnPromise.settle(false, resultPromise.value_, window); + } + else { + if (resultPromise.dependentPromises_ == null) { + resultPromise.dependentPromises_ = new ArrayList(2); + } + resultPromise.dependentPromises_.add(returnPromise); + } } else { - if (resultPromise.dependentPromises_ == null) { - resultPromise.dependentPromises_ = new ArrayList(2); - } - resultPromise.dependentPromises_.add(returnPromise); + returnPromise.settle(true, callbackResult, window); } } - else { - returnPromise.settle(true, callbackResult, window); + catch (final JavaScriptException e) { + returnPromise.settle(false, e.getValue(), window); } + return null; } - catch (final JavaScriptException e) { - returnPromise.settle(false, e.getValue(), window); - } - } - finally { - Context.exit(); - } + }; + cf.call(contextAction); } /** {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushManager.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushManager.java index a9d39347769..1c052064502 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushManager.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscription.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscription.java index 7da0b20bd50..9ab0f549d61 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscription.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscriptionOptions.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscriptionOptions.java index 69b9c192a09..33d0a0f03e5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscriptionOptions.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/PushSubscriptionOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ReadableStream.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ReadableStream.java index e18a07c9af1..efc873bfb59 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ReadableStream.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ReadableStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code ReadableStream}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF68}) public class ReadableStream extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Reflect.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Reflect.java index 74a3fd593f1..f245335710a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Reflect.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Reflect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class Reflect extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Screen.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Screen.java index 9a8885cab25..3c92b0acb91 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Screen.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Screen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -44,7 +43,7 @@ public class Screen extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Screen() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ScreenOrientation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ScreenOrientation.java index 0cb6f6e3065..678e5c59313 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ScreenOrientation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/ScreenOrientation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java deleted file mode 100644 index 407c8a19d3a..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host; - -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SET_CONSTRUCTOR_IGNORE_ARGUMENT; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; - -import java.util.LinkedHashSet; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.Delegator; -import net.sourceforge.htmlunit.corejs.javascript.Function; -import net.sourceforge.htmlunit.corejs.javascript.NativeArray; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; -import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; -import net.sourceforge.htmlunit.corejs.javascript.Symbol; -import net.sourceforge.htmlunit.corejs.javascript.SymbolKey; -import net.sourceforge.htmlunit.corejs.javascript.SymbolScriptable; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * A JavaScript object for {@code Set}. - * - * @author Ahmed Ashour - * @author Ronald Brill - */ -@JsxClass -public class Set extends SimpleScriptable implements SymbolScriptable { - - private static final String SET_ITERATOR_NAME = "Set Iterator"; - private static Iterator ITERATOR_PROTOTYPE_; - private java.util.Set set_ = new LinkedHashSet<>(); - - /** - * Creates an instance. - */ - public Set() { - } - - /** - * Creates an instance. - * @param iterable an Array or other iterable object - */ - @JsxConstructor - public Set(final Object iterable) { - if (iterable == Undefined.instance) { - return; - } - - final Window window = (Window) ScriptRuntime.getTopCallScope(Context.getCurrentContext()); - if (window.getBrowserVersion().hasFeature(JS_SET_CONSTRUCTOR_IGNORE_ARGUMENT)) { - return; - } - - if (iterable instanceof NativeArray) { - final NativeArray array = (NativeArray) iterable; - for (int i = 0; i < array.getLength(); i++) { - add(ScriptableObject.getProperty(array, i)); - } - return; - } - - if (iterable instanceof ArrayBufferViewBase) { - final ArrayBufferViewBase array = (ArrayBufferViewBase) iterable; - for (int i = 0; i < array.getLength(); i++) { - add(ScriptableObject.getProperty(array, i)); - } - return; - } - - if (iterable instanceof String) { - final String string = (String) iterable; - for (int i = 0; i < string.length(); i++) { - add(String.valueOf(string.charAt(i))); - } - return; - } - - if (iterable instanceof Set) { - final Set set = (Set) iterable; - for (Object object : set.set_) { - add(object); - } - return; - } - - if (iterable instanceof Map) { - final Iterator iterator = (Iterator) ((Map) iterable).entries(); - - SimpleScriptable object = iterator.next(); - while (Undefined.instance != object.get("value", null)) { - add(object); - object = iterator.next(); - } - return; - } - - if (iterable instanceof Scriptable) { - final Scriptable scriptable = (Scriptable) iterable; - if (Iterator.iterate(Context.getCurrentContext(), this, scriptable, - value -> { - if (value != Undefined.instance) { - add(value); - } - })) { - return; - } - } - - throw Context.reportRuntimeError("TypeError: object is not iterable (" + iterable.getClass().getName() + ")"); - } - - /** - * Returns the size. - * @return the size - */ - @JsxGetter - public int getSize() { - return set_.size(); - } - - /** - * Adds the specified value. - * @param value the value - * @return the Set object. - */ - @JsxFunction - public Set add(Object value) { - if (value instanceof Delegator) { - value = ((Delegator) value).getDelegee(); - } - if (value == NOT_FOUND) { - value = Undefined.instance; - } - set_.add(value); - return this; - } - - /** - * Removes all elements. - */ - @JsxFunction - public void clear() { - set_.clear(); - } - - /** - * Removed the specified element. - * @param key the key - * @return whether the element has been successfully removed - */ - @JsxFunction - public boolean delete(final Object key) { - return set_.remove(key); - } - - /** - * Returns whether the specified element exists or not. - * @param value the value - * @return whether the element exists or not - */ - @JsxFunction - public boolean has(final Object value) { - return set_.contains(value); - } - - /** - * Returns a new {@code Iterator} object that contains the values for each element in the Set object - * in insertion order. - * @return a new {@code Iterator} object - */ - @JsxFunction({CHROME, FF, EDGE}) - public Object values() { - final SimpleScriptable object = new Iterator(SET_ITERATOR_NAME, set_.iterator()); - object.setParentScope(getParentScope()); - setIteratorPrototype(object); - return object; - } - - private static void setIteratorPrototype(final Scriptable scriptable) { - if (ITERATOR_PROTOTYPE_ == null) { - ITERATOR_PROTOTYPE_ = new Iterator(SET_ITERATOR_NAME, null); - } - scriptable.setPrototype(ITERATOR_PROTOTYPE_); - } - - /** - * Executes a provided function once per each value in the {@link Set} object, in insertion order. - * @param callback {@link Function} to execute for each element. - * @param thisArg Value to use as this when executing callback (optional) - */ - @JsxFunction - public void forEach(final Function callback, final Object thisArg) { - if (getBrowserVersion().hasFeature(JS_SET_CONSTRUCTOR_IGNORE_ARGUMENT)) { - return; - } - - final Scriptable thisArgument; - if (thisArg instanceof Scriptable) { - thisArgument = (Scriptable) thisArg; - } - else { - thisArgument = getWindow(); - } - for (final Object object : set_) { - callback.call(Context.getCurrentContext(), getParentScope(), thisArgument, - new Object[] {object, object, this}); - } - } - - /** - * {@inheritDoc} - */ - @Override - public Object get(final Symbol key, final Scriptable start) { - if (SymbolKey.ITERATOR.equals(key)) { - return ScriptableObject.getProperty(start, "values"); - } - return super.get(key, start); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean has(final Symbol key, final Scriptable start) { - if (SymbolKey.ITERATOR.equals(key)) { - return true; - } - return super.has(key, start); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SharedWorker.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SharedWorker.java index 91d6a4710bb..eea75bb520a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SharedWorker.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SharedWorker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SimpleArray.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SimpleArray.java index ae0caa1730c..d23b11e3a9b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SimpleArray.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/SimpleArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Storage.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Storage.java index 5c6c8efbfba..4a9b6b234e5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Storage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Storage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STORAGE_GET_FROM_ITEMS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STORAGE_PRESERVED_INCLUDED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.Arrays; @@ -51,7 +50,7 @@ public class Storage extends SimpleScriptable { /** * Public default constructor only for the prototype. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Storage() { store_ = null; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StorageManager.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StorageManager.java index 748af3502b0..036113c7604 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StorageManager.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StorageManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code StorageManager}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class StorageManager extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java index 35d986587a8..d9b2a304cea 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/StringCustom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host; -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.Function; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - /** * Contains some missing features of Rhino NativeString. * @@ -26,30 +22,6 @@ */ public final class StringCustom { - private StringCustom() { } - - /** - * Determines whether one string may be found within another string, - * returning true or false as appropriate. - * @param context the JavaScript context - * @param thisObj the scriptable - * @param args the arguments passed into the method - * @param function the function - * @return true or false - */ - public static boolean contains( - final Context context, final Scriptable thisObj, final Object[] args, final Function function) { - if (args.length < 1) { - return false; - } - final String string = Context.toString(thisObj); - final String search = Context.toString(args[0]); - - if (args.length < 2) { - return string.contains(search); - } - - final int start = (int) Math.max(0, Context.toNumber(args[1])); - return string.indexOf(search, start) > -1; + private StringCustom() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextDecoder.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextDecoder.java index 877dbd3974e..27f3b5c4c8f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextDecoder.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,12 +26,12 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView; import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Undefined; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBufferView; /** * A JavaScript object for {@code TextDecoder}. @@ -353,7 +353,7 @@ public TextDecoder() { */ @JsxConstructor public TextDecoder(final Object encoding) { - if (Undefined.instance == encoding) { + if (Undefined.isUndefined(encoding)) { return; } @@ -384,20 +384,20 @@ public String getEncoding() { */ @JsxFunction public String decode(final Object buffer) { - if (Undefined.instance == buffer) { + if (Undefined.isUndefined(buffer)) { return ""; } - ArrayBuffer arrayBuffer = null; - if (buffer instanceof ArrayBuffer) { - arrayBuffer = (ArrayBuffer) buffer; + NativeArrayBuffer arrayBuffer = null; + if (buffer instanceof NativeArrayBuffer) { + arrayBuffer = (NativeArrayBuffer) buffer; } - else if (buffer instanceof ArrayBufferView) { - arrayBuffer = ((ArrayBufferView) buffer).getBuffer(); + else if (buffer instanceof NativeArrayBufferView) { + arrayBuffer = ((NativeArrayBufferView) buffer).getBuffer(); } if (arrayBuffer != null) { - return new String(arrayBuffer.getBytes(), Charset.forName(encoding_)); + return new String(arrayBuffer.getBuffer(), Charset.forName(encoding_)); } throw ScriptRuntime.typeError("Argument 1 of TextDecoder.decode could not be" diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextEncoder.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextEncoder.java index 21b6347e5a1..a2c50c4a78b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextEncoder.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TextEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,12 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8Array; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; import net.sourceforge.htmlunit.corejs.javascript.Undefined; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeUint8Array; /** * A JavaScript object for {@code TextEncoder}. @@ -58,9 +60,12 @@ public String getEncoding() { * @return returns a Uint8Array containing the text given encoded . */ @JsxFunction - public Uint8Array encode(final Object toEncode) { - if (Undefined.instance == toEncode) { - return new Uint8Array(new byte[0], getWindow()); + public NativeUint8Array encode(final Object toEncode) { + if (Undefined.isUndefined(toEncode)) { + final NativeUint8Array result = new NativeUint8Array(0); + result.setParentScope(getParentScope()); + result.setPrototype(ScriptableObject.getClassPrototype(getWindow(this), result.getClassName())); + return result; } final String txt; @@ -72,6 +77,13 @@ public Uint8Array encode(final Object toEncode) { } final byte[] bytes = txt.getBytes(StandardCharsets.UTF_8); - return new Uint8Array(bytes, getWindow()); + + final NativeArrayBuffer arrayBuffer = new NativeArrayBuffer(bytes.length); + System.arraycopy(bytes, 0, arrayBuffer.getBuffer(), 0, bytes.length); + + final NativeUint8Array result = new NativeUint8Array(arrayBuffer, 0, bytes.length); + result.setParentScope(getParentScope()); + result.setPrototype(ScriptableObject.getClassPrototype(getWindow(this), result.getClassName())); + return result; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Touch.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Touch.java index 94ae5299981..e7f199e02ce 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Touch.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Touch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TouchList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TouchList.java index ae70d8335e2..76366ebd588 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TouchList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/TouchList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URL.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URL.java index 3c4cf227ca1..449705b6a7b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URL.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.net.MalformedURLException; @@ -59,10 +58,10 @@ public URL() { * @param base a string representing the base URL to use in case url * is a relative URL. If not specified, it defaults to ''. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public URL(final String url, final Object base) { String baseStr = null; - if (Undefined.instance != base) { + if (!Undefined.isUndefined(base)) { baseStr = Context.toString(base); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URLSearchParams.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URLSearchParams.java index f1db9040dd3..dec12717138 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URLSearchParams.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/URLSearchParams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ @JsxClass({CHROME, FF}) public class URLSearchParams extends SimpleScriptable { - private static final String ITERATOR_NAME = "URLSearchParamsIterator"; + private static final String ITERATOR_NAME = "URLSearchParams Iterator"; private static com.gargoylesoftware.htmlunit.javascript.host.Iterator ITERATOR_PROTOTYPE_; private final List> params_ = new LinkedList<>(); @@ -71,7 +71,7 @@ public URLSearchParams(final Object params) { // TODO: Pass in a record // new URLSearchParams({"foo" : 1 , "bar" : 2}); - if (Undefined.instance == params || null == params) { + if (params == null || Undefined.isUndefined(params)) { return; } @@ -86,12 +86,12 @@ private void splitQuery(String params) { // TODO: encoding final String[] parts = StringUtils.split(params, '&'); - for (int i = 0; i < parts.length; i++) { - params_.add(splitQueryParameter(parts[i])); + for (String part : parts) { + params_.add(splitQueryParameter(part)); } } - private Entry splitQueryParameter(final String singleParam) { + private static Entry splitQueryParameter(final String singleParam) { final int idx = singleParam.indexOf('='); if (idx > -1) { final String key = singleParam.substring(0, idx); @@ -125,6 +125,7 @@ public void append(final String name, final String value) { * @param name The name of the parameter to be deleted. */ @JsxFunction + @Override public void delete(final String name) { final Iterator> iter = params_.iterator(); while (iter.hasNext()) { @@ -298,7 +299,7 @@ public Object getDefaultValue(final Class hint) { paramStr.append(delim); delim = "&"; paramStr.append(param.getKey()); - paramStr.append("="); + paramStr.append('='); // TODO: need to encode value final String value = param.getValue(); if (value != null) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WeakMap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WeakMap.java deleted file mode 100644 index 78c883ef23e..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WeakMap.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host; - -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WEAKMAP_CONSTRUCTOR_IGNORE_ARGUMENT; - -import java.util.WeakHashMap; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.Delegator; -import net.sourceforge.htmlunit.corejs.javascript.NativeArray; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; -import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * A JavaScript object for {@code WeakMap}. - * - * @author Ahmed Ashour - */ -@JsxClass -public class WeakMap extends SimpleScriptable { - - private transient java.util.Map map_ = new WeakHashMap<>(); - - /** - * Creates an instance. - */ - public WeakMap() { - } - - /** - * Creates an instance. - * @param arrayLike an Array or other iterable object - */ - @JsxConstructor - public WeakMap(final Object arrayLike) { - if (arrayLike == Undefined.instance) { - return; - } - - final Context context = Context.getCurrentContext(); - final Window window = (Window) ScriptRuntime.getTopCallScope(context); - if (window.getBrowserVersion().hasFeature(JS_WEAKMAP_CONSTRUCTOR_IGNORE_ARGUMENT)) { - return; - } - - if (arrayLike instanceof NativeArray) { - final NativeArray array = (NativeArray) arrayLike; - for (int i = 0; i < array.getLength(); i++) { - final Object entryObject = array.get(i); - if (entryObject instanceof NativeArray) { - final Object[] entry = toArray((NativeArray) entryObject); - if (entry.length > 0) { - final Object key = entry[0]; - if (Undefined.instance != key && key instanceof ScriptableObject) { - final Object value = entry.length > 1 ? entry[1] : null; - set(key, value); - } - } - } - else { - throw Context.reportRuntimeError("TypeError: object is not iterable (" - + entryObject.getClass().getName() + ")"); - } - } - return; - } - - if (arrayLike instanceof Scriptable) { - final Scriptable scriptable = (Scriptable) arrayLike; - if (Iterator.iterate(Context.getCurrentContext(), this, scriptable, - value -> { - if (Undefined.instance != value && value instanceof NativeArray) { - final Object[] entry = toArray((NativeArray) value); - if (entry.length > 0) { - final Object key = entry[0]; - if (Undefined.instance != key && key instanceof ScriptableObject) { - final Object entryValue = entry.length > 1 ? entry[1] : null; - set(key, entryValue); - } - } - } - else { - throw Context.reportRuntimeError("TypeError: object is not iterable (" - + value.getClass().getName() + ")"); - } - })) { - return; - } - } - - throw Context.reportRuntimeError("TypeError: object is not iterable (" + arrayLike.getClass().getName() + ")"); - } - - /** - * Replacement of {@link NativeArray#toArray()}. - */ - private static Object[] toArray(final NativeArray narray) { - final long longLen = narray.getLength(); - if (longLen > Integer.MAX_VALUE) { - throw new IllegalStateException(); - } - - final int len = (int) longLen; - final Object[] arr = new Object[len]; - for (int i = 0; i < len; i++) { - arr[i] = ScriptableObject.getProperty(narray, i); - } - return arr; - } - - /** - * Returns the value of the given key. - * @param key the key - * @return the value - */ - @Override - @JsxFunction - public Object get(final Object key) { - Object o = map_.get(key); - if (o == null) { - o = Undefined.instance; - } - return o; - } - - /** - * Adds the specified pair. - * @param key the key - * @param value the value - * @return the Map object. - */ - @JsxFunction - public WeakMap set(Object key, final Object value) { - if (key instanceof Delegator) { - key = ((Delegator) key).getDelegee(); - } - if (!(key instanceof ScriptableObject)) { - throw Context.reportRuntimeError("TypeError: key is not an object"); - } - map_.put(key, value); - return this; - } - - /** - * Removes all elements. - */ - @JsxFunction - public void clear() { - map_.clear(); - } - - /** - * Removed the specified element. - * @param key the key - * @return whether the element has been successfully removed - */ - @JsxFunction - public boolean delete(final Object key) { - return map_.remove(key) != null; - } - - /** - * Returns whether an element with the specified key exists or not. - * @param key the key - * @return whether the element exists or not - */ - @JsxFunction - public boolean has(final Object key) { - return map_.remove(key) != null; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WeakSet.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WeakSet.java deleted file mode 100644 index 45bdd1fafb1..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WeakSet.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; - -import java.util.Collections; -import java.util.WeakHashMap; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.Delegator; -import net.sourceforge.htmlunit.corejs.javascript.NativeArray; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; -import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * A JavaScript object for {@code WeakSet}. - * - * @author Ahmed Ashour - * @author Ronald Brill - */ -@JsxClass({CHROME, FF, EDGE}) -public class WeakSet extends SimpleScriptable { - - private transient java.util.Set set_ = Collections.newSetFromMap(new WeakHashMap()); - - /** - * Creates an instance. - */ - public WeakSet() { - } - - /** - * Creates an instance. - * @param iterable an Array or other iterable object - */ - @JsxConstructor - public WeakSet(final Object iterable) { - if (iterable == Undefined.instance) { - return; - } - - if (iterable instanceof NativeArray) { - final NativeArray array = (NativeArray) iterable; - for (int i = 0; i < array.getLength(); i++) { - final Object value = ScriptableObject.getProperty(array, i); - if (Undefined.instance != value - && value instanceof ScriptableObject) { - add(ScriptableObject.getProperty(array, i)); - } - } - return; - } - - if (iterable instanceof Scriptable) { - final Scriptable scriptable = (Scriptable) iterable; - if (Iterator.iterate(Context.getCurrentContext(), this, scriptable, - value -> { - if (Undefined.instance != value - && value instanceof ScriptableObject) { - add(value); - } - })) { - return; - } - } - - throw Context.reportRuntimeError("TypeError: object is not iterable (" + iterable.getClass().getName() + ")"); - } - - /** - * Adds the specified value. - * @param value the value - * @return the Set object. - */ - @JsxFunction - public WeakSet add(Object value) { - if (value instanceof Delegator) { - value = ((Delegator) value).getDelegee(); - } - - if (!(value instanceof ScriptableObject)) { - throw Context.reportRuntimeError("TypeError: key is not an object"); - } - - set_.add(value); - return this; - } - - /** - * Removes all elements. - */ - @JsxFunction - public void clear() { - set_.clear(); - } - - /** - * Removed the specified element. - * @param key the key - * @return whether the element has been successfully removed - */ - @JsxFunction - public boolean delete(final Object key) { - return set_.remove(key); - } - - /** - * Returns whether the specified element exists or not. - * @param value the value - * @return whether the element exists or not - */ - @JsxFunction - public boolean has(final Object value) { - return set_.contains(value); - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocket.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocket.java index d51a4a051be..8aac2bbdf63 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocket.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,14 @@ */ package com.gargoylesoftware.htmlunit.javascript.host; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.WEBSOCKET_ORIGIN_SET; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.WEBSOCKET_SRC_ELEMENT_SET; + import java.io.IOException; import java.net.URI; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.concurrent.Future; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -32,8 +33,9 @@ import org.eclipse.jetty.websocket.api.WebSocketPolicy; import org.eclipse.jetty.websocket.client.WebSocketClient; -import com.gargoylesoftware.htmlunit.ScriptResult; import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.WebClientOptions; +import com.gargoylesoftware.htmlunit.WebWindow; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -42,18 +44,18 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer; import com.gargoylesoftware.htmlunit.javascript.host.event.CloseEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; import com.gargoylesoftware.htmlunit.javascript.host.event.MessageEvent; import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; +import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; import net.sourceforge.htmlunit.corejs.javascript.Undefined; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer; /** * A JavaScript object for {@code WebSocket}. @@ -95,6 +97,8 @@ public class WebSocket extends EventTarget implements AutoCloseable { private volatile Session incomingSession_; private Session outgoingSession_; private WebSocketListener listener_; + private boolean srcElementSet_; + private boolean originSet_; /** * Creates a new instance. @@ -127,33 +131,41 @@ public WebSocketListener getWebSocketListener() { */ private WebSocket(final String url, final Window window) { try { - containingPage_ = (HtmlPage) window.getWebWindow().getEnclosedPage(); + final WebWindow webWindow = window.getWebWindow(); + containingPage_ = (HtmlPage) webWindow.getEnclosedPage(); setParentScope(window); setDomNode(containingPage_.getDocumentElement(), false); - final WebClient webClient = window.getWebWindow().getWebClient(); - if (webClient.getOptions().isUseInsecureSSL()) { - client_ = new WebSocketClient(new SslContextFactory(true)); + final WebClient webClient = webWindow.getWebClient(); + srcElementSet_ = webClient.getBrowserVersion().hasFeature(WEBSOCKET_SRC_ELEMENT_SET); + originSet_ = webClient.getBrowserVersion().hasFeature(WEBSOCKET_ORIGIN_SET); + + final WebClientOptions options = webClient.getOptions(); + if (options.isUseInsecureSSL()) { + client_ = new WebSocketClient(new SslContextFactory(true), null, null); + // still use the deprecated method here to be backward compatible with older jersey versions + // see https://github.com/HtmlUnit/htmlunit/issues/36 + // client_ = new WebSocketClient(new SslContextFactory.Client(true), null, null); } else { client_ = new WebSocketClient(); } - client_.setCookieStore(new WebSocketCookieStore(webClient)); + client_.getHttpClient().setCookieStore(new WebSocketCookieStore(webClient)); final WebSocketPolicy policy = client_.getPolicy(); - int size = webClient.getOptions().getWebSocketMaxBinaryMessageSize(); + int size = options.getWebSocketMaxBinaryMessageSize(); if (size > 0) { policy.setMaxBinaryMessageSize(size); } - size = webClient.getOptions().getWebSocketMaxBinaryMessageBufferSize(); + size = options.getWebSocketMaxBinaryMessageBufferSize(); if (size > 0) { policy.setMaxBinaryMessageBufferSize(size); } - size = webClient.getOptions().getWebSocketMaxTextMessageSize(); + size = options.getWebSocketMaxTextMessageSize(); if (size > 0) { policy.setMaxTextMessageSize(size); } - size = webClient.getOptions().getWebSocketMaxTextMessageBufferSize(); + size = options.getWebSocketMaxTextMessageBufferSize(); if (size > 0) { policy.setMaxTextMessageBufferSize(size); } @@ -169,17 +181,21 @@ private WebSocket(final String url, final Window window) { @Override public void run() { try { - readyState_ = CONNECTING; + setReadyState(CONNECTING); incomingSession_ = connectFuture.get(); } catch (final Exception e) { - LOG.error("WS connect error", e); + if (LOG.isErrorEnabled()) { + LOG.error("WS connect error for url '" + url + "':", e); + } } } }); } catch (final Exception e) { - LOG.error("WebSocket Error: 'url' parameter '" + url + "' is invalid.", e); + if (LOG.isErrorEnabled()) { + LOG.error("WebSocket Error: 'url' parameter '" + url + "' is invalid.", e); + } throw Context.reportRuntimeError("WebSocket Error: 'url' parameter '" + url + "' is invalid."); } } @@ -200,7 +216,7 @@ public static Scriptable jsConstructor( throw Context.reportRuntimeError( "WebSocket Error: constructor must have one or two String parameters."); } - if (args[0] == Undefined.instance) { + if (Undefined.isUndefined(args[0])) { throw Context.reportRuntimeError("WebSocket Error: 'url' parameter is undefined."); } if (!(args[0] instanceof String)) { @@ -295,6 +311,10 @@ public int getReadyState() { return readyState_; } + private void setReadyState(final int readyState) { + readyState_ = readyState; + } + /** * @return the url */ @@ -346,7 +366,7 @@ public void setBinaryType(final String type) { * {@inheritDoc} */ @Override - public void close() throws Exception { + public void close() throws IOException { close(null, null); } @@ -360,10 +380,20 @@ public void close() throws Exception { public void close(final Object code, final Object reason) { if (readyState_ != CLOSED) { if (incomingSession_ != null) { - incomingSession_.close(); + try { + incomingSession_.close(); + } + catch (final Throwable e) { + LOG.error("WS close error - incomingSession_.close() failed", e); + } } if (outgoingSession_ != null) { - outgoingSession_.close(); + try { + outgoingSession_.close(); + } + catch (final Throwable e) { + LOG.error("WS close error - outgoingSession_.close() failed", e); + } } } @@ -371,6 +401,7 @@ public void close(final Object code, final Object reason) { if (client_ != null) { try { client_.stop(); + client_.destroy(); } catch (final UpgradeException e) { LOG.error("WS stop error (connection was not established so far)", e); @@ -393,8 +424,8 @@ public void send(final Object content) { if (content instanceof String) { outgoingSession_.getRemote().sendString((String) content); } - else if (content instanceof ArrayBuffer) { - final byte[] bytes = ((ArrayBuffer) content).getBytes(); + else if (content instanceof NativeArrayBuffer) { + final byte[] bytes = ((NativeArrayBuffer) content).getBuffer(); final ByteBuffer buffer = ByteBuffer.wrap(bytes); outgoingSession_.getRemote().sendBytes(buffer); } @@ -416,13 +447,16 @@ public void onWebSocketConnect(final Session session) { listener_.onWebSocketConnect(session); } super.onWebSocketConnect(session); - readyState_ = OPEN; + setReadyState(OPEN); outgoingSession_ = session; final Event openEvent = new Event(); openEvent.setType(Event.TYPE_OPEN); + if (srcElementSet_) { + openEvent.setSrcElement(WebSocket.this); + } fire(openEvent); - callFunction(openHandler_, ArrayUtils.EMPTY_OBJECT_ARRAY); + callFunction(openHandler_, new Object[] {openEvent}); } @Override @@ -431,7 +465,7 @@ public void onWebSocketClose(final int statusCode, final String reason) { listener_.onWebSocketClose(statusCode, reason); } super.onWebSocketClose(statusCode, reason); - readyState_ = CLOSED; + setReadyState(CLOSED); outgoingSession_ = null; final CloseEvent closeEvent = new CloseEvent(); @@ -450,7 +484,12 @@ public void onWebSocketText(final String message) { super.onWebSocketText(message); final MessageEvent msgEvent = new MessageEvent(message); - msgEvent.setOrigin(getUrl()); + if (originSet_) { + msgEvent.setOrigin(getUrl()); + } + if (srcElementSet_) { + msgEvent.setSrcElement(WebSocket.this); + } fire(msgEvent); callFunction(messageHandler_, new Object[] {msgEvent}); } @@ -462,12 +501,18 @@ public void onWebSocketBinary(final byte[] data, final int offset, final int len } super.onWebSocketBinary(data, offset, length); - final ArrayBuffer buffer = new ArrayBuffer(Arrays.copyOfRange(data, offset, length)); + final NativeArrayBuffer buffer = new NativeArrayBuffer(length); + System.arraycopy(data, offset, buffer.getBuffer(), 0, length); buffer.setParentScope(getParentScope()); - buffer.setPrototype(getPrototype(buffer.getClass())); + buffer.setPrototype(ScriptableObject.getClassPrototype(getWindow(), buffer.getClassName())); final MessageEvent msgEvent = new MessageEvent(buffer); - msgEvent.setOrigin(getUrl()); + if (originSet_) { + msgEvent.setOrigin(getUrl()); + } + if (srcElementSet_) { + msgEvent.setSrcElement(WebSocket.this); + } fire(msgEvent); callFunction(messageHandler_, new Object[] {msgEvent}); } @@ -478,11 +523,14 @@ public void onWebSocketError(final Throwable cause) { listener_.onWebSocketError(cause); } super.onWebSocketError(cause); - readyState_ = CLOSED; + setReadyState(CLOSED); outgoingSession_ = null; final Event errorEvent = new Event(); errorEvent.setType(Event.TYPE_ERROR); + if (srcElementSet_) { + errorEvent.setSrcElement(WebSocket.this); + } fire(errorEvent); callFunction(errorHandler_, new Object[] {errorEvent}); @@ -499,13 +547,10 @@ private void fire(final Event evt) { evt.setParentScope(getParentScope()); evt.setPrototype(getPrototype(evt.getClass())); - final JavaScriptEngine engine - = (JavaScriptEngine) containingPage_.getWebClient().getJavaScriptEngine(); - engine.getContextFactory().call(new ContextAction() { - @Override - public ScriptResult run(final Context cx) { - return executeEventLocally(evt); - } + final JavaScriptEngine engine = (JavaScriptEngine) containingPage_.getWebClient().getJavaScriptEngine(); + engine.getContextFactory().call(cx -> { + executeEventLocally(evt); + return null; }); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocketCookieStore.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocketCookieStore.java index b05d881e25e..ecbd0564373 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocketCookieStore.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WebSocketCookieStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java index decf34c1458..e5fc1ba5a01 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,16 +22,16 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_SELECTION_NULL_IF_INVISIBLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WINDOW_TOP_WRITABLE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.IOException; import java.io.ObjectInputStream; +import java.io.Serializable; import java.net.MalformedURLException; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.EnumMap; @@ -93,8 +93,6 @@ import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.background.BackgroundJavaScriptFactory; import com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJob; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnly; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnlyStatus; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -103,7 +101,6 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.crypto.Crypto; import com.gargoylesoftware.htmlunit.javascript.host.css.CSS2Properties; -import com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration; import com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet; import com.gargoylesoftware.htmlunit.javascript.host.css.MediaQueryList; import com.gargoylesoftware.htmlunit.javascript.host.css.StyleMedia; @@ -129,6 +126,7 @@ import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.ContextFactory; import net.sourceforge.htmlunit.corejs.javascript.EcmaError; +import net.sourceforge.htmlunit.corejs.javascript.EvaluatorException; import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.FunctionObject; import net.sourceforge.htmlunit.corejs.javascript.JavaScriptException; @@ -155,6 +153,7 @@ * @author Frank Danek * @author Carsten Steul * @author Colin Alworth + * @author Atsushi Nakagawa * @see MSDN documentation */ @JsxClass @@ -162,6 +161,13 @@ public class Window extends EventTarget implements Function, AutoCloseable { private static final Log LOG = LogFactory.getLog(Window.class); + /** Definition of special cases for the smart DomHtmlAttributeChangeListenerImpl */ + private static final Set ATTRIBUTES_AFFECTING_PARENT = new HashSet<>(Arrays.asList( + "style", + "class", + "height", + "width")); + /** To be documented. */ @JsxConstant(CHROME) public static final short TEMPORARY = 0; @@ -197,14 +203,102 @@ public class Window extends EventTarget implements Function, AutoCloseable { private Object top_ = NOT_FOUND; // top can be set from JS to any value! private Crypto crypto_; + private CSSPropertiesCache cssPropertiesCache_ = new CSSPropertiesCache(); + + private final EnumMap storages_ = new EnumMap<>(Type.class); + + private final transient List animationFrames_ = new ArrayList<>(); + + private static final class AnimationFrame { + private long id_; + private Function callback_; + + private AnimationFrame(final long id, final Function callback) { + id_ = id; + callback_ = callback; + } + } + /** * Cache computed styles when possible, because their calculation is very expensive. * We use a weak hash map because we don't want this cache to be the only reason * nodes are kept around in the JVM, if all other references to them are gone. */ - private transient WeakHashMap> computedStyles_ = new WeakHashMap<>(); + private static final class CSSPropertiesCache implements Serializable { + private transient WeakHashMap> computedStyles_ = new WeakHashMap<>(); - private final EnumMap storages_ = new EnumMap<>(Type.class); + public synchronized CSS2Properties get(final Element element, final String normalizedPseudo) { + final Map elementMap = computedStyles_.get(element); + if (elementMap != null) { + return elementMap.get(normalizedPseudo); + } + return null; + } + + public synchronized void put(final Element element, final String normalizedPseudo, final CSS2Properties style) { + Map elementMap = computedStyles_.get(element); + if (elementMap == null) { + elementMap = new WeakHashMap<>(); + computedStyles_.put(element, elementMap); + } + elementMap.put(normalizedPseudo, style); + } + + public synchronized void nodeChanged(final DomNode changed, final boolean clearParents) { + final Iterator>> i = computedStyles_.entrySet().iterator(); + while (i.hasNext()) { + final Map.Entry> entry = i.next(); + final DomNode node = entry.getKey().getDomNodeOrDie(); + if (changed == node + || changed.getParentNode() == node.getParentNode() + || changed.isAncestorOf(node) + || clearParents && node.isAncestorOf(changed)) { + i.remove(); + } + } + + // maybe this is a better solution but i have to think a bit more about this + // + // if (computedStyles_.isEmpty()) { + // return; + // } + // + // // remove all siblings + // DomNode parent = changed.getParentNode(); + // if (parent != null) { + // for (DomNode sibling : parent.getChildNodes()) { + // computedStyles_.remove(sibling.getScriptableObject()); + // } + // + // if (clearParents) { + // // remove all parents + // while (parent != null) { + // computedStyles_.remove(parent.getScriptableObject()); + // parent = parent.getParentNode(); + // } + // } + // } + // + // // remove changed itself and all descendants + // computedStyles_.remove(changed.getScriptableObject()); + // for (DomNode descendant : changed.getDescendants()) { + // computedStyles_.remove(descendant.getScriptableObject()); + // } + } + + public synchronized void clear() { + computedStyles_.clear(); + } + + public synchronized Map remove(final Element element) { + return computedStyles_.remove(element); + } + + private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { + in.defaultReadObject(); + computedStyles_ = new WeakHashMap<>(); + } + } /** * Creates an instance. @@ -221,21 +315,21 @@ public Window() { * @param inNewExpr Is new or not * @return the java object to allow JavaScript to access */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public static Scriptable jsConstructor(final Context cx, final Object[] args, final Function ctorObj, final boolean inNewExpr) { throw ScriptRuntime.typeError("Illegal constructor"); } /** - * Restores the transient {@link #computedStyles_} map during deserialization. + * Restores the transient {@link #cssPropertiesCache_} map during deserialization. * @param stream the stream to read the object from * @throws IOException if an IO error occurs * @throws ClassNotFoundException if a class is not found */ private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); - computedStyles_ = new WeakHashMap<>(); + cssPropertiesCache_ = new CSSPropertiesCache(); } /** @@ -279,7 +373,9 @@ public void alert(final Object message) { final String stringMessage = Context.toString(message); final AlertHandler handler = getWebWindow().getWebClient().getAlertHandler(); if (handler == null) { - LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed"); + if (LOG.isWarnEnabled()) { + LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed"); + } } else { handler.handleAlert(document_.getPage(), stringMessage); @@ -293,7 +389,14 @@ public void alert(final Object message) { */ @JsxFunction public String btoa(final String stringToEncode) { - return new String(Base64.encodeBase64(stringToEncode.getBytes())); + final int l = stringToEncode.length(); + for (int i = 0; i < l; i++) { + if (stringToEncode.charAt(i) > 255) { + throw new EvaluatorException("Function btoa supports only latin1 characters"); + } + } + final byte[] bytes = stringToEncode.getBytes(StandardCharsets.ISO_8859_1); + return new String(Base64.encodeBase64(bytes), StandardCharsets.UTF_8); } /** @@ -303,7 +406,14 @@ public String btoa(final String stringToEncode) { */ @JsxFunction public String atob(final String encodedData) { - return new String(Base64.decodeBase64(encodedData.getBytes())); + final int l = encodedData.length(); + for (int i = 0; i < l; i++) { + if (encodedData.charAt(i) > 255) { + throw new EvaluatorException("Function atob supports only latin1 characters"); + } + } + final byte[] bytes = encodedData.getBytes(StandardCharsets.ISO_8859_1); + return new String(Base64.decodeBase64(bytes), StandardCharsets.ISO_8859_1); } /** @@ -315,8 +425,10 @@ public String atob(final String encodedData) { public boolean confirm(final String message) { final ConfirmHandler handler = getWebWindow().getWebClient().getConfirmHandler(); if (handler == null) { - LOG.warn("window.confirm(\"" - + message + "\") no confirm handler installed, simulating the OK button"); + if (LOG.isWarnEnabled()) { + LOG.warn("window.confirm(\"" + + message + "\") no confirm handler installed, simulating the OK button"); + } return true; } return handler.handleConfirm(document_.getPage(), message); @@ -332,10 +444,12 @@ public boolean confirm(final String message) { public String prompt(final String message, Object defaultValue) { final PromptHandler handler = getWebWindow().getWebClient().getPromptHandler(); if (handler == null) { - LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed"); + if (LOG.isWarnEnabled()) { + LOG.warn("window.prompt(\"" + message + "\") no prompt handler installed"); + } return null; } - if (defaultValue == Undefined.instance) { + if (Undefined.isUndefined(defaultValue)) { defaultValue = null; } else { @@ -374,7 +488,7 @@ public ApplicationCache getApplicationCache() { * Returns the current event. * @return the current event, or {@code null} if no event is currently available */ - @JsxGetter({IE, CHROME}) + @JsxGetter({IE, CHROME, FF68}) public Object getEvent() { return currentEvent_; } @@ -411,15 +525,15 @@ public void setCurrentEvent(final Event event) { public WindowProxy open(final Object url, final Object name, final Object features, final Object replace) { String urlString = null; - if (url != Undefined.instance) { + if (!Undefined.isUndefined(url)) { urlString = Context.toString(url); } String windowName = ""; - if (name != Undefined.instance) { + if (!Undefined.isUndefined(name)) { windowName = Context.toString(name); } String featuresString = null; - if (features != Undefined.instance) { + if (!Undefined.isUndefined(features)) { featuresString = Context.toString(features); } final WebClient webClient = getWebWindow().getWebClient(); @@ -432,7 +546,7 @@ public WindowProxy open(final Object url, final Object name, final Object featur } boolean replaceCurrentEntryInBrowsingHistory = false; - if (replace != Undefined.instance) { + if (!Undefined.isUndefined(replace)) { replaceCurrentEntryInBrowsingHistory = Context.toBoolean(replace); } if ((featuresString != null || replaceCurrentEntryInBrowsingHistory) && LOG.isDebugEnabled()) { @@ -473,7 +587,9 @@ private URL makeUrlForOpenWindow(final String urlString) { return new URL(urlString); } catch (final MalformedURLException e) { - LOG.error("Unable to create URL for openWindow: relativeUrl=[" + urlString + "]", e); + if (LOG.isWarnEnabled()) { + LOG.error("Unable to create URL for openWindow: relativeUrl=[" + urlString + "]", e); + } return null; } } @@ -483,32 +599,77 @@ private URL makeUrlForOpenWindow(final String urlString) { * The invocation occurs only if the window is opened after the delay * and does not contain an other page than the one that originated the setTimeout. * - * @param code specifies the function pointer or string that indicates the code to be executed - * when the specified interval has elapsed - * @param timeout specifies the number of milliseconds - * @param language specifies language + * @see + * MDN web docs + * + * @param context the JavaScript context + * @param thisObj the scriptable + * @param args the arguments passed into the method + * @param function the function * @return the id of the created timer */ @JsxFunction - public int setTimeout(final Object code, int timeout, final Object language) { + public static Object setTimeout(final Context context, final Scriptable thisObj, + final Object[] args, final Function function) { + if (args.length < 1) { + throw ScriptRuntime.typeError("Function not provided"); + } + + final int timeout = ScriptRuntime.toInt32((args.length > 1) ? args[1] : Undefined.instance); + final Object[] params = (args.length > 2) + ? Arrays.copyOfRange(args, 2, args.length) + : ScriptRuntime.emptyArgs; + return ((Window) thisObj).setTimeoutIntervalImpl(args[0], timeout, true, params); + } + + /** + * Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed. + * + * @see + * MDN web docs + * @param context the JavaScript context + * @param thisObj the scriptable + * @param args the arguments passed into the method + * @param function the function + * @return the id of the created interval + */ + @JsxFunction + public static Object setInterval(final Context context, final Scriptable thisObj, + final Object[] args, final Function function) { + if (args.length < 1) { + throw ScriptRuntime.typeError("Function not provided"); + } + + final int timeout = ScriptRuntime.toInt32((args.length > 1) ? args[1] : Undefined.instance); + final Object[] params = (args.length > 2) + ? Arrays.copyOfRange(args, 2, args.length) + : ScriptRuntime.emptyArgs; + return ((Window) thisObj).setTimeoutIntervalImpl(args[0], timeout, false, params); + } + + private int setTimeoutIntervalImpl(final Object code, int timeout, final boolean isTimeout, final Object[] params) { if (timeout < MIN_TIMER_DELAY) { timeout = MIN_TIMER_DELAY; } - if (code == null) { - throw Context.reportRuntimeError("Function not provided."); - } - final int id; final WebWindow webWindow = getWebWindow(); final Page page = (Page) getDomNodeOrNull(); + Integer period = null; + if (!isTimeout) { + period = Integer.valueOf(timeout); + } + if (code instanceof String) { final String s = (String) code; - final String description = "window.setTimeout(" + s + ", " + timeout + ")"; + final String description = "window.set" + + (isTimeout ? "Timeout" : "Interval") + + "(" + s + ", " + timeout + ")"; final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, null, description, webWindow, s); - id = webWindow.getJobManager().addJob(job, page); + createJavaScriptJob(timeout, period, description, webWindow, s); + return webWindow.getJobManager().addJob(job, page); } - else if (code instanceof Function) { + + if (code instanceof Function) { final Function f = (Function) code; final String functionName; if (f instanceof FunctionObject) { @@ -518,21 +679,23 @@ else if (code instanceof Function) { functionName = String.valueOf(f); // can this happen? } - final String description = "window.setTimeout(" + functionName + ", " + timeout + ")"; + final String description = "window.set" + + (isTimeout ? "Timeout" : "Interval") + + "(" + functionName + ", " + timeout + ")"; final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, null, description, webWindow, f); - id = webWindow.getJobManager().addJob(job, page); + createJavaScriptJob(timeout, period, description, webWindow, f, params); + return webWindow.getJobManager().addJob(job, page); } - else { - throw Context.reportRuntimeError("Unknown type for function."); - } - return id; + + throw Context.reportRuntimeError("Unknown type for function."); } /** - * Cancels a time-out previously set with the {@link #setTimeout(Object, int, Object)} method. + * Cancels a time-out previously set with the + * {@link #setTimeout(Context, Scriptable, Object[], Function)} method. * - * @param timeoutId identifier for the timeout to clear (returned by {@link #setTimeout(Object, int, Object)}) + * @param timeoutId identifier for the timeout to clear + * as returned by {@link #setTimeout(Context, Scriptable, Object[], Function)} */ @JsxFunction public void clearTimeout(final int timeoutId) { @@ -542,6 +705,22 @@ public void clearTimeout(final int timeoutId) { getWebWindow().getJobManager().removeJob(timeoutId); } + /** + * Cancels the interval previously started using the + * {@link #setInterval(Context, Scriptable, Object[], Function)} method. + * Current implementation does nothing. + * @param intervalID specifies the interval to cancel as returned by the + * {@link #setInterval(Context, Scriptable, Object[], Function)} method + * @see MSDN documentation + */ + @JsxFunction + public void clearInterval(final int intervalID) { + if (LOG.isDebugEnabled()) { + LOG.debug("clearInterval(" + intervalID + ")"); + } + getWebWindow().getJobManager().removeJob(intervalID); + } + /** * Returns the JavaScript property {@code navigator}. * @return the navigator @@ -560,6 +739,14 @@ public Navigator getClientInformation() { return navigator_; } + /** + * Special setter for IE to ignore this call. + * @param ignore parame gets ignored + */ + @JsxSetter(IE) + public void setClientInformation(final Object ignore) { + } + /** * Returns the JavaScript property {@code clipboardData}. * @return the {@link DataTransfer} @@ -673,25 +860,60 @@ public void dump(final String message) { } /** - * Dummy implementation for {@code requestAnimationFrame}. + * Invokes all the animation callbacks registered for this window by + * calling {@link #requestAnimationFrame(Object)} once. + * @return the number of pending animation callbacks + */ + public int animateAnimationsFrames() { + final List animationFrames = new ArrayList<>(animationFrames_); + animationFrames_.clear(); + + final double now = System.nanoTime() / 1_000_000d; + final Object[] args = new Object[] {now}; + + final WebWindow ww = getWindow().getWebWindow(); + final JavaScriptEngine jsEngine = (JavaScriptEngine) ww.getWebClient().getJavaScriptEngine(); + + for (AnimationFrame animationFrame : animationFrames) { + jsEngine.callFunction((HtmlPage) ww.getEnclosedPage(), + animationFrame.callback_, this, getParentScope(), args); + } + return animationFrames_.size(); + } + + /** + * Add callback to the list of animationFrames. * @param callback the function to call when it's time to update the animation * @return an identification id * @see MDN Doc */ @JsxFunction public int requestAnimationFrame(final Object callback) { - // nothing for now - return 1; + if (callback instanceof Function) { + final int id = animationFrames_.size(); + final AnimationFrame animationFrame = new AnimationFrame(id, (Function) callback); + animationFrames_.add(animationFrame); + return id; + } + return -1; } /** - * Dummy implementation for {@code cancelAnimationFrame}. + * Remove the callback from the list of animationFrames. * @param requestId the ID value returned by the call to window.requestAnimationFrame() * @see MDN Doc */ @JsxFunction public void cancelAnimationFrame(final Object requestId) { - // nothing for now + final int id = (int) Context.toNumber(requestId); + + final Iterator frames = animationFrames_.iterator(); + while (frames.hasNext()) { + final Window.AnimationFrame animationFrame = frames.next(); + if (animationFrame.id_ == id) { + frames.remove(); + } + } } /** @@ -879,7 +1101,7 @@ public Object getOpener() { @JsxSetter public void setOpener(final Object newValue) { if (getBrowserVersion().hasFeature(JS_WINDOW_CHANGE_OPENER_ONLY_WINDOW_OBJECT) - && newValue != null && newValue != Undefined.instance && !(newValue instanceof Window)) { + && newValue != null && !Undefined.isUndefined(newValue) && !(newValue instanceof Window)) { throw Context.reportRuntimeError("Can't set opener to something other than a window!"); } opener_ = newValue; @@ -913,7 +1135,11 @@ public Window getFrames_js() { */ @JsxGetter public int getLength() { - return getFrames().getLength(); + final HTMLCollection frames = getFrames(); + if (frames != null) { + return frames.getLength(); + } + return 0; } /** @@ -921,8 +1147,11 @@ public int getLength() { * @return the live collection of frames contained by this window */ private HTMLCollection getFrames() { - final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage(); - return new HTMLCollectionFrames(page); + final Page page = getWebWindow().getEnclosedPage(); + if (page instanceof HtmlPage) { + return new HTMLCollectionFrames((HtmlPage) page); + } + return null; } /** @@ -971,7 +1200,6 @@ public void close_js() { * @return {@code true} if this window is closed */ @JsxGetter - @CanSetReadOnly(CanSetReadOnlyStatus.IGNORE) public boolean isClosed() { final WebWindow webWindow = getWebWindow(); return !webWindow.getWebClient().containsWebWindow(webWindow); @@ -1123,7 +1351,7 @@ public Object getOnload() { */ @JsxSetter public void setOnload(final Object onload) { - getEventListenersContainer().setEventHandler(Event.TYPE_LOAD, onload); + setHandlerForJavaScript(Event.TYPE_LOAD, onload); } /** @@ -1132,7 +1360,7 @@ public void setOnload(final Object onload) { */ @JsxSetter public void setOnblur(final Object onblur) { - getEventListenersContainer().setEventHandler(Event.TYPE_BLUR, onblur); + setHandlerForJavaScript(Event.TYPE_BLUR, onblur); } /** @@ -1306,10 +1534,7 @@ else if (e.getCause() instanceof EcmaError) { } private void setHandlerForJavaScript(final String eventName, final Object handler) { - if (handler == null || handler instanceof Function) { - getEventListenersContainer().setEventHandler(eventName, handler); - } - // Otherwise, fail silently. + getEventListenersContainer().setEventHandler(eventName, handler); } /** @@ -1380,12 +1605,12 @@ public Object getWithFallback(final String name) { */ @Override public Object get(final int index, final Scriptable start) { - if (getWebWindow() == null) { + if (index < 0 || getWebWindow() == null) { return Undefined.instance; } final HTMLCollection frames = getFrames(); - if (index < 0 || index >= frames.getLength()) { + if (frames == null || index >= frames.getLength()) { return Undefined.instance; } return frames.item(Integer.valueOf(index)); @@ -1486,61 +1711,6 @@ public void setStatus(final String message) { } } - /** - * Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed. - * - * @see MSDN documentation - * @param code specifies the function pointer or string that indicates the code to be executed - * when the specified interval has elapsed - * @param timeout specifies the number of milliseconds - * @param language specifies language - * @return the id of the created interval - */ - @JsxFunction - public int setInterval(final Object code, int timeout, final Object language) { - if (timeout < MIN_TIMER_DELAY) { - timeout = MIN_TIMER_DELAY; - } - final int id; - final WebWindow w = getWebWindow(); - final Page page = (Page) getDomNodeOrNull(); - final String description = "window.setInterval(" + timeout + ")"; - if (code == null) { - throw Context.reportRuntimeError("Function not provided."); - } - else if (code instanceof String) { - final String s = (String) code; - final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, Integer.valueOf(timeout), description, w, s); - id = w.getJobManager().addJob(job, page); - } - else if (code instanceof Function) { - final Function f = (Function) code; - final JavaScriptJob job = BackgroundJavaScriptFactory.theFactory(). - createJavaScriptJob(timeout, Integer.valueOf(timeout), description, w, f); - id = w.getJobManager().addJob(job, page); - } - else { - throw Context.reportRuntimeError("Unknown type for function."); - } - return id; - } - - /** - * Cancels the interval previously started using the {@link #setInterval(Object, int, Object)} method. - * Current implementation does nothing. - * @param intervalID specifies the interval to cancel as returned by the - * {@link #setInterval(Object, int, Object)} method - * @see MSDN documentation - */ - @JsxFunction - public void clearInterval(final int intervalID) { - if (LOG.isDebugEnabled()) { - LOG.debug("clearInterval(" + intervalID + ")"); - } - getWebWindow().getJobManager().removeJob(intervalID); - } - /** * Returns the {@code innerWidth}. * @return the {@code innerWidth} @@ -1653,8 +1823,8 @@ public void releaseEvents(final String type) { /** * An undocumented IE function. */ - @JsxFunction(IE) - public void CollectGarbage() { + @JsxFunction(value = IE, functionName = "CollectGarbage") + public void collectGarbage() { // Empty. } @@ -1681,24 +1851,17 @@ public CSS2Properties getComputedStyle(final Object element, final String pseudo normalizedPseudo = normalizedPseudo.substring(1); } else if (getBrowserVersion().hasFeature(JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON) - && !normalizedPseudo.startsWith(":")) { + && normalizedPseudo.length() > 0 && normalizedPseudo.charAt(0) != ':') { normalizedPseudo = ":" + normalizedPseudo; } } - synchronized (computedStyles_) { - final Map elementMap = computedStyles_.get(e); - if (elementMap != null) { - final CSS2Properties style = elementMap.get(normalizedPseudo); - if (style != null) { - return style; - } - } + final CSS2Properties styleFromCache = cssPropertiesCache_.get(e, normalizedPseudo); + if (styleFromCache != null) { + return styleFromCache; } - final CSSStyleDeclaration original = e.getStyle(); - final CSS2Properties style = new CSS2Properties(original); - + final CSS2Properties style = new CSS2Properties(e.getStyle()); final Object ownerDocument = e.getOwnerDocument(); if (ownerDocument instanceof HTMLDocument) { final StyleSheetList sheets = ((HTMLDocument) ownerDocument).getStyleSheets(); @@ -1713,14 +1876,7 @@ else if (getBrowserVersion().hasFeature(JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_W } } - synchronized (computedStyles_) { - Map elementMap = computedStyles_.get(element); - if (elementMap == null) { - elementMap = new WeakHashMap<>(); - computedStyles_.put(e, elementMap); - } - elementMap.put(normalizedPseudo, style); - } + cssPropertiesCache_.put(e, normalizedPseudo, style); } return style; } @@ -1765,7 +1921,7 @@ public Selection getSelectionImpl() { * @see MSDN Documentation * @see Mozilla Documentation */ - @JsxFunction({IE, FF}) + @JsxFunction(IE) public Object showModalDialog(final String url, final Object arguments, final String features) { final WebWindow webWindow = getWebWindow(); final WebClient client = webWindow.getWebClient(); @@ -1841,7 +1997,7 @@ public int getMozInnerScreenX() { */ @JsxGetter(FF) public int getMozInnerScreenY() { - return 91; + return 83; } /** @@ -1853,13 +2009,6 @@ public int getMozPaintCount() { return 0; } - /** Definition of special cases for the smart DomHtmlAttributeChangeListenerImpl */ - private static final Set ATTRIBUTES_AFFECTING_PARENT = new HashSet<>(Arrays.asList( - "style", - "class", - "height", - "width")); - private static final class Filter { private final boolean includeFormFields_; @@ -1889,9 +2038,7 @@ private boolean matches(final Object object) { * Clears the computed styles. */ public void clearComputedStyles() { - synchronized (computedStyles_) { - computedStyles_.clear(); - } + cssPropertiesCache_.clear(); } /** @@ -1899,8 +2046,21 @@ public void clearComputedStyles() { * @param element the element to clear its cache */ public void clearComputedStyles(final Element element) { - synchronized (computedStyles_) { - computedStyles_.remove(element); + cssPropertiesCache_.remove(element); + } + + /** + * Clears the computed styles for a specific {@link Element} + * and all parent elements. + * @param element the element to clear its cache + */ + public void clearComputedStylesUpToRoot(final Element element) { + cssPropertiesCache_.remove(element); + + Element parent = element.getParentElement(); + while (parent != null) { + cssPropertiesCache_.remove(parent); + parent = parent.getParentElement(); } } @@ -1992,21 +2152,10 @@ private void nodeChanged(final DomNode changed, final String attribName) { return; } } + // Apparently it wasn't a stylesheet that changed; be semi-smart about what we evict and when. - synchronized (computedStyles_) { - final boolean clearParents = ATTRIBUTES_AFFECTING_PARENT.contains(attribName); - for (final Iterator>> i - = computedStyles_.entrySet().iterator(); i.hasNext();) { - final Map.Entry> entry = i.next(); - final DomNode node = entry.getKey().getDomNodeOrDie(); - if (changed == node - || changed.getParentNode() == node.getParentNode() - || changed.isAncestorOf(node) - || clearParents && node.isAncestorOf(changed)) { - i.remove(); - } - } - } + final boolean clearParents = ATTRIBUTES_AFFECTING_PARENT.contains(attribName); + cssPropertiesCache_.nodeChanged(changed, clearParents); } } @@ -2015,8 +2164,8 @@ private void nodeChanged(final DomNode changed, final String attribName) { * @see MSDN doc * @return "JScript" */ - @JsxFunction(IE) - public String ScriptEngine() { + @JsxFunction(value = IE, functionName = "ScriptEngine") + public String scriptEngine() { return "JScript"; } @@ -2025,8 +2174,8 @@ public String ScriptEngine() { * @see MSDN doc * @return the build version */ - @JsxFunction(IE) - public int ScriptEngineBuildVersion() { + @JsxFunction(value = IE, functionName = "ScriptEngineBuildVersion") + public int scriptEngineBuildVersion() { return 12345; } @@ -2035,8 +2184,8 @@ public int ScriptEngineBuildVersion() { * @see MSDN doc * @return the major version */ - @JsxFunction(IE) - public int ScriptEngineMajorVersion() { + @JsxFunction(value = IE, functionName = "ScriptEngineMajorVersion") + public int scriptEngineMajorVersion() { return getBrowserVersion().getBrowserVersionNumeric(); } @@ -2045,8 +2194,8 @@ public int ScriptEngineMajorVersion() { * @see MSDN doc * @return the minor version */ - @JsxFunction(IE) - public int ScriptEngineMinorVersion() { + @JsxFunction(value = IE, functionName = "ScriptEngineMinorVersion") + public int scriptEngineMinorVersion() { return 0; } @@ -2209,7 +2358,7 @@ public void postMessage(final String message, final String targetOrigin, final O final PostponedAction action = new PostponedAction(page) { @Override public void execute() throws Exception { - final ContextAction contextAction = new ContextAction() { + final ContextAction contextAction = new ContextAction() { @Override public Object run(final Context cx) { return dispatchEvent(event); @@ -2488,7 +2637,7 @@ public void setOnratechange(final Object onratechange) { * Returns the {@code onanimationiteration} event handler. * @return the {@code onanimationiteration} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnanimationiteration() { return getEventHandler("animationiteration"); } @@ -2497,7 +2646,7 @@ public Function getOnanimationiteration() { * Sets the {@code onanimationiteration} event handler. * @param onanimationiteration the {@code onanimationiteration} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnanimationiteration(final Object onanimationiteration) { setHandlerForJavaScript("animationiteration", onanimationiteration); } @@ -2646,29 +2795,11 @@ public void setOnmspointerleave(final Object onmspointerleave) { setHandlerForJavaScript("mspointerleave", onmspointerleave); } - /** - * Returns the {@code onmozpointerlockchange} event handler. - * @return the {@code onmozpointerlockchange} event handler - */ - @JsxGetter(FF45) - public Function getOnmozpointerlockchange() { - return getEventHandler("mozpointerlockchange"); - } - - /** - * Sets the {@code onmozpointerlockchange} event handler. - * @param onmozpointerlockchange the {@code onmozpointerlockchange} event handler - */ - @JsxSetter(FF45) - public void setOnmozpointerlockchange(final Object onmozpointerlockchange) { - setHandlerForJavaScript("mozpointerlockchange", onmozpointerlockchange); - } - /** * Returns the {@code onwebkitanimationstart} event handler. * @return the {@code onwebkitanimationstart} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnwebkitanimationstart() { return getEventHandler("webkitanimationstart"); } @@ -2677,7 +2808,7 @@ public Function getOnwebkitanimationstart() { * Sets the {@code onwebkitanimationstart} event handler. * @param onwebkitanimationstart the {@code onwebkitanimationstart} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnwebkitanimationstart(final Object onwebkitanimationstart) { setHandlerForJavaScript("webkitanimationstart", onwebkitanimationstart); } @@ -2866,7 +2997,7 @@ public void setOndeviceorientation(final Object ondeviceorientation) { * Returns the {@code ontoggle} event handler. * @return the {@code ontoggle} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOntoggle() { return getEventHandler("toggle"); } @@ -2875,7 +3006,7 @@ public Function getOntoggle() { * Sets the {@code ontoggle} event handler. * @param ontoggle the {@code ontoggle} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOntoggle(final Object ontoggle) { setHandlerForJavaScript("toggle", ontoggle); } @@ -3100,7 +3231,7 @@ public void setOnclose(final Object onclose) { * Returns the {@code onanimationend} event handler. * @return the {@code onanimationend} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnanimationend() { return getEventHandler("animationend"); } @@ -3109,7 +3240,7 @@ public Function getOnanimationend() { * Sets the {@code onanimationend} event handler. * @param onanimationend the {@code onanimationend} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnanimationend(final Object onanimationend) { setHandlerForJavaScript("animationend", onanimationend); } @@ -3766,7 +3897,7 @@ public void setOndevicelight(final Object ondevicelight) { * Returns the {@code onanimationstart} event handler. * @return the {@code onanimationstart} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnanimationstart() { return getEventHandler("animationstart"); } @@ -3775,7 +3906,7 @@ public Function getOnanimationstart() { * Sets the {@code onanimationstart} event handler. * @param onanimationstart the {@code onanimationstart} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnanimationstart(final Object onanimationstart) { setHandlerForJavaScript("animationstart", onanimationstart); } @@ -3838,7 +3969,7 @@ public void setOnpagehide(final Object onpagehide) { * Returns the {@code onwebkitanimationiteration} event handler. * @return the {@code onwebkitanimationiteration} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnwebkitanimationiteration() { return getEventHandler("webkitanimationiteration"); } @@ -3847,7 +3978,7 @@ public Function getOnwebkitanimationiteration() { * Sets the {@code onwebkitanimationiteration} event handler. * @param onwebkitanimationiteration the {@code onwebkitanimationiteration} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnwebkitanimationiteration(final Object onwebkitanimationiteration) { setHandlerForJavaScript("webkitanimationiteration", onwebkitanimationiteration); } @@ -4050,29 +4181,11 @@ public void setOninput(final Object oninput) { setHandlerForJavaScript(Event.TYPE_INPUT, oninput); } - /** - * Returns the {@code onmozpointerlockerror} event handler. - * @return the {@code onmozpointerlockerror} event handler - */ - @JsxGetter(FF45) - public Function getOnmozpointerlockerror() { - return getEventHandler("mozpointerlockerror"); - } - - /** - * Sets the {@code onmozpointerlockerror} event handler. - * @param onmozpointerlockerror the {@code onmozpointerlockerror} event handler - */ - @JsxSetter(FF45) - public void setOnmozpointerlockerror(final Object onmozpointerlockerror) { - setHandlerForJavaScript("mozpointerlockerror", onmozpointerlockerror); - } - /** * Returns the {@code onwebkittransitionend} event handler. * @return the {@code onwebkittransitionend} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnwebkittransitionend() { return getEventHandler("webkittransitionend"); } @@ -4081,7 +4194,7 @@ public Function getOnwebkittransitionend() { * Sets the {@code onwebkittransitionend} event handler. * @param onwebkittransitionend the {@code onwebkittransitionend} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnwebkittransitionend(final Object onwebkittransitionend) { setHandlerForJavaScript("webkittransitionend", onwebkittransitionend); } @@ -4234,7 +4347,7 @@ public void setOnunload(final Object onunload) { * Returns the {@code onwebkitanimationend} event handler. * @return the {@code onwebkitanimationend} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnwebkitanimationend() { return getEventHandler("webkitanimationend"); } @@ -4243,7 +4356,7 @@ public Function getOnwebkitanimationend() { * Sets the {@code onwebkitanimationend} event handler. * @param onwebkitanimationend the {@code onwebkitanimationend} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnwebkitanimationend(final Object onwebkitanimationend) { setHandlerForJavaScript("webkitanimationend", onwebkitanimationend); } @@ -4270,7 +4383,7 @@ public void setOndragstart(final Object ondragstart) { * Returns the {@code ontransitionend} event handler. * @return the {@code ontransitionend} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOntransitionend() { return getEventHandler("transitionend"); } @@ -4279,7 +4392,7 @@ public Function getOntransitionend() { * Sets the {@code ontransitionend} event handler. * @param ontransitionend the {@code ontransitionend} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOntransitionend(final Object ontransitionend) { setHandlerForJavaScript("transitionend", ontransitionend); } @@ -4410,78 +4523,6 @@ public void setOnpopstate(final Object onpopstate) { setHandlerForJavaScript(Event.TYPE_POPSTATE, onpopstate); } - /** - * Returns the {@code onabsolutedeviceorientation} event handler. - * @return the {@code onabsolutedeviceorientation} event handler - */ - @JsxGetter(FF52) - public Function getOnabsolutedeviceorientation() { - return getEventHandler("absolutedeviceorientation"); - } - - /** - * Sets the {@code onabsolutedeviceorientation} event handler. - * @param absolutedeviceorientation the {@code onabsolutedeviceorientation} event handler - */ - @JsxSetter(FF52) - public void setOnabsolutedeviceorientation(final Object absolutedeviceorientation) { - setEventHandler("absolutedeviceorientation", absolutedeviceorientation); - } - - /** - * Returns the {@code ondragexit} event handler. - * @return the {@code ondragexit} event handler - */ - @JsxGetter(FF52) - public Function getOndragexit() { - return getEventHandler("dragexit"); - } - - /** - * Sets the {@code ondragexit} event handler. - * @param dragexit the {@code ondragexit} event handler - */ - @JsxSetter(FF52) - public void setOndragexit(final Object dragexit) { - setEventHandler("dragexit", dragexit); - } - - /** - * Returns the {@code onloadend} event handler. - * @return the {@code onloadend} event handler - */ - @JsxGetter(FF52) - public Function getOnloadend() { - return getEventHandler("loadend"); - } - - /** - * Sets the {@code onloadend} event handler. - * @param loadend the {@code onloadend} event handler - */ - @JsxSetter(FF52) - public void setOnloadend(final Object loadend) { - setEventHandler("loadend", loadend); - } - - /** - * Returns the {@code onselectstart} event handler. - * @return the {@code onselectstart} event handler - */ - @JsxGetter(FF52) - public Function getOnselectstart() { - return getEventHandler("selectstart"); - } - - /** - * Sets the {@code onselectstart} event handler. - * @param selectstart the {@code onselectstart} event handler - */ - @JsxSetter(FF52) - public void setOnselectstart(final Object selectstart) { - setEventHandler("selectstart", selectstart); - } - /** * Returns the {@code doNotTrack} property. * @return the {@code doNotTrack} property @@ -4494,6 +4535,14 @@ public Object getDoNotTrack() { } return null; } + + @Override + protected boolean isReadOnlySettable(final String name, final Object value) { + if ("closed".equals(name)) { + return false; //ignore + } + return super.isReadOnlySettable(name, value); + } } class HTMLCollectionFrames extends HTMLCollection { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WindowProxy.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WindowProxy.java index d14c55b3d5f..3cbec24193f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WindowProxy.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/WindowProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/XPathExpression.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/XPathExpression.java index cf9a5556ab7..2239485d8f7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/XPathExpression.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/XPathExpression.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class XPathExpression extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/Animation.java similarity index 71% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/Animation.java index f082f5c7f97..576f369fb90 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Animation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/Animation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,21 +12,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.javascript.host; +package com.gargoylesoftware.htmlunit.javascript.host.animations; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; /** * A JavaScript object for {@code Animation}. * * @author Ronald Brill */ -@JsxClass(FF52) -public class Animation extends SimpleScriptable { +@JsxClass({CHROME, FF}) +public class Animation extends EventTarget { /** * Creates a new instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AnimationEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/AnimationEvent.java similarity index 82% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AnimationEvent.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/AnimationEvent.java index 19d321766f2..d60b68ec27f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AnimationEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/AnimationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,14 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.javascript.host.event; +package com.gargoylesoftware.htmlunit.javascript.host.animations; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.event.Event; /** * A JavaScript object for {@code AnimationEvent}. @@ -32,7 +32,7 @@ public class AnimationEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public AnimationEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Proxy.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/KeyframeEffect.java similarity index 70% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Proxy.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/KeyframeEffect.java index aaea7e26f14..eb28115464b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Proxy.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/KeyframeEffect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,29 +12,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.javascript.host; +package com.gargoylesoftware.htmlunit.javascript.host.animations; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** - * A JavaScript object for {@code Proxy}. + * A JavaScript object for {@code KeyframeEffect}. * - * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) -public class Proxy extends SimpleScriptable { +@JsxClass({CHROME, FF68}) +public class KeyframeEffect extends SimpleScriptable { /** - * Creates an instance. + * Creates a new instance. */ @JsxConstructor - public Proxy() { + public KeyframeEffect() { } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/package-info.java similarity index 72% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/package-info.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/package-info.java index 9deced31fca..6382b9bf455 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/animations/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ /** - * Implementations of the Mozilla JavaScript host objects - users of HtmlUnit shouldn't + * Implementations of the JavaScript host objects for the Web Animations API - users of HtmlUnit shouldn't * need anything in this package. */ -package com.gargoylesoftware.htmlunit.javascript.host.moz; +package com.gargoylesoftware.htmlunit.javascript.host.animations; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBuffer.java deleted file mode 100644 index 4504095418f..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBuffer.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * A data type that is used to represent a generic, fixed-length binary data buffer. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - */ -@JsxClass -public class ArrayBuffer extends SimpleScriptable { - - private byte[] bytes_; - - /** - * Ctor. - */ - public ArrayBuffer() { - } - - /** - * Ctor with given bytes. - * @param bytes the initial bytes - */ - public ArrayBuffer(final byte[] bytes) { - bytes_ = bytes; - } - - /** - * The constructor. - * @param length the size, in bytes, of the array buffer to create. - */ - @JsxConstructor - public void constructor(final int length) { - if (length < 0) { - throw ScriptRuntime.rangeError("invalid array length '" + length + "'."); - } - bytes_ = new byte[length]; - } - - /** - * Returns the size, in bytes, of the array. This is established during construction and cannot be changed. - * @return the byte length. - */ - @JsxGetter - public int getByteLength() { - return bytes_.length; - } - - /** - * Returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes - * from begin, inclusive, up to end, exclusive. - * @param begin byte index to start slicing - * @param end (optional) byte index to end slicing - * @return the newly created ArrayBuffer - */ - @JsxFunction - public ArrayBuffer slice(final Object begin, final Object end) { - if (begin == Undefined.instance || begin instanceof Boolean) { - throw Context.reportRuntimeError("Invalid type " + begin.getClass().getName()); - } - - final double beginNumber = Context.toNumber(begin); - final int beginInt; - if (Double.isNaN(beginNumber)) { - beginInt = 0; - } - else if (Double.isInfinite(beginNumber)) { - if (beginNumber > 0) { - final byte[] byteArray = new byte[0]; - return new ArrayBuffer(byteArray); - } - beginInt = 0; - } - else { - beginInt = (int) beginNumber; - if (beginInt != beginNumber) { - throw Context.reportRuntimeError("Invalid type " + begin.getClass().getName()); - } - } - - double endNumber; - if (end == Undefined.instance) { - endNumber = getByteLength(); - } - else { - endNumber = Context.toNumber(end); - } - - if (Double.isNaN(endNumber) || Double.isInfinite(endNumber) || endNumber < beginInt) { - endNumber = beginInt; - } - - final byte[] byteArray = new byte[(int) endNumber - beginInt]; - System.arraycopy(bytes_, beginInt, byteArray, 0, byteArray.length); - return new ArrayBuffer(byteArray); - } - - byte getByte(final int index) { - return bytes_[index]; - } - - /** - * Sets the bytes. - * @param index the starting index - * @param array the array - */ - public void setBytes(final int index, final byte[] array) { - int i = array.length - 1; - if (index + i >= bytes_.length) { - i = bytes_.length - index - 1; - } - for ( ; i >= 0; i--) { - bytes_[index + i] = array[i]; - } - } - - /** - * @return the bytes - */ - public byte[] getBytes() { - return bytes_; - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBufferView.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBufferView.java deleted file mode 100644 index 0413c9075cc..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBufferView.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; - -/** - * The ArrayBufferView type describes a particular view on the contents of an {@link ArrayBuffer}'s data. - * - * @author Ahmed Ashour - * @author Frank Danek - */ -@JsxClass(isJSObject = false) -public class ArrayBufferView extends SimpleScriptable { - - private ArrayBuffer buffer_; - private int byteLength_; - private int byteOffset_; - - /** - * The constructor. - * @param buffer the array buffer - * @param byteOffset the byte offset - * @param length the length - */ - protected void constructor(final ArrayBuffer buffer, final int byteOffset, final int length) { - buffer_ = buffer; - byteOffset_ = byteOffset; - byteLength_ = length; - } - - /** - * Returns the buffer this view references. - * @return the buffer - */ - @JsxGetter - public ArrayBuffer getBuffer() { - return buffer_; - } - - /** - * Sets the buffer. - * @param buffer the buffer - */ - protected void setBuffer(final ArrayBuffer buffer) { - buffer_ = buffer; - } - - /** - * Returns the length, in bytes, of the view. - * @return the length - */ - @JsxGetter - public int getByteLength() { - return byteLength_; - } - - /** - * Sets the bytes length. - * @param byteLength the bytes length - */ - protected void setByteLength(final int byteLength) { - byteLength_ = byteLength; - } - - /** - * Returns the offset, in bytes, to the first byte of the view within the {@link ArrayBuffer}. - * @return the offset - */ - @JsxGetter - public int getByteOffset() { - return byteOffset_; - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBufferViewBase.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBufferViewBase.java deleted file mode 100644 index d7668e02993..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/ArrayBufferViewBase.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TYPED_ARRAYS_NULL; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; - -import net.sourceforge.htmlunit.corejs.javascript.Context; -import net.sourceforge.htmlunit.corejs.javascript.NativeArray; -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; -import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; -import net.sourceforge.htmlunit.corejs.javascript.Wrapper; - -/** - * The parent class of all typed arrays, {@link DataView} is not included. - * - * @author Ahmed Ashour - * @author Marc Guillemot - * @author Frank Danek - * @author Ronald Brill - */ -@JsxClass(isJSObject = false) -public class ArrayBufferViewBase extends ArrayBufferView { - - /** - * The constructor. - * - * @param object the object - * @param byteOffset optional byteOffset - * @param length optional length - */ - public void constructor(final Object object, final Object byteOffset, final Object length) { - if (object instanceof Number) { - constructor(((Number) object).intValue()); - } - else if (object instanceof NativeArray) { - constructor((NativeArray) object); - } - else if (object instanceof ArrayBufferViewBase) { - constructor((ArrayBufferViewBase) object); - } - else if (object instanceof ArrayBuffer) { - final ArrayBuffer array = (ArrayBuffer) object; - - double dbByteOffset = Context.toNumber(byteOffset); - if (Double.isNaN(dbByteOffset)) { - dbByteOffset = 0; - } - - double dbLength = Context.toNumber(length); - if (Double.isNaN(dbLength)) { - dbLength = array.getByteLength(); - } - super.constructor(array, (int) dbByteOffset, (int) dbLength); - } - else if (object == Undefined.instance || getBrowserVersion().hasFeature(JS_TYPED_ARRAYS_NULL)) { - constructor(0); - } - else { - throw ScriptRuntime.typeError("invalid arguments"); - } - } - - private void constructor(final int length) { - final int byteLength = length * getBytesPerElement(); - setByteLength(byteLength); - initBuffer(byteLength); - } - - private void constructor(final NativeArray array) { - final int byteLength = (int) array.getLength() * getBytesPerElement(); - setByteLength(byteLength); - initBuffer(byteLength); - set(array, 0); - } - - private void constructor(final ArrayBufferViewBase array) { - final int byteLength = array.getLength() * getBytesPerElement(); - setByteLength(byteLength); - initBuffer(byteLength); - set(array, 0); - } - - private void initBuffer(final int lengthInBytes) { - final ArrayBuffer buffer = new ArrayBuffer(); - buffer.constructor(lengthInBytes); - buffer.setPrototype(getPrototype(buffer.getClass())); - buffer.setParentScope(getParentScope()); - setBuffer(buffer); - } - - /** - * Returns the number of entries in the array. - * @return the number of entries - */ - @JsxGetter - public int getLength() { - return getByteLength() / getBytesPerElement(); - } - - /** - * Sets multiple values in the typed array, reading input values from a specified array. - * @param sourceArray the source array - * @param offset the offset into the target array at which to begin writing values from the source one - */ - @JsxFunction - public void set(final ScriptableObject sourceArray, final int offset) { - final Object lengthProperty = ScriptableObject.getProperty(sourceArray, "length"); - if (lengthProperty instanceof Number) { - final int length = ((Number) lengthProperty).intValue(); - for (int i = 0; i < length; i++) { - final Object value = sourceArray.get(i, sourceArray); - if (value == Scriptable.NOT_FOUND || value == Undefined.instance) { - put(i + offset, this, Double.NaN); - } - else if (value == null) { - put(i + offset, this, 0); - } - else if (value instanceof Wrapper) { - put(i + offset, this, ((Wrapper) value).unwrap()); - } - else { - put(i + offset, this, value); - } - } - } - } - - /** - * {@inheritDoc} - */ - @Override - public Object get(final int index, final Scriptable start) { - final int offset = index * getBytesPerElement() + getByteOffset(); - final ArrayBuffer buffer = getBuffer(); - if (buffer == null) { - return Scriptable.NOT_FOUND; - } - return fromArray(buffer.getBytes(), offset); - } - - /** - * {@inheritDoc} - */ - @Override - public void put(final int index, final Scriptable start, final Object value) { - getBuffer().setBytes(index * getBytesPerElement() + getByteOffset(), - value == null ? toByteArray(null) : toByteArray(Context.toNumber(value))); - } - - /** - * Converts the provided number to byte array. - * @param number the number - * @return the byte array - */ - protected byte[] toByteArray(final Number number) { - return null; - } - - /** - * Converts the provided byte array to number. - * @param array the array - * @param offset the offset - * @return the byte array - */ - protected Object fromArray(final byte[] array, final int offset) { - return null; - } - - /** - * Returns a new view on the ArrayBuffer store for this object. - * @param begin the offset to the first element in the array to be referenced by the new object - * @param end the end offset (exclusive), optional to return at the end. - * @return the newly created array - */ - @JsxFunction - public ArrayBufferView subarray(final int begin, Object end) { - if (end == Undefined.instance) { - end = getLength(); - } - try { - final ArrayBufferView object = getClass().newInstance(); - object.setPrototype(getPrototype()); - object.setParentScope(getParentScope()); - object.constructor(getBuffer(), begin, ((Number) end).intValue() - begin); - return object; - } - catch (final Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Returns the size in bytes of an item in this array. - * @return the size of bytes of an item - */ - protected int getBytesPerElement() { - return 1; - } - - /** - * @return the string version - */ - @JsxFunction(functionName = "toString") - public String jsToString() { - final int arrayLength = getLength(); - final StringBuilder builder = new StringBuilder(); - if (arrayLength > 0) { - builder.append(ScriptRuntime.toString(get(0, this))); - } - for (int i = 1; i < arrayLength; i++) { - builder.append(','); - builder.append(ScriptRuntime.toString(get(i, this))); - } - return builder.toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public Object getDefaultValue(final Class hint) { - if (String.class.equals(hint) || hint == null) { - return jsToString(); - } - return super.getDefaultValue(hint); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Atomics.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Atomics.java index cbd2d42da4b..6a0ccddce5c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Atomics.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Atomics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/DataView.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/DataView.java deleted file mode 100644 index 2e0767b3df8..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/DataView.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; - -import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; -import net.sourceforge.htmlunit.corejs.javascript.Undefined; - -/** - * The ArrayBufferView type describes a particular view on the contents of an {@link ArrayBuffer}'s data. - * - * @author Ahmed Ashour - * @author Frank Danek - */ -@JsxClass -public class DataView extends ArrayBufferView { - - /** - * JavaScript constructor. - * @param array the array - * @param byteOffset the byte offset - * @param length the length - */ - @JsxConstructor - public void constructor(final Object array, final int byteOffset, Object length) { - if (!(array instanceof ArrayBuffer)) { - throw ScriptRuntime.typeError("First argument to DataView constructor must be an ArrayBuffer"); - } - if (length == Undefined.instance) { - length = ((ArrayBuffer) array).getByteLength(); - } - super.constructor((ArrayBuffer) array, byteOffset, ((Number) length).intValue()); - } - - /** - * Gets a signed 8-bit integer at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @return the byte - */ - @JsxFunction - public byte getInt8(final int byteOffset) { - return getBuffer().getBytes()[getByteOffset() + byteOffset]; - } - - /** - * Sets the given signed 8-bit integer at the specified offset. - * @param byteOffset the byte offset - * @param value the value - */ - @JsxFunction - public void setInt8(final int byteOffset, final int value) { - final byte[] array = getBuffer().getBytes(); - array[getByteOffset() + byteOffset] = (byte) value; - } - - /** - * Gets a signed 16-bit integer at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @param littleEndian whether the value is stored in little- or big-endian format - * @return the value - */ - @JsxFunction - public short getInt16(final int byteOffset, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - return buff.getShort(getByteOffset() + byteOffset); - } - - /** - * Sets the given signed 16-bit integer at the specified offset. - * @param byteOffset the byte offset - * @param value the value - * @param littleEndian whether the value is stored in little- or big-endian format - */ - @JsxFunction - public void setInt16(final int byteOffset, final int value, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - buff.putShort(getByteOffset() + byteOffset, (short) value); - } - - /** - * Gets a signed 32-bit integer at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @param littleEndian whether the value is stored in little- or big-endian format - * @return the value - */ - @JsxFunction - public int getInt32(final int byteOffset, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - return buff.getInt(getByteOffset() + byteOffset); - } - - /** - * Sets the given signed 32-bit integer at the specified offset. - * @param byteOffset the byte offset - * @param value the value - * @param littleEndian whether the value is stored in little- or big-endian format - */ - @JsxFunction - public void setInt32(final int byteOffset, final int value, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - buff.putInt(getByteOffset() + byteOffset, value); - } - - /** - * Gets an unsigned 8-bit integer at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @return the value - */ - @JsxFunction - public int getUint8(final int byteOffset) { - return getBuffer().getBytes()[getByteOffset() + byteOffset] & 0xFF; - } - - /** - * Sets the given unsigned 8-bit integer at the specified offset. - * @param byteOffset the byte offset - * @param value the value - */ - @JsxFunction - public void setUint8(final int byteOffset, final int value) { - setInt8(byteOffset, value); - } - - /** - * Gets an unsigned 16-bit integer at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @param littleEndian whether the value is stored in little- or big-endian format - * @return the value - */ - @JsxFunction - public int getUint16(final int byteOffset, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - return buff.getShort(getByteOffset() + byteOffset) & 0xFFFF; - } - - /** - * Sets the given unsigned 16-bit integer at the specified offset. - * @param byteOffset the byte offset - * @param value the value - * @param littleEndian whether the value is stored in little- or big-endian format - */ - @JsxFunction - public void setUint16(final int byteOffset, final int value, final boolean littleEndian) { - setInt16(byteOffset, value, littleEndian); - } - - /** - * Gets an unsigned 32-bit integer at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @param littleEndian whether the value is stored in little- or big-endian format - * @return the value - */ - @JsxFunction - public long getUint32(final int byteOffset, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - return buff.getInt(getByteOffset() + byteOffset) & 0xFFFFFFFFL; - } - - /** - * Sets the given unsigned 32-bit integer at the specified offset. - * @param byteOffset the byte offset - * @param value the value - * @param littleEndian whether the value is stored in little- or big-endian format - */ - @JsxFunction - public void setUint32(final int byteOffset, final int value, final boolean littleEndian) { - setInt32(byteOffset, value, littleEndian); - } - - /** - * Gets a 32-bit floating point number at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @param littleEndian whether the value is stored in little- or big-endian format - * @return the value - */ - @JsxFunction - public float getFloat32(final int byteOffset, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - return buff.getFloat(getByteOffset() + byteOffset); - } - - /** - * Sets the given 32-bit floating point number at the specified offset. - * @param byteOffset the byte offset - * @param value the value - * @param littleEndian whether the value is stored in little- or big-endian format - */ - @JsxFunction - public void setFloat32(final int byteOffset, final double value, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - buff.putFloat(getByteOffset() + byteOffset, (float) value); - } - - /** - * Gets a 64-bit floating point number at the specified byte offset from the start of the view. - * @param byteOffset the byte offset - * @param littleEndian whether the value is stored in little- or big-endian format - * @return the value - */ - @JsxFunction - public double getFloat64(final int byteOffset, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - return buff.getDouble(getByteOffset() + byteOffset); - } - - /** - * Sets the given 32-bit floating point number at the specified offset. - * @param byteOffset the byte offset - * @param value the value - * @param littleEndian whether the value is stored in little- or big-endian format - */ - @JsxFunction - public void setFloat64(final int byteOffset, final double value, final boolean littleEndian) { - final ByteBuffer buff = ByteBuffer.wrap(getBuffer().getBytes()); - if (littleEndian) { - buff.order(ByteOrder.LITTLE_ENDIAN); - } - buff.putDouble(getByteOffset() + byteOffset, value); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Float32Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Float32Array.java deleted file mode 100644 index 11076f7ed69..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Float32Array.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of 32-bit floating point numbers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Float32Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 4; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - final ByteBuffer buff = ByteBuffer.allocate(BYTES_PER_ELEMENT); - buff.order(ByteOrder.LITTLE_ENDIAN); - buff.putFloat(number != null ? number.floatValue() : Float.NaN); - return buff.array(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - final ByteBuffer buff = ByteBuffer.wrap(array); - buff.order(ByteOrder.LITTLE_ENDIAN); - return buff.getFloat(offset); - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Float64Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Float64Array.java deleted file mode 100644 index 92ea811ec95..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Float64Array.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of 64-bit floating point numbers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Float64Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 8; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - final ByteBuffer buff = ByteBuffer.allocate(BYTES_PER_ELEMENT); - buff.order(ByteOrder.LITTLE_ENDIAN); - buff.putDouble(number != null ? number.doubleValue() : Double.NaN); - return buff.array(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - final ByteBuffer buff = ByteBuffer.wrap(array); - buff.order(ByteOrder.LITTLE_ENDIAN); - return buff.getDouble(offset); - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int16Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int16Array.java deleted file mode 100644 index 68e6e3bba60..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int16Array.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of twos-complement 16-bit signed integers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Int16Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 2; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - final ByteBuffer buff = ByteBuffer.allocate(BYTES_PER_ELEMENT); - buff.order(ByteOrder.LITTLE_ENDIAN); - if (number == null || Double.isInfinite(number.doubleValue())) { - buff.putShort((short) 0); - return buff.array(); - } - buff.putShort(number.shortValue()); - return buff.array(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - final ByteBuffer buff = ByteBuffer.wrap(array); - buff.order(ByteOrder.LITTLE_ENDIAN); - return buff.getShort(offset); - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int32Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int32Array.java deleted file mode 100644 index 6ffff08d4db..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int32Array.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of twos-complement 32-bit signed integers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Int32Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 4; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - final ByteBuffer buff = ByteBuffer.allocate(BYTES_PER_ELEMENT); - buff.order(ByteOrder.LITTLE_ENDIAN); - if (number == null || Double.isInfinite(number.doubleValue())) { - buff.putInt(0); - return buff.array(); - } - buff.putInt(number.intValue()); - return buff.array(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - final ByteBuffer buff = ByteBuffer.wrap(array); - buff.order(ByteOrder.LITTLE_ENDIAN); - return buff.getInt(offset); - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int8Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int8Array.java deleted file mode 100644 index 8bb493a682f..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Int8Array.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of twos-complement 8-bit signed integers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Int8Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 1; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - if (number == null || Double.isInfinite(number.doubleValue())) { - return new byte[] {0}; - } - return new byte[] {number.byteValue()}; - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - return array[offset]; - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/SharedArrayBuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/SharedArrayBuffer.java index a3b887eee60..038b84727c9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/SharedArrayBuffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/SharedArrayBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint16Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint16Array.java deleted file mode 100644 index 081435bb151..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint16Array.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of unsigned 16-bit integers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Uint16Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 2; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - final ByteBuffer buff = ByteBuffer.allocate(BYTES_PER_ELEMENT); - buff.order(ByteOrder.LITTLE_ENDIAN); - if (number == null || Double.isInfinite(number.doubleValue())) { - buff.putShort((short) 0); - return buff.array(); - } - buff.putShort(number.shortValue()); - return buff.array(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - final ByteBuffer buff = ByteBuffer.wrap(array); - buff.order(ByteOrder.LITTLE_ENDIAN); - return buff.getShort(offset) & 0xFFFF; - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint32Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint32Array.java deleted file mode 100644 index 51256ac110d..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint32Array.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of unsigned 32-bit integers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Uint32Array extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 4; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - final ByteBuffer buff = ByteBuffer.allocate(BYTES_PER_ELEMENT); - buff.order(ByteOrder.LITTLE_ENDIAN); - if (number == null || Double.isInfinite(number.doubleValue())) { - buff.putInt(0); - return buff.array(); - } - buff.putInt(number.intValue()); - return buff.array(); - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - final ByteBuffer buff = ByteBuffer.wrap(array); - buff.order(ByteOrder.LITTLE_ENDIAN); - return buff.getInt(offset) & 0xFFFFFFFFL; - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint8Array.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint8Array.java deleted file mode 100644 index c7f4dd5878e..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint8Array.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.host.Window; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of unsigned 16-bit integers. - * - * @author Ahmed Ashour - * @author Frank Danek - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Uint8Array extends ArrayBufferViewBase { - - /** - * Ctor. - */ - public Uint8Array() { - super(); - } - - /** - * Ctor. - * - * @param bytes the bytes to store - * @param window the context - */ - public Uint8Array(final byte[] bytes, final Window window) { - this(); - setPrototype(window.getPrototype(getClass())); - setParentScope(getParentScope()); - - setByteLength(bytes.length); - - final ArrayBuffer buffer = new ArrayBuffer(bytes); - buffer.setPrototype(window.getPrototype(buffer.getClass())); - buffer.setParentScope(getParentScope()); - setBuffer(buffer); - } - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 1; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(final Number number) { - if (number == null || Double.isInfinite(number.doubleValue())) { - return new byte[] {0}; - } - return new byte[] {number.byteValue()}; - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - return array[offset] & 0xFF; - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint8ClampedArray.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint8ClampedArray.java deleted file mode 100644 index 8f9c6bcfaf4..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/Uint8ClampedArray.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.arrays; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -import net.sourceforge.htmlunit.corejs.javascript.Scriptable; - -/** - * Represents an array of unsigned 16-bit integers. Values stored in this array are clamped to the range 0-255. - * - * @author Ahmed Ashour - * @author Ronald Brill - * @author Michael Rimov - */ -@JsxClass -public class Uint8ClampedArray extends ArrayBufferViewBase { - - /** The size, in bytes, of each array element. */ - @JsxConstant - public static final int BYTES_PER_ELEMENT = 1; - - /** - * {@inheritDoc} - */ - @Override - @JsxConstructor - public void constructor(final Object object, final Object byteOffset, final Object length) { - super.constructor(object, byteOffset, length); - } - - /** - * {@inheritDoc} - */ - @Override - protected byte[] toByteArray(Number number) { - if (number == null || number.intValue() < 0) { - number = 0; - } - else if (number.intValue() > 255) { - number = 255; - } - return new byte[] {number.byteValue()}; - } - - /** - * {@inheritDoc} - */ - @Override - protected Object fromArray(final byte[] array, final int offset) { - if (offset < 0 || offset >= array.length) { - return Scriptable.NOT_FOUND; - } - return array[offset] & 0xFF; - } - - /** - * {@inheritDoc} - */ - @Override - protected int getBytesPerElement() { - return BYTES_PER_ELEMENT; - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/package-info.java index 8f19c521c48..8ed8d00eb2d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/arrays/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/budget/BudgetService.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/budget/BudgetService.java deleted file mode 100644 index ed9cb66919e..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/budget/BudgetService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.budget; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -/** - * A JavaScript object for {@code BudgetService}. - * - * @author Ahmed Ashour - * @author Ronald Brill - */ -@JsxClass(CHROME) -public class BudgetService extends SimpleScriptable { - - /** - * Creates an instance. - */ - @JsxConstructor - public BudgetService() { - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStream.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStream.java index c317c6592d1..3248f8e8c85 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStream.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStreamTrack.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStreamTrack.java index 1f34c8e0575..ae0f77c3c49 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStreamTrack.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasCaptureMediaStreamTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasGradient.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasGradient.java index 143a43ab971..5092a6479c8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasGradient.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasGradient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -35,7 +34,7 @@ public class CanvasGradient extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CanvasGradient() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasPattern.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasPattern.java index cdfdbbd730e..114cc2dcefb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasPattern.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasPattern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class CanvasPattern extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CanvasPattern() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java index 6fa05d8be13..440e7800906 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/CanvasRenderingContext2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.canvas; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CANVAS_DRAW_THROWS_FOR_MISSING_IMG; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import java.io.IOException; import javax.imageio.ImageReader; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import com.gargoylesoftware.htmlunit.html.HtmlImage; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -49,13 +49,16 @@ */ @JsxClass public class CanvasRenderingContext2D extends SimpleScriptable { + + private static final Log LOG = LogFactory.getLog(CanvasRenderingContext2D.class); + private final HTMLCanvasElement canvas_; private RenderingBackend renderingBackend_; /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CanvasRenderingContext2D() { canvas_ = null; renderingBackend_ = null; @@ -79,12 +82,32 @@ private RenderingBackend getRenderingBackend() { return renderingBackend_; } + /** + * Specifies the alpha (transparency) value that is applied to shapes and images + * before they are drawn onto the canvas.. + * @return the {@code globalAlpha} property + */ + @JsxGetter + public double getGlobalAlpha() { + return getRenderingBackend().getGlobalAlpha(); + } + + /** + * Sets the {@code globalAlpha} property. + * @param globalAlpha the {@code globalAlpha} property + */ + @JsxSetter + public void setGlobalAlpha(final double globalAlpha) { + getRenderingBackend().setGlobalAlpha(globalAlpha); + } + /** * Returns the {@code fillStyle} property. * @return the {@code fillStyle} property */ @JsxGetter public Object getFillStyle() { + LOG.info("CanvasRenderingContext2D.getFillStyle() not yet implemented"); return null; } @@ -103,6 +126,7 @@ public void setFillStyle(final String fillStyle) { */ @JsxGetter public Object getStrokeStyle() { + LOG.info("CanvasRenderingContext2D.getStrokeStyle() not yet implemented"); return null; } @@ -111,8 +135,8 @@ public Object getStrokeStyle() { * @param strokeStyle the {@code strokeStyle} property */ @JsxSetter - public void setStrokeStyle(final Object strokeStyle) { - //empty + public void setStrokeStyle(final String strokeStyle) { + getRenderingBackend().setStrokeStyle(strokeStyle); } /** @@ -121,7 +145,7 @@ public void setStrokeStyle(final Object strokeStyle) { */ @JsxGetter public double getLineWidth() { - return 0; + return getRenderingBackend().getLineWidth(); } /** @@ -130,25 +154,12 @@ public double getLineWidth() { */ @JsxSetter public void setLineWidth(final Object lineWidth) { - //empty - } - - /** - * Returns the {@code globalAlpha} property. - * @return the {@code globalAlpha} property - */ - @JsxGetter - public double getGlobalAlpha() { - return 0; - } - - /** - * Sets the {@code globalAlpha} property. - * @param globalAlpha the {@code globalAlpha} property - */ - @JsxSetter - public void setGlobalAlpha(final Object globalAlpha) { - //empty + if (!Undefined.isUndefined(lineWidth)) { + final double width = Context.toNumber(lineWidth); + if (!Double.isNaN(width)) { + getRenderingBackend().setLineWidth((int) width); + } + } } /** @@ -163,7 +174,7 @@ public void setGlobalAlpha(final Object globalAlpha) { @JsxFunction public void arc(final double x, final double y, final double radius, final double startAngle, final double endAngle, final boolean anticlockwise) { - //empty + getRenderingBackend().arc(x, y, radius, startAngle, endAngle, anticlockwise); } /** @@ -177,7 +188,7 @@ public void arc(final double x, final double y, final double radius, final doubl @JsxFunction public void arcTo(final double x1, final double y1, final double x2, final double y2, final double radius) { - //empty + LOG.info("CanvasRenderingContext2D.arcTo() not yet implemented"); } /** @@ -185,7 +196,7 @@ public void arcTo(final double x1, final double y1, final double x2, final doubl */ @JsxFunction public void beginPath() { - //empty + getRenderingBackend().beginPath(); } /** @@ -200,7 +211,7 @@ public void beginPath() { @JsxFunction public void bezierCurveTo(final double cp1x, final double cp1y, final double cp2x, final double cp2y, final double x, final double y) { - //empty + getRenderingBackend().bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); } /** @@ -220,15 +231,15 @@ public void clearRect(final int x, final int y, final int w, final int h) { */ @JsxFunction public void clip() { - //empty + LOG.info("CanvasRenderingContext2D.clip() not yet implemented"); } /** - * Closes the subpaths. + * Closes the current subpath. */ @JsxFunction public void closePath() { - //empty + getRenderingBackend().closePath(); } /** @@ -236,7 +247,7 @@ public void closePath() { */ @JsxFunction public void createImageData() { - //empty + LOG.info("CanvasRenderingContext2D.createImageData() not yet implemented"); } /** @@ -263,7 +274,7 @@ public CanvasGradient createLinearGradient(final double x0, final double y0, fin */ @JsxFunction public void createPattern() { - //empty + LOG.info("CanvasRenderingContext2D.createPattern() not yet implemented"); } /** @@ -310,7 +321,7 @@ public void drawImage(final Object image, final int sx, final int sy, final Obje Integer dHeightI = null; Integer sWidthI = null; Integer sHeightI = null; - if (dx != Undefined.instance) { + if (!Undefined.isUndefined(dx)) { dxI = ((Number) dx).intValue(); dyI = ((Number) dy).intValue(); dWidthI = ((Number) dWidth).intValue(); @@ -320,7 +331,7 @@ public void drawImage(final Object image, final int sx, final int sy, final Obje dxI = sx; dyI = sy; } - if (sWidth != Undefined.instance) { + if (!Undefined.isUndefined(sWidth)) { sWidthI = ((Number) sWidth).intValue(); sHeightI = ((Number) sHeight).intValue(); } @@ -333,9 +344,6 @@ public void drawImage(final Object image, final int sx, final int sy, final Obje } } catch (final IOException ioe) { - if (getBrowserVersion().hasFeature(JS_CANVAS_DRAW_THROWS_FOR_MISSING_IMG)) { - throw Context.throwAsScriptRuntimeEx(ioe); - } } } @@ -368,12 +376,12 @@ public String toDataURL(String type) { * @param endAngle the endAngle * @param anticlockwise the anticlockwise */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public void ellipse(final double x, final double y, final double radiusX, final double radiusY, final double rotation, final double startAngle, final double endAngle, final boolean anticlockwise) { - //empty + getRenderingBackend().ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise); } /** @@ -381,7 +389,7 @@ public void ellipse(final double x, final double y, */ @JsxFunction public void fill() { - //empty + getRenderingBackend().fill(); } /** @@ -428,7 +436,7 @@ public ImageData getImageData(final int sx, final int sy, final int sw, final in */ @JsxFunction public void getLineDash() { - //empty + LOG.info("CanvasRenderingContext2D.getLineDash() not yet implemented"); } /** @@ -436,7 +444,7 @@ public void getLineDash() { */ @JsxFunction public void getLineData() { - //empty + LOG.info("CanvasRenderingContext2D.getLineData() not yet implemented"); } /** @@ -444,7 +452,7 @@ public void getLineData() { */ @JsxFunction public void isPointInPath() { - //empty + LOG.info("CanvasRenderingContext2D.isPointInPath() not yet implemented"); } /** @@ -454,7 +462,7 @@ public void isPointInPath() { */ @JsxFunction public void lineTo(final double x, final double y) { - //empty + getRenderingBackend().lineTo(x, y); } /** @@ -464,7 +472,7 @@ public void lineTo(final double x, final double y) { */ @JsxFunction public TextMetrics measureText(final Object text) { - if (text == null || Undefined.instance == text) { + if (text == null || Undefined.isUndefined(text)) { throw Context.throwAsScriptRuntimeEx( new RuntimeException("Missing argument for CanvasRenderingContext2D.measureText().")); } @@ -487,7 +495,7 @@ public TextMetrics measureText(final Object text) { */ @JsxFunction public void moveTo(final double x, final double y) { - //empty + getRenderingBackend().moveTo(x, y); } /** @@ -495,7 +503,7 @@ public void moveTo(final double x, final double y) { */ @JsxFunction public void putImageData() { - //empty + LOG.info("CanvasRenderingContext2D.putImageData() not yet implemented"); } /** @@ -508,7 +516,7 @@ public void putImageData() { @JsxFunction public void quadraticCurveTo(final double controlPointX, final double controlPointY, final double endPointX, final double endPointY) { - //empty + getRenderingBackend().quadraticCurveTo(controlPointX, controlPointY, endPointX, endPointY); } /** @@ -520,7 +528,7 @@ public void quadraticCurveTo(final double controlPointX, final double controlPoi */ @JsxFunction public void rect(final double x, final double y, final double w, final double h) { - //empty + getRenderingBackend().rect(x, y, w, h); } /** @@ -528,15 +536,16 @@ public void rect(final double x, final double y, final double w, final double h) */ @JsxFunction public void restore() { - //empty + getRenderingBackend().restore(); } /** - * Dummy placeholder. + * Adds a rotation to the transformation matrix. + * @param angle the angle */ @JsxFunction - public void rotate() { - //empty + public void rotate(final double angle) { + getRenderingBackend().rotate(angle); } /** @@ -544,7 +553,7 @@ public void rotate() { */ @JsxFunction public void save() { - //empty + getRenderingBackend().save(); } /** @@ -554,7 +563,7 @@ public void save() { */ @JsxFunction public void scale(final Object x, final Object y) { - //empty + LOG.info("CanvasRenderingContext2D.scale() not yet implemented"); } /** @@ -562,15 +571,24 @@ public void scale(final Object x, final Object y) { */ @JsxFunction public void setLineDash() { - //empty + LOG.info("CanvasRenderingContext2D.setLineDash() not yet implemented"); } /** - * Dummy placeholder. + * Resets (overrides) the current transformation to the identity matrix, + * and then invokes a transformation described by the arguments of this method. + * This lets you scale, rotate, translate (move), and skew the context. + * @param m11 Horizontal scaling. A value of 1 results in no scaling + * @param m12 Vertical skewing + * @param m21 Horizontal skewing + * @param m22 Vertical scaling. A value of 1 results in no scaling + * @param dx Horizontal translation (moving) + * @param dy Vertical translation (moving). */ @JsxFunction - public void setTransform() { - //empty + public void setTransform(final double m11, final double m12, + final double m21, final double m22, final double dx, final double dy) { + getRenderingBackend().setTransform(m11, m12, m21, m22, dx, dy); } /** @@ -578,7 +596,7 @@ public void setTransform() { */ @JsxFunction public void stroke() { - //empty + getRenderingBackend().stroke(); } /** @@ -598,15 +616,24 @@ public void strokeRect(final int x, final int y, final int w, final int h) { */ @JsxFunction public void strokeText() { - //empty + LOG.info("CanvasRenderingContext2D.strokeText() not yet implemented"); } /** - * Dummy placeholder. + * Multiplies the current transformation with the matrix described by the + * arguments of this method. This lets you scale, rotate, translate (move), + * and skew the context. + * @param m11 Horizontal scaling. A value of 1 results in no scaling + * @param m12 Vertical skewing + * @param m21 Horizontal skewing + * @param m22 Vertical scaling. A value of 1 results in no scaling + * @param dx Horizontal translation (moving) + * @param dy Vertical translation (moving). */ @JsxFunction - public void transform() { - //empty + public void transform(final double m11, final double m12, + final double m21, final double m22, final double dx, final double dy) { + getRenderingBackend().transform(m11, m12, m21, m22, dx, dy); } /** @@ -615,8 +642,8 @@ public void transform() { * @param y the translation distance in the vertical direction */ @JsxFunction - public void translate(final Object x, final Object y) { - // empty + public void translate(final int x, final int y) { + getRenderingBackend().translate(x, y); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java index 290bc02e925..24d37119318 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageBitmapRenderingContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,8 +25,9 @@ * A JavaScript object for {@code ImageBitmapRenderingContext}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class ImageBitmapRenderingContext extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageData.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageData.java index 0ee972c6e83..fb750079956 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ImageData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,18 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8ClampedArray; import com.gargoylesoftware.htmlunit.javascript.host.canvas.rendering.RenderingBackend; +import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeUint8ClampedArray; + /** * A JavaScript object for {@code ImageData}. * @@ -40,12 +41,12 @@ public class ImageData extends SimpleScriptable { private final int sy_; private final int width_; private final int height_; - private Uint8ClampedArray data_; + private NativeUint8ClampedArray data_; /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public ImageData() { this(null, 0, 0, 0, 0); } @@ -77,23 +78,20 @@ public int getHeight() { } /** - * Returns a {@link Uint8ClampedArray} representing a one-dimensional array containing + * Returns a {@link NativeUint8ClampedArray} representing a one-dimensional array containing * the data in the RGBA order, with integer values between 0 and 255 (included). * @return the {@code data} property */ @JsxGetter - public Uint8ClampedArray getData() { + public NativeUint8ClampedArray getData() { if (data_ == null) { final byte[] bytes = renderingContext_.getBytes(width_, height_, sx_, sy_); - final ArrayBuffer arrayBuffer = new ArrayBuffer(); - arrayBuffer.constructor(bytes.length); - arrayBuffer.setBytes(0, bytes); + final NativeArrayBuffer arrayBuffer = new NativeArrayBuffer(bytes.length); + System.arraycopy(bytes, 0, arrayBuffer.getBuffer(), 0, bytes.length); - data_ = new Uint8ClampedArray(); + data_ = new NativeUint8ClampedArray(arrayBuffer, 0, bytes.length); data_.setParentScope(getParentScope()); - data_.setPrototype(getPrototype(data_.getClass())); - - data_.constructor(arrayBuffer, 0, bytes.length); + data_.setPrototype(ScriptableObject.getClassPrototype(getWindow(this), data_.getClassName())); } return data_; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserver.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserver.java index 542e9960c68..00ac3a554a9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,8 +27,9 @@ * A JavaScript object for {@code IntersectionObserver}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class IntersectionObserver extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserverEntry.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserverEntry.java index f337b14ffe4..f4ed38fba75 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserverEntry.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/IntersectionObserverEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code IntersectionObserverEntry}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class IntersectionObserverEntry extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/Path2D.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/Path2D.java index 892bece68ef..fa7a07ca794 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/Path2D.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/Path2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/TextMetrics.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/TextMetrics.java index 18443ab5e75..cd7b48ff1de 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/TextMetrics.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/TextMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -37,7 +36,7 @@ public class TextMetrics extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TextMetrics() { width_ = 0; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java index b1eda2fc26f..3dbbbde82c8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGL2RenderingContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -28,8 +27,9 @@ * A JavaScript object for {@code WebGL2RenderingContext}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class WebGL2RenderingContext extends SimpleScriptable { /** The constant {@code ACTIVE_ATTRIBUTES}. */ @@ -1645,7 +1645,7 @@ public class WebGL2RenderingContext extends SimpleScriptable { public static final long STENCIL_FUNC = 2962L; /** The constant {@code STENCIL_INDEX}. */ - @JsxConstant({FF52, FF45, IE}) + @JsxConstant(IE) public static final long STENCIL_INDEX = 6401L; /** The constant {@code STENCIL_INDEX8}. */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLActiveInfo.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLActiveInfo.java index a4023708bff..9d79498c0ec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLActiveInfo.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLActiveInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLActiveInfo extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLActiveInfo() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLBuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLBuffer.java index 47c64ffab2b..a1533395422 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLBuffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLBuffer extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLBuffer() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLFramebuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLFramebuffer.java index d953f315ad1..ba18426202e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLFramebuffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLFramebuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLFramebuffer extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLFramebuffer() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLProgram.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLProgram.java index c8762169dfd..b4cbdde2423 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLProgram.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLProgram.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLProgram extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLProgram() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java index d4e3c7fa0da..d1e05aca93f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class WebGLQuery extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderbuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderbuffer.java index 527c518d350..6d1baf79788 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderbuffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderbuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLRenderbuffer extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLRenderbuffer() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderingContext.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderingContext.java index 4f2e0226d64..c3c83a94f3f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderingContext.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLRenderingContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -340,7 +337,7 @@ public class WebGLRenderingContext extends SimpleScriptable { @JsxConstant public static final int TEXTURE = 0x1702; /** The constant {@code STENCIL_INDEX}. */ - @JsxConstant({FF52, FF45, IE}) + @JsxConstant(IE) public static final int STENCIL_INDEX = 0x1901; /** The constant {@code DEPTH_COMPONENT}. */ @JsxConstant @@ -934,7 +931,7 @@ public class WebGLRenderingContext extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLRenderingContext() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java index f0946a04556..3fb1af6693c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class WebGLSampler extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShader.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShader.java index 4fb1fa71718..f1dfcc277cc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLShader extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLShader() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShaderPrecisionFormat.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShaderPrecisionFormat.java index f13ad3468e1..3b5eee6e27a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShaderPrecisionFormat.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLShaderPrecisionFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLShaderPrecisionFormat extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLShaderPrecisionFormat() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java index a25ae96f438..2869b5dfb55 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLSync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class WebGLSync extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTexture.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTexture.java index ff4db482fe4..4d7390d2231 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTexture.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTexture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLTexture extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLTexture() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java index 1b7b0fea6f7..0d8ee52ebe9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLTransformFeedback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class WebGLTransformFeedback extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLUniformLocation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLUniformLocation.java index 78af882600e..e86cb4896db 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLUniformLocation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLUniformLocation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class WebGLUniformLocation extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WebGLUniformLocation() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java index 88d60d608d3..9f172d4f7f8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/WebGLVertexArrayObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.canvas; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +26,7 @@ * * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class WebGLVertexArrayObject extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/ANGLE_instanced_arrays.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/ANGLE_instanced_arrays.java index 483343b0dac..352a96c0263 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/ANGLE_instanced_arrays.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/ANGLE_instanced_arrays.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/EXT_texture_filter_anisotropic.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/EXT_texture_filter_anisotropic.java index 17922e340b5..e3483fd78a5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/EXT_texture_filter_anisotropic.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/EXT_texture_filter_anisotropic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_element_index_uint.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_element_index_uint.java index 0f0b261ef89..274c78f026e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_element_index_uint.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_element_index_uint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_standard_derivatives.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_standard_derivatives.java index db5125eeef4..4bd4848729d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_standard_derivatives.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_standard_derivatives.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float.java index 101f5df6304..4696b8dfd10 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float_linear.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float_linear.java index 4825f1ed606..cc7b1439ceb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float_linear.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/OES_texture_float_linear.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_compressed_texture_s3tc.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_compressed_texture_s3tc.java index 7159b1395dc..e79dae5bfc3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_compressed_texture_s3tc.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_compressed_texture_s3tc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_debug_renderer_info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_debug_renderer_info.java index 6bfac0cb75a..c1bea127ae1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_debug_renderer_info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/WEBGL_debug_renderer_info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/package-info.java index 0b0ad6030fc..3ed5b2a1175 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/ext/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/package-info.java index c5fb4194da3..56e303986e7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/AwtRenderingBackend.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/AwtRenderingBackend.java index ce032d00a01..f1b69dc3143 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/AwtRenderingBackend.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/AwtRenderingBackend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,26 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.canvas.rendering; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; import java.awt.Color; +import java.awt.FontMetrics; import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.AffineTransform; +import java.awt.geom.Arc2D; +import java.awt.geom.Path2D; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.List; import javax.imageio.ImageIO; import javax.imageio.ImageReader; @@ -28,6 +42,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.gargoylesoftware.htmlunit.util.StringUtils; + /** * The default implementation of {@link RenderingBackend}. * @@ -40,6 +56,15 @@ public class AwtRenderingBackend implements RenderingBackend { private final BufferedImage image_; private final Graphics2D graphics2D_; + private AffineTransform transformation_; + private float globalAlpha_; + private int lineWidth_; + private Color fillColor_; + private Color strokeColor_; + + private List subPaths_; + private Deque savedStates_; + /** * Constructor. * @param imageWidth the width @@ -48,9 +73,272 @@ public class AwtRenderingBackend implements RenderingBackend { public AwtRenderingBackend(final int imageWidth, final int imageHeight) { image_ = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_ARGB); graphics2D_ = image_.createGraphics(); + + graphics2D_.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + graphics2D_.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + graphics2D_.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + + reset(); + graphics2D_.setBackground(new Color(0f, 0f, 0f, 0f)); graphics2D_.setColor(Color.black); graphics2D_.clearRect(0, 0, imageWidth, imageHeight); + + subPaths_ = new ArrayList<>(); + savedStates_ = new ArrayDeque<>(); + } + + private void reset() { + fillColor_ = Color.black; + strokeColor_ = Color.black; + lineWidth_ = 1; + transformation_ = new AffineTransform(); + setGlobalAlpha(1.0); + } + + /** + * {@inheritDoc} + */ + @Override + public double getGlobalAlpha() { + return globalAlpha_; + } + + /** + * {@inheritDoc} + */ + @Override + public void setGlobalAlpha(final double globalAlpha) { + if (globalAlpha >= 0 && globalAlpha <= 1) { + globalAlpha_ = (float) globalAlpha; + final AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, globalAlpha_); + graphics2D_.setComposite(composite); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void beginPath() { + subPaths_.clear(); + } + + /** + * {@inheritDoc} + */ + @Override + public void ellipse(final double x, final double y, + final double radiusX, final double radiusY, + final double rotation, final double startAngle, final double endAngle, + final boolean anticlockwise) { + final Path2D subPath = getCurrentSubPath(); + if (subPath != null) { + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + final double startAngleDegree = 360 - (startAngle * 180 / Math.PI); + final double endAngleDegree = 360 - (endAngle * 180 / Math.PI); + + double extendAngle = startAngleDegree - endAngleDegree; + extendAngle = Math.min(360, Math.abs(extendAngle)); + if (anticlockwise && extendAngle < 360) { + extendAngle = extendAngle - 360; + } + + final AffineTransform transformation = new AffineTransform(); + transformation.rotate(rotation, p.getX(), p.getY()); + final Arc2D arc = new Arc2D.Double(p.getX() - radiusX, p.getY() - radiusY, radiusX * 2, radiusY * 2, + startAngleDegree, extendAngle * -1, Arc2D.OPEN); + subPath.append(transformation.createTransformedShape(arc), false); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void bezierCurveTo(final double cp1x, final double cp1y, + final double cp2x, final double cp2y, final double x, final double y) { + final Path2D subPath = getCurrentSubPath(); + if (subPath != null) { + final Point2D cp1 = transformation_.transform(new Point2D.Double(cp1x, cp1y), null); + final Point2D cp2 = transformation_.transform(new Point2D.Double(cp2x, cp2y), null); + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + subPath.curveTo(cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), p.getX(), p.getY()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void arc(final double x, final double y, final double radius, final double startAngle, + final double endAngle, final boolean anticlockwise) { + final Path2D subPath = getCurrentSubPath(); + if (subPath != null) { + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + final double startAngleDegree = 360 - (startAngle * 180 / Math.PI); + final double endAngleDegree = 360 - (endAngle * 180 / Math.PI); + + double extendAngle = startAngleDegree - endAngleDegree; + extendAngle = Math.min(360, Math.abs(extendAngle)); + if (anticlockwise && extendAngle < 360) { + extendAngle = extendAngle - 360; + } + final Arc2D arc = new Arc2D.Double(p.getX() - radius, p.getY() - radius, radius * 2, radius * 2, + startAngleDegree, extendAngle * -1, Arc2D.OPEN); + subPath.append(arc, false); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void clearRect(final int x, final int y, final int w, final int h) { + graphics2D_.setTransform(transformation_); + graphics2D_.setColor(fillColor_); + graphics2D_.clearRect(x, y, w, h); + } + + /** + * {@inheritDoc} + */ + @Override + public void drawImage(final ImageReader imageReader, final int dxI, final int dyI) throws IOException { + if (imageReader.getNumImages(true) != 0) { + final BufferedImage img = imageReader.read(0); + graphics2D_.setTransform(transformation_); + graphics2D_.setColor(fillColor_); + graphics2D_.drawImage(img, dxI, dyI, image_.getWidth(), image_.getHeight(), null); + } + } + + /** + * {@inheritDoc} + */ + @Override + public String encodeToString(final String type) throws IOException { + String imageType = type; + if (imageType != null && imageType.startsWith("image/")) { + imageType = imageType.substring(6); + } + try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { + ImageIO.write(image_, imageType, bos); + + final byte[] imageBytes = bos.toByteArray(); + return new String(new Base64().encode(imageBytes), StandardCharsets.US_ASCII); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void fill() { + graphics2D_.setTransform(new AffineTransform()); + graphics2D_.setStroke(new BasicStroke(getLineWidth())); + graphics2D_.setColor(fillColor_); + for (Path2D path2d : subPaths_) { + graphics2D_.fill(path2d); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void fillRect(final int x, final int y, final int w, final int h) { + graphics2D_.setTransform(transformation_); + graphics2D_.setColor(fillColor_); + graphics2D_.fillRect(x, y, w, h); + } + + /** + * {@inheritDoc} + */ + @Override + public void fillText(final String text, final int x, final int y) { + graphics2D_.setTransform(new AffineTransform()); + + final FontMetrics metrics = graphics2D_.getFontMetrics(); + final int width = metrics.stringWidth(text); + final int ascent = metrics.getAscent(); + + final float posX = x - width / 2; + final float posY = y + ascent / 2; + + graphics2D_.setTransform(transformation_); + graphics2D_.setColor(fillColor_); + graphics2D_.drawString(text, posX, posY); + } + + /** + * {@inheritDoc} + */ + @Override + public byte[] getBytes(final int width, final int height, final int sx, final int sy) { + final byte[] array = new byte[width * height * 4]; + int index = 0; + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + final int color = image_.getRGB(sx + x, sy + y); + array[index++] = (byte) ((color & 0xff0000) >> 16); + array[index++] = (byte) ((color & 0xff00) >> 8); + array[index++] = (byte) (color & 0xff); + array[index++] = (byte) ((color & 0xff000000) >>> 24); + } + } + return array; + } + + /** + * {@inheritDoc} + */ + @Override + public void lineTo(final double x, final double y) { + final Path2D subPath = getCurrentSubPath(); + if (subPath != null) { + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + subPath.lineTo(p.getX(), p.getY()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void moveTo(final double x, final double y) { + final Path2D subPath = new Path2D.Double(); + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + subPath.moveTo(p.getX(), p.getY()); + subPaths_.add(subPath); + } + + /** + * {@inheritDoc} + */ + @Override + public void quadraticCurveTo(final double cpx, final double cpy, + final double x, final double y) { + final Path2D subPath = getCurrentSubPath(); + if (subPath != null) { + final Point2D cp = transformation_.transform(new Point2D.Double(cpx, cpy), null); + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + subPath.quadTo(cp.getX(), cp.getY(), p.getX(), p.getY()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void rect(final double x, final double y, final double w, final double h) { + final Path2D subPath = getCurrentSubPath(); + if (subPath != null) { + final Point2D p = transformation_.transform(new Point2D.Double(x, y), null); + final Rectangle2D rect = new Rectangle2D.Double(p.getX(), p.getY(), w, h); + subPath.append(rect, false); + } } /** @@ -69,7 +357,7 @@ else if (tmpFillStyle.startsWith("rgba(")) { color = new Color(Integer.parseInt(colors[0]), Integer.parseInt(colors[1]), Integer.parseInt(colors[2]), (int) (Float.parseFloat(colors[3]) * 255)); } - else if (tmpFillStyle.startsWith("#")) { + else if (tmpFillStyle.length() > 0 && tmpFillStyle.charAt(0) == '#') { color = Color.decode(tmpFillStyle); } else { @@ -78,89 +366,181 @@ else if (tmpFillStyle.startsWith("#")) { color = (Color) f.get(null); } catch (final Exception e) { - LOG.info("Can not find color '" + tmpFillStyle + '\''); + if (LOG.isInfoEnabled()) { + LOG.info("Can not find color '" + tmpFillStyle + '\''); + } color = Color.black; } } - graphics2D_.setColor(color); + fillColor_ = color; } /** * {@inheritDoc} */ @Override - public void clearRect(final int x, final int y, final int w, final int h) { - graphics2D_.clearRect(x, y, w, h); + public void setStrokeStyle(final String strokeStyle) { + final String tmpFillStyle = strokeStyle.replaceAll("\\s", ""); + Color color = StringUtils.findColorRGB(tmpFillStyle); + if (color == null) { + color = StringUtils.findColorRGBA(tmpFillStyle); + } + + if (color == null) { + if (tmpFillStyle.length() > 0 && tmpFillStyle.charAt(0) == '#') { + color = Color.decode(tmpFillStyle); + } + else { + try { + final Field f = Color.class.getField(tmpFillStyle); + color = (Color) f.get(null); + } + catch (final Exception e) { + if (LOG.isInfoEnabled()) { + LOG.info("Can not find color '" + tmpFillStyle + '\''); + } + color = Color.black; + } + } + } + strokeColor_ = color; } /** * {@inheritDoc} */ @Override - public void fillRect(final int x, final int y, final int w, final int h) { - graphics2D_.fillRect(x, y, w, h); + public int getLineWidth() { + return lineWidth_; } /** * {@inheritDoc} */ @Override - public void strokeRect(final int x, final int y, final int w, final int h) { - graphics2D_.drawRect(x, y, w, h); + public void restore() { + if (savedStates_.isEmpty()) { + return; + } + + savedStates_.pop().applyOn(this); } /** * {@inheritDoc} */ @Override - public void fillText(final String text, final int x, final int y) { - graphics2D_.drawString(text, x, y); + public void rotate(final double angle) { + transformation_.rotate(angle); } /** * {@inheritDoc} */ @Override - public void drawImage(final ImageReader imageReader, final int dxI, final int dyI) throws IOException { - if (imageReader.getNumImages(true) != 0) { - final BufferedImage img = imageReader.read(0); - graphics2D_.drawImage(img, dxI, dyI, image_.getWidth(), image_.getHeight(), null); - } + public void save() { + savedStates_.push(new SaveState(this)); + reset(); } /** * {@inheritDoc} */ @Override - public byte[] getBytes(final int width, final int height, final int sx, final int sy) { - final byte[] array = new byte[width * height * 4]; - int index = 0; - for (int x = 0; x < width; x++) { - for (int y = 0; y < height; y++) { - final Color c = new Color(image_.getRGB(sx + x, sy + y), true); - array[index++] = (byte) c.getRed(); - array[index++] = (byte) c.getGreen(); - array[index++] = (byte) c.getBlue(); - array[index++] = (byte) c.getAlpha(); - } + public void setLineWidth(final int lineWidth) { + lineWidth_ = lineWidth; + } + + /** + * {@inheritDoc} + */ + @Override + public void setTransform(final double m11, final double m12, + final double m21, final double m22, final double dx, final double dy) { + transformation_ = new AffineTransform(m11, m12, m21, m22, dx, dy); + } + + /** + * {@inheritDoc} + */ + @Override + public void stroke() { + graphics2D_.setTransform(new AffineTransform()); + graphics2D_.setStroke(new BasicStroke(getLineWidth())); + graphics2D_.setColor(strokeColor_); + for (Path2D path2d : subPaths_) { + graphics2D_.draw(path2d); } - return array; } /** * {@inheritDoc} */ @Override - public String encodeToString(final String type) throws IOException { - String imageType = type; - if (imageType != null && imageType.startsWith("image/")) { - imageType = imageType.substring(6); + public void strokeRect(final int x, final int y, final int w, final int h) { + graphics2D_.setTransform(transformation_); + graphics2D_.setColor(strokeColor_); + graphics2D_.drawRect(x, y, w, h); + } + + /** + * {@inheritDoc} + */ + @Override + public void transform(final double m11, final double m12, + final double m21, final double m22, final double dx, final double dy) { + transformation_.concatenate(new AffineTransform(m11, m12, m21, m22, dx, dy)); + } + + /** + * {@inheritDoc} + */ + @Override + public void translate(final int x, final int y) { + transformation_.translate(x, y); + } + + /** + * {@inheritDoc} + */ + @Override + public void closePath() { + if (subPaths_.isEmpty()) { + return; } - try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { - ImageIO.write(image_, imageType, bos); + subPaths_.get(subPaths_.size() - 1).closePath(); + } - final byte[] imageBytes = bos.toByteArray(); - return new String(new Base64().encode(imageBytes)); + private Path2D getCurrentSubPath() { + if (subPaths_.isEmpty()) { + final Path2D subPath = new Path2D.Double(); + subPaths_.add(subPath); + return subPath; + } + return subPaths_.get(subPaths_.size() - 1); + } + + private static final class SaveState { + private AffineTransform transformation_; + private float globalAlpha_; + private int lineWidth_; + private Color fillColor_; + private Color strokeColor_; + + private SaveState(final AwtRenderingBackend backend) { + transformation_ = backend.transformation_; + globalAlpha_ = backend.globalAlpha_; + lineWidth_ = backend.lineWidth_; + fillColor_ = backend.fillColor_; + strokeColor_ = backend.strokeColor_; + } + + private void applyOn(final AwtRenderingBackend backend) { + backend.transformation_ = transformation_; + backend.globalAlpha_ = globalAlpha_; + backend.lineWidth_ = lineWidth_; + backend.fillColor_ = fillColor_; + backend.strokeColor_ = strokeColor_; } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/RenderingBackend.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/RenderingBackend.java index 4534a097363..39afbfc7b3f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/RenderingBackend.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/RenderingBackend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,37 @@ public interface RenderingBackend { /** - * Sets the {@code fillStyle} property. - * @param fillStyle the {@code fillStyle} property + * Starts a new path by emptying the list of sub-paths. */ - void setFillStyle(String fillStyle); + void beginPath(); + + /** + * Adds a cubic Bézier curve to the current sub-path. It requires + * three points: the first two are control points and the third one + * is the end point. The starting point is the latest point in the + * current path, which can be changed using moveTo() before + * creating the Bézier curve. + * @param cp1x the cp1x + * @param cp1y the cp1y + * @param cp2x the cp2x + * @param cp2y the cp2y + * @param x the x + * @param y the y + */ + void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, + double x, double y); + + /** + * Adds a circular arc to the current sub-path. + * @param x the x + * @param y the y + * @param radius the radius + * @param startAngle the start angle + * @param endAngle the end angle + * @param anticlockwise is anti-clockwise + */ + void arc(double x, double y, double radius, double startAngle, + double endAngle, boolean anticlockwise); /** * Paints the specified rectangular area. @@ -42,13 +69,46 @@ public interface RenderingBackend { void clearRect(int x, int y, int w, int h); /** - * Paints the specified rectangular area. + * Draws images onto the context. + * + * @param imageReader the reader to read the image from 8the first one) + * @param dxI the x coordinate of the starting point (top left) + * @param dyI the y coordinate of the starting point (top left) + * @throws IOException in case o problems + */ + void drawImage(ImageReader imageReader, int dxI, int dyI) throws IOException; + + /** + * Constructs a base64 encoded string out of the image data. + * + * @param type the name of the image format + * @return the base64 encoded string + * @throws IOException in case o problems + */ + String encodeToString(String type) throws IOException; + + /** + * Creates an elliptical arc centered at (x, y) with the radii radiusX and radiusY. + * The path starts at startAngle and ends at endAngle, and travels in the direction + * given by anticlockwise (defaulting to clockwise). * @param x the x * @param y the y - * @param w the width - * @param h the height + * @param radiusX the radiusX + * @param radiusY the radiusY + * @param rotation the rotation + * @param startAngle the start angle + * @param endAngle the end angle + * @param anticlockwise is anti-clockwise */ - void fillRect(int x, int y, int w, int h); + void ellipse(double x, double y, + double radiusX, double radiusY, + double rotation, double startAngle, double endAngle, + boolean anticlockwise); + + /** + * Fills the current or given path with the current fillStyle. + */ + void fill(); /** * Paints the specified rectangular area. @@ -57,7 +117,7 @@ public interface RenderingBackend { * @param w the width * @param h the height */ - void strokeRect(int x, int y, int w, int h); + void fillRect(int x, int y, int w, int h); /** * Fills a given text at the given (x, y) position. @@ -67,16 +127,6 @@ public interface RenderingBackend { */ void fillText(String text, int x, int y); - /** - * Draws images onto the context. - * - * @param imageReader the reader to read the image from 8the first one) - * @param dxI the x coordinate of the starting point (top left) - * @param dyI the y coordinate of the starting point (top left) - * @throws IOException in case o problems - */ - void drawImage(ImageReader imageReader, int dxI, int dyI) throws IOException; - /** * Creates a byte array containing the (4) color values of all pixels. * @@ -89,11 +139,149 @@ public interface RenderingBackend { byte[] getBytes(int width, int height, int sx, int sy); /** - * Constructs a base64 encoded string out of the image data. - * - * @param type the name of the image format - * @return the base64 encoded string - * @throws IOException in case o problems + * Adds a straight line to the current sub-path by connecting the + * sub-path's last point to the specified (x, y) coordinates. + * @param x the x + * @param y the y */ - String encodeToString(String type) throws IOException; + void lineTo(double x, double y); + + /** + * Begins a new sub-path at the point specified + * by the given (x, y) coordinates. + * @param x the x + * @param y the y + */ + void moveTo(double x, double y); + + /** + * Adds a quadratic Bézier curve to the current sub-path. It requires + * two points: the first one is a control point and the second one is + * the end point. The starting point is the latest point in the + * current path, which can be changed using moveTo() before + * creating the quadratic Bézier curve. + * @param cpx the cpx + * @param cpy the cpy + * @param x the x + * @param y the y + */ + void quadraticCurveTo(double cpx, double cpy, double x, double y); + + /** + * Adds a rectangle to the current path. + * @param x the x + * @param y the y + * @param w the width + * @param h the height + */ + void rect(double x, double y, double w, double h); + + /** + * Restores the most recently saved canvas state by popping the top + * entry in the drawing state stack. If there is no saved state, + * this method does nothing. + */ + void restore(); + + /** + * Adds a rotation to the transformation matrix. + * @param angle the angle + */ + void rotate(double angle); + + /** + * Saves the entire state of the canvas by pushing + * the current state onto a stack. + */ + void save(); + + /** + * Sets the {@code fillStyle} property. + * @param fillStyle the {@code fillStyle} property + */ + void setFillStyle(String fillStyle); + + /** + * Sets the {@code strokeStyle} property. + * @param strokeStyle the {@code strokeStyle} property + */ + void setStrokeStyle(String strokeStyle); + + /** + * Returns the {@code lineWidth} property. + * @return the {@code lineWidth} property + */ + int getLineWidth(); + + /** + * Sets the {@code lineWidth} property. + * @param lineWidth the {@code lineWidth} property + */ + void setLineWidth(int lineWidth); + + /** + * Resets (overrides) the current transformation to the identity matrix, + * and then invokes a transformation described by the arguments of this method. + * This lets you scale, rotate, translate (move), and skew the context. + * @param m11 Horizontal scaling. A value of 1 results in no scaling + * @param m12 Vertical skewing + * @param m21 Horizontal skewing + * @param m22 Vertical scaling. A value of 1 results in no scaling + * @param dx Horizontal translation (moving) + * @param dy Vertical translation (moving). + */ + void setTransform(double m11, double m12, double m21, double m22, double dx, double dy); + + /** + * Strokes (outlines) the current or given path with the current stroke style. + */ + void stroke(); + + /** + * Paints the specified rectangular area. + * @param x the x + * @param y the y + * @param w the width + * @param h the height + */ + void strokeRect(int x, int y, int w, int h); + + /** + * Multiplies the current transformation with the matrix described by the + * arguments of this method. This lets you scale, rotate, translate (move), + * and skew the context. + * @param m11 Horizontal scaling. A value of 1 results in no scaling + * @param m12 Vertical skewing + * @param m21 Horizontal skewing + * @param m22 Vertical scaling. A value of 1 results in no scaling + * @param dx Horizontal translation (moving) + * @param dy Vertical translation (moving). + */ + void transform(double m11, double m12, double m21, double m22, double dx, double dy); + + /** + * Adds a translation transformation to the current matrix. + * @param x the x + * @param y the y + */ + void translate(int x, int y); + + /** + * Attempts to add a straight line from the current point to the start of the current sub-path. + * If the shape has already been closed or has only one point, this function does nothing. + */ + void closePath(); + + /** + * @return the alpha (transparency) value that is applied to shapes and images + * before they are drawn onto the canvas. + */ + double getGlobalAlpha(); + + /** + * Specifies the alpha (transparency) value that is applied to shapes and images + * before they are drawn onto the canvas. + * @param globalAlpha the new alpha + */ + void setGlobalAlpha(double globalAlpha); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/package-info.java index 44893e29a55..ab1ab05a6e4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/canvas/rendering/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/Crypto.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/Crypto.java index de48c5b4bde..33299e50daa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/Crypto.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/Crypto.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.crypto; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.Random; @@ -26,9 +25,9 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.host.Window; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeTypedArrayView; /** * A JavaScript object for {@code Crypto}. @@ -43,7 +42,7 @@ public class Crypto extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Crypto() { } @@ -62,13 +61,13 @@ public Crypto(final Window window) { * @see MDN Doc */ @JsxFunction - public void getRandomValues(final ArrayBufferViewBase array) { + public void getRandomValues(final NativeTypedArrayView array) { if (array == null) { throw Context.reportRuntimeError("TypeError: Argument 1 of Crypto.getRandomValues is not an object."); } final Random random = new Random(); - for (int i = 0; i < array.getLength(); i++) { + for (int i = 0; i < array.getByteLength() / array.getBytesPerElement(); i++) { array.put(i, array, random.nextInt()); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/CryptoKey.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/CryptoKey.java index d935b417a8e..8bddd1a0d31 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/CryptoKey.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/CryptoKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.crypto; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class CryptoKey extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/SubtleCrypto.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/SubtleCrypto.java index 003c0f7b687..182466297d3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/SubtleCrypto.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/SubtleCrypto.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.crypto; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -34,7 +33,7 @@ public class SubtleCrypto extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SubtleCrypto() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/package-info.java index 68c69b974b5..49997ac47e5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/crypto/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/BrowserConfiguration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/BrowserConfiguration.java index 5e014c77c02..7f978630d15 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/BrowserConfiguration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/BrowserConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,12 +53,12 @@ static BrowserConfiguration chrome(final String defaultValue) { return browserConfiguration; } - static BrowserConfiguration ffBelow52(final String defaultValue) { - return ff(defaultValue).upTo(51); + static BrowserConfiguration ffBelow68(final String defaultValue) { + return ff(defaultValue).upTo(67); } - static BrowserConfiguration ff52up(final String defaultValue) { - return ff(defaultValue).startingWith(52); + static BrowserConfiguration ff68up(final String defaultValue) { + return ff(defaultValue).startingWith(68); } static BrowserConfiguration getMatchingConfiguration( diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS.java index 43aeb13e565..3923cd2e3da 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -28,14 +28,15 @@ * A JavaScript object for {@code CSS}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class CSS extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor + @JsxConstructor({CHROME, FF60}) public CSS() { } @@ -49,4 +50,15 @@ public Object get(final String name, final Scriptable start) { } return super.get(name, start); } + + /** + * {@inheritDoc} + */ + @Override + public Object getDefaultValue(final Class hint) { + if (String.class.equals(hint) || hint == null) { + return "[object Object]"; + } + return super.getDefaultValue(hint); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS2Properties.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS2Properties.java index 741f9c41d96..27ab2caea25 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS2Properties.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSS2Properties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSConditionRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSConditionRule.java index cea1ead08bb..1e8f15b8900 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSConditionRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSConditionRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,10 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; +import com.gargoylesoftware.css.dom.CSSMediaRuleImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,15 +26,16 @@ * A JavaScript object for {@code CSSConditionRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) @JsxClass(isJSObject = false, value = IE) public class CSSConditionRule extends CSSGroupingRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSConditionRule() { } @@ -43,7 +44,7 @@ public CSSConditionRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSConditionRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSMediaRule rule) { + protected CSSConditionRule(final CSSStyleSheet stylesheet, final CSSMediaRuleImpl rule) { super(stylesheet, rule); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSCounterStyleRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSCounterStyleRule.java index 781d062199f..f1a967b6947 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSCounterStyleRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSCounterStyleRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,13 +17,21 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code CSSCounterStyleRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass(FF) public class CSSCounterStyleRule extends CSSRule { + /** + * Creates a new instance. + */ + @JsxConstructor(FF) + public CSSCounterStyleRule() { + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSFontFaceRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSFontFaceRule.java index b3f484d6b46..b9c6fab0943 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSFontFaceRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSFontFaceRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,17 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.css; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_FONTFACERULE_CSSTEXT_CRLF; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_FONTFACERULE_CSSTEXT_NO_CRLF; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_FONTFACERULE_CSSTEXT_CHROME_STYLE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_FONTFACERULE_CSSTEXT_FF60_STYLE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_FONTFACERULE_CSSTEXT_IE_STYLE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; +import com.gargoylesoftware.css.dom.CSSFontFaceRuleImpl; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -44,7 +46,7 @@ public class CSSFontFaceRule extends CSSRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSFontFaceRule() { } @@ -53,7 +55,7 @@ public CSSFontFaceRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSFontFaceRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSFontFaceRule rule) { + protected CSSFontFaceRule(final CSSStyleSheet stylesheet, final CSSFontFaceRuleImpl rule) { super(stylesheet, rule); } @@ -72,25 +74,32 @@ public short getType() { public String getCssText() { String cssText = super.getCssText(); final BrowserVersion browserVersion = getBrowserVersion(); - if (browserVersion.hasFeature(CSS_FONTFACERULE_CSSTEXT_CRLF)) { - cssText = StringUtils.replace(cssText, "{", "{\r\n\t"); - cssText = StringUtils.replace(cssText, "}", ";\r\n}\r\n"); - cssText = StringUtils.replace(cssText, "; ", ";\r\n\t"); + if (browserVersion.hasFeature(CSS_FONTFACERULE_CSSTEXT_IE_STYLE)) { + cssText = StringUtils.replace(cssText, "{", "{\n\t"); + cssText = StringUtils.replace(cssText, "}", ";\n}\n"); + cssText = StringUtils.replace(cssText, "; ", ";\n\t"); } - else if (browserVersion.hasFeature(CSS_FONTFACERULE_CSSTEXT_NO_CRLF)) { + else if (browserVersion.hasFeature(CSS_FONTFACERULE_CSSTEXT_CHROME_STYLE)) { cssText = StringUtils.replace(cssText, "{", "{ "); cssText = StringUtils.replace(cssText, "}", "; }"); cssText = StringUtils.replace(cssText, "; ", "; "); cssText = REPLACEMENT_1.matcher(cssText).replaceFirst("font-family: $1;"); cssText = REPLACEMENT_2.matcher(cssText).replaceFirst("src: url(\"$1\");"); } - else { + else if (browserVersion.hasFeature(CSS_FONTFACERULE_CSSTEXT_FF60_STYLE)) { cssText = StringUtils.replace(cssText, "{", "{\n "); cssText = StringUtils.replace(cssText, "}", ";\n}"); cssText = StringUtils.replace(cssText, "; ", ";\n "); cssText = REPLACEMENT_1.matcher(cssText).replaceFirst("font-family: \"$1\";"); cssText = REPLACEMENT_2.matcher(cssText).replaceFirst("src: url(\"$1\");"); } + else { + cssText = StringUtils.replace(cssText, "{", "{\n "); + cssText = StringUtils.replace(cssText, "}", ";\n}"); + cssText = StringUtils.replace(cssText, "; ", ";\n "); + cssText = REPLACEMENT_1.matcher(cssText).replaceFirst("font-family: $1;"); + cssText = REPLACEMENT_2.matcher(cssText).replaceFirst("src: url(\"$1\");"); + } return cssText; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSGroupingRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSGroupingRule.java index e52aa18d0d1..61989b034ac 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSGroupingRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSGroupingRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,10 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; +import com.gargoylesoftware.css.dom.CSSMediaRuleImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,15 +26,16 @@ * A JavaScript object for {@code CSSGroupingRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) @JsxClass(isJSObject = false, value = IE) public class CSSGroupingRule extends CSSRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSGroupingRule() { } @@ -43,7 +44,7 @@ public CSSGroupingRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSGroupingRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSMediaRule rule) { + protected CSSGroupingRule(final CSSStyleSheet stylesheet, final CSSMediaRuleImpl rule) { super(stylesheet, rule); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSImportRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSImportRule.java index f47bd2e920d..8e8d4fa5c7d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSImportRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSImportRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,11 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import com.gargoylesoftware.css.dom.CSSImportRuleImpl; +import com.gargoylesoftware.css.dom.CSSStyleSheetImpl; +import com.gargoylesoftware.css.dom.MediaListImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; @@ -28,6 +31,7 @@ * * @author Daniel Gredler * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass public class CSSImportRule extends CSSRule { @@ -38,7 +42,7 @@ public class CSSImportRule extends CSSRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSImportRule() { } @@ -47,7 +51,7 @@ public CSSImportRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSImportRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSImportRule rule) { + protected CSSImportRule(final CSSStyleSheet stylesheet, final CSSImportRuleImpl rule) { super(stylesheet, rule); } @@ -68,7 +72,7 @@ public String getHref() { public MediaList getMedia() { if (media_ == null) { final CSSStyleSheet parent = getParentStyleSheet(); - final org.w3c.dom.stylesheets.MediaList ml = getImportRule().getMedia(); + final MediaListImpl ml = getImportRule().getMedia(); media_ = new MediaList(parent, ml); } return media_; @@ -83,7 +87,7 @@ public CSSStyleSheet getStyleSheet() { if (importedStylesheet_ == null) { final CSSStyleSheet owningSheet = getParentStyleSheet(); final HTMLElement ownerNode = owningSheet.getOwnerNode(); - final org.w3c.dom.css.CSSStyleSheet importedStylesheet = getImportRule().getStyleSheet(); + final CSSStyleSheetImpl importedStylesheet = getImportRule().getStyleSheet(); importedStylesheet_ = new CSSStyleSheet(ownerNode, importedStylesheet, owningSheet.getUri()); } return importedStylesheet_; @@ -93,8 +97,8 @@ public CSSStyleSheet getStyleSheet() { * Returns the wrapped rule, as an import rule. * @return the wrapped rule, as an import rule */ - private org.w3c.dom.css.CSSImportRule getImportRule() { - return (org.w3c.dom.css.CSSImportRule) getRule(); + private CSSImportRuleImpl getImportRule() { + return (CSSImportRuleImpl) getRule(); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframeRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframeRule.java index a745f54c3da..08fe71e2004 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframeRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframeRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -26,14 +24,15 @@ * A JavaScript object for {@code CSSKeyframeRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52, IE, EDGE}) +@JsxClass public class CSSKeyframeRule extends CSSRule { /** * Default constructor. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSKeyframeRule() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java index 1193047178b..b77914e3078 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSKeyframesRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.css; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CSS_MOZ_CSS_KEYFRAMES_RULE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; +import com.gargoylesoftware.css.dom.CSSUnknownRuleImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; @@ -30,13 +29,13 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass({CHROME, FF52, IE, EDGE}) +@JsxClass({CHROME, FF, IE}) public class CSSKeyframesRule extends CSSRule { /** * Default constructor. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSKeyframesRule() { } @@ -45,7 +44,7 @@ public CSSKeyframesRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSKeyframesRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSUnknownRule rule) { + protected CSSKeyframesRule(final CSSStyleSheet stylesheet, final CSSUnknownRuleImpl rule) { super(stylesheet, rule); } @@ -58,16 +57,4 @@ protected CSSKeyframesRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css public short getType() { return KEYFRAMES_RULE; } - - /** - * {@inheritDoc} - */ - @Override - public Object getDefaultValue(final Class hint) { - if ((String.class.equals(hint) || hint == null) - && getBrowserVersion().hasFeature(JS_CSS_MOZ_CSS_KEYFRAMES_RULE)) { - return "[object MozCSSKeyframesRule]"; - } - return super.getDefaultValue(hint); - } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSMediaRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSMediaRule.java index e1d3759a59d..428ecf418b6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSMediaRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSMediaRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +15,17 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import com.gargoylesoftware.css.dom.CSSMediaRuleImpl; +import com.gargoylesoftware.css.dom.MediaListImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList; /** - * A JavaScript object for a {@link org.w3c.dom.css.CSSMediaRule}. + * A JavaScript object for a {@link CSSMediaRuleImpl}. * * @author Ronald Brill * @author Ahmed Ashour @@ -36,7 +38,7 @@ public class CSSMediaRule extends CSSConditionRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSMediaRule() { } @@ -45,7 +47,7 @@ public CSSMediaRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSMediaRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSMediaRule rule) { + protected CSSMediaRule(final CSSStyleSheet stylesheet, final CSSMediaRuleImpl rule) { super(stylesheet, rule); } @@ -57,7 +59,7 @@ protected CSSMediaRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSS public MediaList getMedia() { if (media_ == null) { final CSSStyleSheet parent = getParentStyleSheet(); - final org.w3c.dom.stylesheets.MediaList ml = getMediaRule().getMedia(); + final MediaListImpl ml = getMediaRule().getMediaList(); media_ = new MediaList(parent, ml); } return media_; @@ -67,7 +69,7 @@ public MediaList getMedia() { * Returns the wrapped rule, as a media rule. * @return the wrapped rule, as a media rule */ - private org.w3c.dom.css.CSSMediaRule getMediaRule() { - return (org.w3c.dom.css.CSSMediaRule) getRule(); + private CSSMediaRuleImpl getMediaRule() { + return (CSSMediaRuleImpl) getRule(); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSNamespaceRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSNamespaceRule.java index be281a0f27f..c1b24be9215 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSNamespaceRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSNamespaceRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,14 +25,15 @@ * A JavaScript object for {@code CSSNamespaceRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, IE, EDGE}) +@JsxClass({CHROME, FF, IE}) public class CSSNamespaceRule extends CSSRule { /** * Default constructor. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSNamespaceRule() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPageRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPageRule.java index fea816fe122..8b6f926d6a4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPageRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPageRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -24,6 +24,7 @@ * A JavaScript object for {@code CSSPageRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass public class CSSPageRule extends CSSRule { @@ -31,7 +32,7 @@ public class CSSPageRule extends CSSRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSPageRule() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPrimitiveValue.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPrimitiveValue.java index fecee28e165..7bd712a54bb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPrimitiveValue.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSPrimitiveValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.css; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; +import com.gargoylesoftware.css.dom.CSSValueImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,10 +26,10 @@ /** * A JavaScript object for {@code CSSPrimitiveValue}. * - * @see org.w3c.dom.css.CSSPrimitiveValue * @author Marc Guillemot + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class CSSPrimitiveValue extends CSSValue { /** @@ -213,7 +214,7 @@ public class CSSPrimitiveValue extends CSSValue { @JsxConstant public static final short CSS_RGBCOLOR = org.w3c.dom.css.CSSPrimitiveValue.CSS_RGBCOLOR; - private org.w3c.dom.css.CSSPrimitiveValue wrappedCssPrimitiveValue_; + private CSSValueImpl wrappedCssValueImpl_; /** * Creates an instance. @@ -226,12 +227,12 @@ public CSSPrimitiveValue() { * Creates an instance and sets its parent scope to the one of the provided element. * @param element the element to which this style is bound */ - CSSPrimitiveValue(final Element element, final org.w3c.dom.css.CSSPrimitiveValue cssValue) { + CSSPrimitiveValue(final Element element, final CSSValueImpl cssValue) { super(element, cssValue); setParentScope(element.getParentScope()); setPrototype(getPrototype(getClass())); setDomNode(element.getDomNodeOrNull(), false); - wrappedCssPrimitiveValue_ = cssValue; + wrappedCssValueImpl_ = cssValue; } /** @@ -241,6 +242,6 @@ public CSSPrimitiveValue() { */ @JsxFunction public double getFloatValue(final int unitType) { - return wrappedCssPrimitiveValue_.getFloatValue((short) unitType); + return wrappedCssValueImpl_.getDoubleValue(); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRule.java index 15f342b2ba3..1a62de7e95f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,20 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.gargoylesoftware.css.dom.AbstractCSSRuleImpl; +import com.gargoylesoftware.css.dom.CSSCharsetRuleImpl; +import com.gargoylesoftware.css.dom.CSSFontFaceRuleImpl; +import com.gargoylesoftware.css.dom.CSSImportRuleImpl; +import com.gargoylesoftware.css.dom.CSSMediaRuleImpl; +import com.gargoylesoftware.css.dom.CSSPageRuleImpl; +import com.gargoylesoftware.css.dom.CSSStyleRuleImpl; +import com.gargoylesoftware.css.dom.CSSUnknownRuleImpl; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; @@ -44,7 +51,7 @@ public class CSSRule extends SimpleScriptable { /** * The rule is a {@code CSSUnknownRule}. */ - @JsxConstant({FF, IE, EDGE}) + @JsxConstant(IE) public static final short UNKNOWN_RULE = org.w3c.dom.css.CSSRule.UNKNOWN_RULE; /** @@ -89,24 +96,12 @@ public class CSSRule extends SimpleScriptable { @JsxConstant public static final short KEYFRAMES_RULE = 7; - /** - * The rule is a {@code CSSKeyframesRule}. - */ - @JsxConstant(FF) - public static final short MOZ_KEYFRAMES_RULE = 7; - /** * The rule is a {@code CSSKeyframeRule}. */ @JsxConstant public static final short KEYFRAME_RULE = 8; - /** - * The rule is a {@code CSSKeyframeRule}. - */ - @JsxConstant(FF) - public static final short MOZ_KEYFRAME_RULE = 8; - /** * The rule is a {@code CSSNamespaceRule}. */ @@ -139,12 +134,12 @@ public class CSSRule extends SimpleScriptable { private final CSSStyleSheet stylesheet_; - private final org.w3c.dom.css.CSSRule rule_; + private final AbstractCSSRuleImpl rule_; /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSRule() { stylesheet_ = null; rule_ = null; @@ -156,29 +151,36 @@ public CSSRule() { * @param rule the wrapped rule * @return a CSSRule subclass according to the rule type */ - public static CSSRule create(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSRule rule) { - switch (rule.getType()) { - case STYLE_RULE: - return new CSSStyleRule(stylesheet, (org.w3c.dom.css.CSSStyleRule) rule); - case IMPORT_RULE: - return new CSSImportRule(stylesheet, (org.w3c.dom.css.CSSImportRule) rule); -// case CHARSET_RULE: -// return new CSSCharsetRule(stylesheet, (org.w3c.dom.css.CSSCharsetRule) rule); - case MEDIA_RULE: - return new CSSMediaRule(stylesheet, (org.w3c.dom.css.CSSMediaRule) rule); - case FONT_FACE_RULE: - return new CSSFontFaceRule(stylesheet, (org.w3c.dom.css.CSSFontFaceRule) rule); - case UNKNOWN_RULE: - final org.w3c.dom.css.CSSUnknownRule unknownRule = (org.w3c.dom.css.CSSUnknownRule) rule; - if (unknownRule.getCssText().startsWith("@keyframes")) { - return new CSSKeyframesRule(stylesheet, (org.w3c.dom.css.CSSUnknownRule) rule); - } + public static CSSRule create(final CSSStyleSheet stylesheet, final AbstractCSSRuleImpl rule) { + if (rule instanceof CSSStyleRuleImpl) { + return new CSSStyleRule(stylesheet, (CSSStyleRuleImpl) rule); + } + if (rule instanceof CSSImportRuleImpl) { + return new CSSImportRule(stylesheet, (CSSImportRuleImpl) rule); + } +// if (rule instanceof CSSCharsetRuleImpl) { +// return new CSSCharsetRule(stylesheet, (CSSCharsetRuleImpl) rule); +// } + if (rule instanceof CSSMediaRuleImpl) { + return new CSSMediaRule(stylesheet, (CSSMediaRuleImpl) rule); + } + if (rule instanceof CSSFontFaceRuleImpl) { + return new CSSFontFaceRule(stylesheet, (CSSFontFaceRuleImpl) rule); + } + if (rule instanceof CSSUnknownRuleImpl) { + final CSSUnknownRuleImpl unknownRule = (CSSUnknownRuleImpl) rule; + if (unknownRule.getCssText().startsWith("@keyframes")) { + return new CSSKeyframesRule(stylesheet, (CSSUnknownRuleImpl) rule); + } + if (LOG.isWarnEnabled()) { LOG.warn("Unknown CSSRule " + rule.getClass().getName() + " is not yet supported; rule content: '" + rule.getCssText() + "'"); - break; - default: - LOG.warn("CSSRule " + rule.getClass().getName() - + " is not yet supported; rule content: '" + rule.getCssText() + "'"); + } + } + + if (LOG.isWarnEnabled()) { + LOG.warn("CSSRule " + rule.getClass().getName() + + " is not yet supported; rule content: '" + rule.getCssText() + "'"); } return null; @@ -189,7 +191,7 @@ public static CSSRule create(final CSSStyleSheet stylesheet, final org.w3c.dom.c * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSRule rule) { + protected CSSRule(final CSSStyleSheet stylesheet, final AbstractCSSRuleImpl rule) { stylesheet_ = stylesheet; rule_ = rule; setParentScope(stylesheet); @@ -202,7 +204,29 @@ protected CSSRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSRule */ @JsxGetter public short getType() { - return rule_.getType(); + if (rule_ instanceof CSSCharsetRuleImpl) { + return CSSRule.CHARSET_RULE; + } + if (rule_ instanceof CSSFontFaceRuleImpl) { + return CSSRule.FONT_FACE_RULE; + } + if (rule_ instanceof CSSImportRuleImpl) { + return CSSRule.IMPORT_RULE; + } + if (rule_ instanceof CSSMediaRuleImpl) { + return CSSRule.MEDIA_RULE; + } + if (rule_ instanceof CSSPageRuleImpl) { + return CSSRule.PAGE_RULE; + } + if (rule_ instanceof CSSStyleRuleImpl) { + return CSSRule.STYLE_RULE; + } + if (rule_ instanceof CSSUnknownRuleImpl) { + return CSSRule.UNKNOWN_RULE; + } + + return CSSRule.UNKNOWN_RULE; } /** @@ -240,7 +264,7 @@ public CSSStyleSheet getParentStyleSheet() { */ @JsxGetter public CSSRule getParentRule() { - final org.w3c.dom.css.CSSRule parentRule = rule_.getParentRule(); + final AbstractCSSRuleImpl parentRule = rule_.getParentRule(); if (parentRule != null) { return CSSRule.create(stylesheet_, parentRule); } @@ -251,7 +275,7 @@ public CSSRule getParentRule() { * Returns the wrapped rule. * @return the wrapped rule. */ - protected org.w3c.dom.css.CSSRule getRule() { + protected AbstractCSSRuleImpl getRule() { return rule_; } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRuleList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRuleList.java index 3ed72850976..a5d0d78ad9f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRuleList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSRuleList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CSSRULELIST_ENUM_ITEM_LENGTH; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.ArrayList; @@ -44,7 +43,7 @@ public class CSSRuleList extends SimpleScriptable { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSRuleList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java index 8b258280fb8..891808c2e55 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_BACKGROUND_INITIAL; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_BACKGROUND_RGBA; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_LENGTH_INITIAL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_OUTLINE_WIDTH_UNIT_NOT_REQUIRED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_SET_NULL_THROWS; @@ -26,8 +27,8 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_WORD_SPACING_ACCEPTS_PERCENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLE_WRONG_INDEX_RETURNS_UNDEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import static com.gargoylesoftware.htmlunit.javascript.host.css.StyleAttributes.Definition.ACCELERATOR; import static com.gargoylesoftware.htmlunit.javascript.host.css.StyleAttributes.Definition.BACKGROUND; @@ -100,7 +101,6 @@ import java.awt.Color; import java.io.IOException; -import java.io.StringReader; import java.text.MessageFormat; import java.text.ParseException; import java.util.ArrayList; @@ -121,18 +121,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.gargoylesoftware.css.dom.CSSStyleDeclarationImpl; import com.gargoylesoftware.css.dom.CSSValueImpl; import com.gargoylesoftware.css.parser.CSSErrorHandler; import com.gargoylesoftware.css.parser.CSSOMParser; -import com.gargoylesoftware.css.parser.InputSource; import com.gargoylesoftware.css.parser.javacc.CSS3Parser; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebAssert; import com.gargoylesoftware.htmlunit.css.StyleElement; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnly; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnlyStatus; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; @@ -208,14 +206,17 @@ public class CSSStyleDeclaration extends SimpleScriptable { MAX_WIDTH.getAttributeName() )); + static final String NONE = "none"; static final String AUTO = "auto"; static final String STATIC = "static"; static final String INHERIT = "inherit"; private static final String INITIAL = "initial"; - private static final String RELATIVE = "relative"; - private static final String FIXED = "fixed"; - private static final String ABSOLUTE = "absolute"; + static final String RELATIVE = "relative"; + static final String FIXED = "fixed"; + static final String ABSOLUTE = "absolute"; private static final String REPEAT = "repeat"; + static final String BLOCK = "block"; + static final String INLINE = "inline"; private static final Log LOG = LogFactory.getLog(CSSStyleDeclaration.class); private static final Map CSSColors_ = new HashMap<>(); @@ -230,7 +231,7 @@ public class CSSStyleDeclaration extends SimpleScriptable { private Element jsElement_; /** The wrapped CSSStyleDeclaration (if created from CSSStyleRule). */ - private org.w3c.dom.css.CSSStyleDeclaration styleDeclaration_; + private CSSStyleDeclarationImpl styleDeclaration_; static { CSSColors_.put("aqua", "rgb(0, 255, 255)"); @@ -254,7 +255,7 @@ public class CSSStyleDeclaration extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSStyleDeclaration() { } @@ -273,7 +274,7 @@ public CSSStyleDeclaration(final Element element) { * @param parentScope the parent scope to use * @param styleDeclaration the style declaration to wrap */ - CSSStyleDeclaration(final Scriptable parentScope, final org.w3c.dom.css.CSSStyleDeclaration styleDeclaration) { + CSSStyleDeclaration(final Scriptable parentScope, final CSSStyleDeclarationImpl styleDeclaration) { setParentScope(parentScope); setPrototype(getPrototype(getClass())); styleDeclaration_ = styleDeclaration; @@ -302,7 +303,9 @@ private void initialize(final Element element) { } } catch (final ParseException e) { - LOG.warn("Invalid behavior: '" + behavior + "'."); + if (LOG.isWarnEnabled()) { + LOG.warn("Invalid behavior: '" + behavior + "'."); + } } } } @@ -398,19 +401,7 @@ private StyleElement getStyleElementCaseInSensitive(final String name) { */ private String getStyleAttribute(final Definition name1, final Definition name2) { final String value; - if (styleDeclaration_ != null) { - final String value1 = styleDeclaration_.getPropertyValue(name1.getAttributeName()); - final String value2 = styleDeclaration_.getPropertyValue(name2.getAttributeName()); - - if ("".equals(value1) && "".equals(value2)) { - return ""; - } - if (!"".equals(value1) && "".equals(value2)) { - return value1; - } - value = value2; - } - else { + if (styleDeclaration_ == null) { final StyleElement element1 = getStyleElement(name1.getAttributeName()); final StyleElement element2 = getStyleElement(name2.getAttributeName()); @@ -430,6 +421,18 @@ private String getStyleAttribute(final Definition name1, final Definition name2) value = element2.getValue(); } } + else { + final String value1 = styleDeclaration_.getPropertyValue(name1.getAttributeName()); + final String value2 = styleDeclaration_.getPropertyValue(name2.getAttributeName()); + + if ("".equals(value1) && "".equals(value2)) { + return ""; + } + if (!"".equals(value1) && "".equals(value2)) { + return value1; + } + value = value2; + } final String[] values = StringUtils.split(value); if (name1.name().contains("TOP")) { @@ -631,6 +634,9 @@ public String getBackgroundColor() { } return "rgba(0, 0, 0, 0)"; } + if (getBrowserVersion().hasFeature(CSS_BACKGROUND_RGBA)) { + return "rgba(0, 0, 0, 0)"; + } return "transparent"; // default if shorthand is used } return value; @@ -664,7 +670,7 @@ public String getBackgroundImage() { final boolean isComputed = getClass() != CSSStyleDeclaration.class; final boolean backgroundInitial = getBrowserVersion().hasFeature(CSS_BACKGROUND_INITIAL); if (value == null) { - return backgroundInitial && !isComputed ? INITIAL : "none"; + return backgroundInitial && !isComputed ? INITIAL : NONE; } if (isComputed) { try { @@ -1339,11 +1345,11 @@ private void updateFont(final String font, final boolean force) { if (browserVersion.hasFeature(CSS_ZINDEX_TYPE_INTEGER) || !lineHeight.equals(defaultLineHeight)) { newFont.append('/'); - if (!lineHeight.equals(defaultLineHeight)) { - newFont.append(lineHeight); + if (lineHeight.equals(defaultLineHeight)) { + newFont.append(LINE_HEIGHT.getDefaultComputedValue(browserVersion)); } else { - newFont.append(LINE_HEIGHT.getDefaultComputedValue(browserVersion)); + newFont.append(lineHeight); } } @@ -1420,7 +1426,6 @@ public void setLeft(final Object left) { * @return the {@code length} property */ @JsxGetter - @CanSetReadOnly(CanSetReadOnlyStatus.IGNORE) public int getLength() { return getStyleMap().size(); } @@ -1675,8 +1680,7 @@ private String getStyleAttributeImpl(final String string) { final StyleElement element = getStyleElement(string); if (element != null && element.getValue() != null) { final String value = element.getValue(); - if (!value.contains("url") - && getBrowserVersion().hasFeature(JS_STYLE_SET_PROPERTY_IMPORTANT_IGNORES_CASE)) { + if (!value.contains("url")) { return value.toLowerCase(Locale.ROOT); } return value; @@ -1778,7 +1782,7 @@ public String getOpacity() { */ @JsxSetter public void setOpacity(final Object opacity) { - if (ScriptRuntime.NaNobj == opacity) { + if (ScriptRuntime.isNaN(opacity)) { return; } @@ -2524,7 +2528,7 @@ public void setZIndex(final Object zIndex) { return; } // undefined - if (Undefined.instance.equals(zIndex)) { + if (Undefined.isUndefined(zIndex)) { return; } @@ -2566,31 +2570,30 @@ public String getPropertyValue(final String name) { * @param name the name of the property to retrieve * @return the value */ - @JsxFunction(FF) + @JsxFunction(FF60) public CSSValue getPropertyCSSValue(final String name) { - LOG.info("getPropertyCSSValue(" + name + "): getPropertyCSSValue support is experimental"); + if (LOG.isInfoEnabled()) { + LOG.info("getPropertyCSSValue(" + name + "): getPropertyCSSValue support is experimental"); + } + // following is a hack, just to have basic support for getPropertyCSSValue // TODO: rework the whole CSS processing here! we should *always* parse the style! if (styleDeclaration_ == null) { - final String uri = getDomNodeOrDie().getPage().getWebResponse().getWebRequest() - .getUrl().toExternalForm(); final String styleAttribute = jsElement_.getDomNodeOrDie().getAttributeDirect("style"); - final InputSource source = new InputSource(new StringReader(styleAttribute)); - source.setURI(uri); final CSSErrorHandler errorHandler = getWindow().getWebWindow().getWebClient().getCssErrorHandler(); final CSSOMParser parser = new CSSOMParser(new CSS3Parser()); parser.setErrorHandler(errorHandler); try { - styleDeclaration_ = parser.parseStyleDeclaration(source); + styleDeclaration_ = parser.parseStyleDeclaration(styleAttribute); } catch (final IOException e) { throw new RuntimeException(e); } } - org.w3c.dom.css.CSSValue cssValue = styleDeclaration_.getPropertyCSSValue(name); + CSSValueImpl cssValue = styleDeclaration_.getPropertyCSSValue(name); if (cssValue == null) { final CSSValueImpl newValue = new CSSValueImpl(null, false); - newValue.setFloatValue(CSSPrimitiveValue.CSS_PX, 0); + newValue.setDoubleValue(0); cssValue = newValue; } @@ -2601,7 +2604,7 @@ public CSSValue getPropertyCSSValue(final String name) { cssValue.setCssText(formatedCssText); } - return new CSSPrimitiveValue(jsElement_, (org.w3c.dom.css.CSSPrimitiveValue) cssValue); + return new CSSPrimitiveValue(jsElement_, cssValue); } /** @@ -2881,7 +2884,7 @@ public static String toRGBColor(final String color) { * @return whether the token is a border style or not */ private static boolean isBorderStyle(final String token) { - return "none".equalsIgnoreCase(token) || "hidden".equalsIgnoreCase(token) + return NONE.equalsIgnoreCase(token) || "hidden".equalsIgnoreCase(token) || "dotted".equalsIgnoreCase(token) || "dashed".equalsIgnoreCase(token) || "solid".equalsIgnoreCase(token) || "double".equalsIgnoreCase(token) || "groove".equalsIgnoreCase(token) || "ridge".equalsIgnoreCase(token) @@ -2984,11 +2987,11 @@ protected static int pixelValue(final String value) { if (value.length() < 2) { return i; } - if (value.endsWith("px")) { - // nothing to do + return i; } - else if (value.endsWith("em")) { + + if (value.endsWith("em")) { i = i * 16; } else if (value.endsWith("%")) { @@ -3015,6 +3018,14 @@ else if (value.endsWith("pc")) { return i; } + @Override + protected boolean isReadOnlySettable(final String name, final Object value) { + if ("length".equals(name)) { + return false; //ignore + } + return super.isReadOnlySettable(name, value); + } + /** * Encapsulates the retrieval of a style attribute, given a DOM element from which to retrieve it. */ @@ -3091,7 +3102,7 @@ public String toString() { private void setStyleLengthAttribute(final String name, final Object value, final String important, final boolean auto, final boolean percent, final boolean thinMedThick, final boolean unitRequired) { - if (ScriptRuntime.NaNobj == value) { + if (ScriptRuntime.isNaN(value)) { return; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleRule.java index 89a5405b77c..4c334219586 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,14 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECTOR_TEXT_LOWERCASE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.gargoylesoftware.css.dom.CSSStyleRuleImpl; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; @@ -34,6 +35,7 @@ * * @author Ahmed Ashour * @author Marc Guillemot + * @author Ronald Brill */ @JsxClass public class CSSStyleRule extends CSSRule { @@ -43,7 +45,7 @@ public class CSSStyleRule extends CSSRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSStyleRule() { } @@ -52,7 +54,7 @@ public CSSStyleRule() { * @param stylesheet the Stylesheet of this rule. * @param rule the wrapped rule */ - protected CSSStyleRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSSStyleRule rule) { + protected CSSStyleRule(final CSSStyleSheet stylesheet, final CSSStyleRuleImpl rule) { super(stylesheet, rule); } @@ -62,7 +64,7 @@ protected CSSStyleRule(final CSSStyleSheet stylesheet, final org.w3c.dom.css.CSS */ @JsxGetter public String getSelectorText() { - String selectorText = ((org.w3c.dom.css.CSSStyleRule) getRule()).getSelectorText(); + String selectorText = ((CSSStyleRuleImpl) getRule()).getSelectorText(); final Matcher m = SELECTOR_PARTS_PATTERN.matcher(selectorText); final StringBuffer sb = new StringBuffer(); while (m.find()) { @@ -88,7 +90,7 @@ public String getSelectorText() { */ @JsxSetter public void setSelectorText(final String selectorText) { - ((org.w3c.dom.css.CSSStyleRule) getRule()).setSelectorText(selectorText); + ((CSSStyleRuleImpl) getRule()).setSelectorText(selectorText); } /** @@ -97,7 +99,7 @@ public void setSelectorText(final String selectorText) { */ @JsxGetter public CSSStyleDeclaration getStyle() { - return new CSSStyleDeclaration(getParentScope(), ((org.w3c.dom.css.CSSStyleRule) getRule()).getStyle()); + return new CSSStyleDeclaration(getParentScope(), ((CSSStyleRuleImpl) getRule()).getStyle()); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleSheet.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleSheet.java index 27d1fe41e6a..7048650317a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleSheet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSStyleSheet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +16,17 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLLINK_CHECK_TYPE_FOR_STYLESHEET; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.QUERYSELECTORALL_NOT_IN_QUIRKS; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.QUERYSELECTORALL_NO_TARGET; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.QUERYSELECTOR_CSS3_PSEUDO_REQUIRE_ATTACHED_NODE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STYLESHEET_ADD_RULE_RETURNS_POS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.STYLESHEET_HREF_EMPTY_IS_NULL; import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.IOException; +import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.net.MalformedURLException; @@ -48,17 +48,17 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSImportRule; -import org.w3c.dom.css.CSSRule; -import org.w3c.dom.css.CSSRuleList; -import org.w3c.dom.stylesheets.MediaList; +import com.gargoylesoftware.css.dom.AbstractCSSRuleImpl; +import com.gargoylesoftware.css.dom.CSSCharsetRuleImpl; import com.gargoylesoftware.css.dom.CSSImportRuleImpl; import com.gargoylesoftware.css.dom.CSSMediaRuleImpl; import com.gargoylesoftware.css.dom.CSSRuleListImpl; +import com.gargoylesoftware.css.dom.CSSStyleDeclarationImpl; import com.gargoylesoftware.css.dom.CSSStyleRuleImpl; import com.gargoylesoftware.css.dom.CSSStyleSheetImpl; import com.gargoylesoftware.css.dom.CSSValueImpl; +import com.gargoylesoftware.css.dom.CSSValueImpl.CSSPrimitiveValueType; import com.gargoylesoftware.css.dom.MediaListImpl; import com.gargoylesoftware.css.dom.Property; import com.gargoylesoftware.css.parser.CSSErrorHandler; @@ -66,18 +66,9 @@ import com.gargoylesoftware.css.parser.CSSOMParser; import com.gargoylesoftware.css.parser.CSSParseException; import com.gargoylesoftware.css.parser.InputSource; -import com.gargoylesoftware.css.parser.condition.AttributeCondition; -import com.gargoylesoftware.css.parser.condition.BeginHyphenAttributeCondition; -import com.gargoylesoftware.css.parser.condition.ClassCondition; +import com.gargoylesoftware.css.parser.LexicalUnit; import com.gargoylesoftware.css.parser.condition.Condition; import com.gargoylesoftware.css.parser.condition.Condition.ConditionType; -import com.gargoylesoftware.css.parser.condition.IdCondition; -import com.gargoylesoftware.css.parser.condition.LangCondition; -import com.gargoylesoftware.css.parser.condition.OneOfAttributeCondition; -import com.gargoylesoftware.css.parser.condition.PrefixAttributeCondition; -import com.gargoylesoftware.css.parser.condition.PseudoClassCondition; -import com.gargoylesoftware.css.parser.condition.SubstringAttributeCondition; -import com.gargoylesoftware.css.parser.condition.SuffixAttributeCondition; import com.gargoylesoftware.css.parser.javacc.CSS3Parser; import com.gargoylesoftware.css.parser.media.MediaQuery; import com.gargoylesoftware.css.parser.selector.ChildSelector; @@ -119,8 +110,11 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.host.Element; +import com.gargoylesoftware.htmlunit.javascript.host.Window; +import com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.UrlUtils; import net.sourceforge.htmlunit.corejs.javascript.Context; @@ -146,7 +140,7 @@ public class CSSStyleSheet extends StyleSheet { private static final Pattern UNESCAPE_SELECTOR = Pattern.compile("\\\\([\\[\\]\\.:])"); /** The parsed stylesheet which this host object wraps. */ - private final org.w3c.dom.css.CSSStyleSheet wrapped_; + private final CSSStyleSheetImpl wrapped_; /** The HTML element which owns this stylesheet. */ private final HTMLElement ownerNode_; @@ -156,10 +150,10 @@ public class CSSStyleSheet extends StyleSheet { private List cssRulesIndexFix_; /** The CSS import rules and their corresponding stylesheets. */ - private final Map imports_ = new HashMap<>(); + private final Map imports_ = new HashMap<>(); /** cache parsed media strings */ - private static final transient Map media_ = new HashMap<>(); + private static final transient Map media_ = new HashMap<>(); /** This stylesheet's URI (used to resolved contained @import rules). */ private String uri_; @@ -183,7 +177,7 @@ public class CSSStyleSheet extends StyleSheet { /** * Creates a new empty stylesheet. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSStyleSheet() { wrapped_ = new CSSStyleSheetImpl(); ownerNode_ = null; @@ -196,12 +190,39 @@ public CSSStyleSheet() { * @param uri this stylesheet's URI (used to resolved contained @import rules) */ public CSSStyleSheet(final HTMLElement element, final InputSource source, final String uri) { - setParentScope(element.getWindow()); + final Window win = element.getWindow(); + + setParentScope(win); setPrototype(getPrototype(CSSStyleSheet.class)); if (source != null) { source.setURI(uri); } - wrapped_ = parseCSS(source); + wrapped_ = parseCSS(source, win.getWebWindow().getWebClient()); + uri_ = uri; + ownerNode_ = element; + } + + /** + * Creates a new stylesheet representing the CSS stylesheet for the specified input source. + * @param element the owning node + * @param styleSheet the source which contains the CSS stylesheet which this stylesheet host object represents + * @param uri this stylesheet's URI (used to resolved contained @import rules) + */ + public CSSStyleSheet(final HTMLElement element, final String styleSheet, final String uri) { + final Window win = element.getWindow(); + + CSSStyleSheetImpl css = null; + try (InputSource source = new InputSource(new StringReader(styleSheet))) { + source.setURI(uri); + css = parseCSS(source, win.getWebWindow().getWebClient()); + } + catch (final IOException e) { + LOG.error(e.getMessage(), e); + } + + setParentScope(win); + setPrototype(getPrototype(CSSStyleSheet.class)); + wrapped_ = css; uri_ = uri; ownerNode_ = element; } @@ -212,7 +233,7 @@ public CSSStyleSheet(final HTMLElement element, final InputSource source, final * @param wrapped the CSS stylesheet which this stylesheet host object represents * @param uri this stylesheet's URI (used to resolved contained @import rules) */ - public CSSStyleSheet(final HTMLElement element, final org.w3c.dom.css.CSSStyleSheet wrapped, final String uri) { + public CSSStyleSheet(final HTMLElement element, final CSSStyleSheetImpl wrapped, final String uri) { setParentScope(element.getWindow()); setPrototype(getPrototype(CSSStyleSheet.class)); wrapped_ = wrapped; @@ -224,7 +245,7 @@ public CSSStyleSheet(final HTMLElement element, final org.w3c.dom.css.CSSStyleSh * Returns the wrapped stylesheet. * @return the wrapped stylesheet */ - public org.w3c.dom.css.CSSStyleSheet getWrappedSheet() { + public CSSStyleSheetImpl getWrappedSheet() { return wrapped_; } @@ -245,7 +266,7 @@ public void modifyIfNecessary(final ComputedCSSStyleDeclaration style, final Ele final List matchingRules = selects(getRuleIndex(), this, browser, e, pseudoElement, false); for (CSSStyleSheetImpl.SelectorEntry entry : matchingRules) { - final org.w3c.dom.css.CSSStyleDeclaration dec = entry.getRule().getStyle(); + final CSSStyleDeclarationImpl dec = entry.getRule().getStyle(); style.applyStyleFromSelector(dec, entry.getSelector()); } } @@ -266,15 +287,25 @@ public static CSSStyleSheet loadStylesheet(final HTMLElement element, final Html final WebRequest request; final WebResponse response; final WebClient client = page.getWebClient(); - if (link != null) { + if (link == null) { + // Use href. + final BrowserVersion browser = client.getBrowserVersion(); + request = new WebRequest(new URL(url), browser.getCssAcceptHeader(), browser.getAcceptEncodingHeader()); + request.setAdditionalHeader(HttpHeader.REFERER, uri); + + // our cache is a bit strange; + // loadWebResponse check the cache for the web response + // AND also fixes the request url for the following cache lookups + response = client.loadWebResponse(request); + } + else { // Use link. request = link.getWebRequest(); if (element.getBrowserVersion().hasFeature(HTMLLINK_CHECK_TYPE_FOR_STYLESHEET)) { final String type = link.getTypeAttribute(); - if (StringUtils.isNotBlank(type) && !"text/css".equals(type)) { - final InputSource source = new InputSource(new StringReader("")); - return new CSSStyleSheet(element, source, uri); + if (StringUtils.isNotBlank(type) && !MimeType.TEXT_CSS.equals(type)) { + return new CSSStyleSheet(element, "", uri); } } @@ -283,25 +314,14 @@ public static CSSStyleSheet loadStylesheet(final HTMLElement element, final Html // AND also fixes the request url for the following cache lookups response = link.getWebResponse(true, request); } - else { - // Use href. - final String accept = client.getBrowserVersion().getCssAcceptHeader(); - request = new WebRequest(new URL(url), accept); - request.setAdditionalHeader(HttpHeader.REFERER, uri); - - // our cache is a bit strange; - // loadWebResponse check the cache for the web response - // AND also fixes the request url for the following cache lookups - response = client.loadWebResponse(request); - } // now we can look into the cache with the fixed request for // a cached script final Cache cache = client.getCache(); final Object fromCache = cache.getCachedObject(request); - if (fromCache instanceof org.w3c.dom.css.CSSStyleSheet) { + if (fromCache instanceof CSSStyleSheetImpl) { uri = request.getUrl().toExternalForm(); - sheet = new CSSStyleSheet(element, (org.w3c.dom.css.CSSStyleSheet) fromCache, uri); + sheet = new CSSStyleSheet(element, (CSSStyleSheetImpl) fromCache, uri); } else { uri = response.getWebRequest().getUrl().toExternalForm(); @@ -309,15 +329,19 @@ public static CSSStyleSheet loadStylesheet(final HTMLElement element, final Html client.throwFailingHttpStatusCodeExceptionIfNecessary(response); // CSS content must have downloaded OK; go ahead and build the corresponding stylesheet. - final InputSource source; final String contentType = response.getContentType(); - if (StringUtils.isEmpty(contentType) || "text/css".equals(contentType)) { - source = new InputSource(response.getContentAsStream(), response.getContentCharset().name()); + if (StringUtils.isEmpty(contentType) || MimeType.TEXT_CSS.equals(contentType)) { + try (InputSource source = + new InputSource( + new InputStreamReader(response.getContentAsStream(), + response.getContentCharset().name()))) { + source.setURI(uri); + sheet = new CSSStyleSheet(element, source, uri); + } } else { - source = new InputSource(new StringReader("")); + sheet = new CSSStyleSheet(element, "", uri); } - sheet = new CSSStyleSheet(element, source, uri); // cache the style sheet if (!cache.cacheIfPossible(request, response, sheet.getWrappedSheet())) { @@ -327,24 +351,30 @@ public static CSSStyleSheet loadStylesheet(final HTMLElement element, final Html } catch (final FailingHttpStatusCodeException e) { // Got a 404 response or something like that; behave nicely. - LOG.error("Exception loading " + uri, e); - final InputSource source = new InputSource(new StringReader("")); - sheet = new CSSStyleSheet(element, source, uri); + if (LOG.isErrorEnabled()) { + LOG.error("Exception loading " + uri, e); + } + sheet = new CSSStyleSheet(element, "", uri); } catch (final IOException e) { // Got a basic IO error; behave nicely. - LOG.error("IOException loading " + uri, e); - final InputSource source = new InputSource(new StringReader("")); - sheet = new CSSStyleSheet(element, source, uri); + if (LOG.isErrorEnabled()) { + LOG.error("IOException loading " + uri, e); + } + sheet = new CSSStyleSheet(element, "", uri); } catch (final RuntimeException e) { // Got something unexpected; we can throw an exception in this case. - LOG.error("RuntimeException loading " + uri, e); + if (LOG.isErrorEnabled()) { + LOG.error("RuntimeException loading " + uri, e); + } throw Context.reportRuntimeError("Exception: " + e); } catch (final Exception e) { // Got something unexpected; we can throw an exception in this case. - LOG.error("Exception loading " + uri, e); + if (LOG.isErrorEnabled()) { + LOG.error("Exception loading " + uri, e); + } throw Context.reportRuntimeError("Exception: " + e); } return sheet; @@ -438,14 +468,16 @@ && selects(browserVersion, gas.getSelector(), (HtmlElement) prev1, } return false; case PSEUDO_ELEMENT_SELECTOR: - if (pseudoElement != null && !pseudoElement.isEmpty() && pseudoElement.charAt(0) == ':') { + if (pseudoElement != null && pseudoElement.length() != 0 && pseudoElement.charAt(0) == ':') { final String pseudoName = ((PseudoElementSelector) selector).getLocalName(); return pseudoName.equals(pseudoElement.substring(1)); } return false; default: - LOG.error("Unknown CSS selector type '" + selector.getSelectorType() + "'."); + if (LOG.isErrorEnabled()) { + LOG.error("Unknown CSS selector type '" + selector.getSelectorType() + "'."); + } return false; } } @@ -464,12 +496,10 @@ static boolean selects(final BrowserVersion browserVersion, final Condition cond switch (condition.getConditionType()) { case ID_CONDITION: - final IdCondition ac4 = (IdCondition) condition; - return ac4.getValue().equals(element.getId()); + return condition.getValue().equals(element.getId()); case CLASS_CONDITION: - final ClassCondition ac3 = (ClassCondition) condition; - String v3 = ac3.getValue(); + String v3 = condition.getValue(); if (v3.indexOf('\\') > -1) { v3 = UNESCAPE_SELECTOR.matcher(v3).replaceAll("$1"); } @@ -477,46 +507,43 @@ static boolean selects(final BrowserVersion browserVersion, final Condition cond return selectsWhitespaceSeparated(v3, a3); case ATTRIBUTE_CONDITION: - final AttributeCondition ac1 = (AttributeCondition) condition; - String value = ac1.getValue(); + String value = condition.getValue(); if (value != null) { if (value.indexOf('\\') > -1) { value = UNESCAPE_SELECTOR.matcher(value).replaceAll("$1"); } - final String attrValue = element.getAttribute(ac1.getLocalName()); + final String attrValue = element.getAttribute(condition.getLocalName()); return ATTRIBUTE_NOT_DEFINED != attrValue && attrValue.equals(value); } - return element.hasAttribute(ac1.getLocalName()); + return element.hasAttribute(condition.getLocalName()); case PREFIX_ATTRIBUTE_CONDITION: - final PrefixAttributeCondition pac = (PrefixAttributeCondition) condition; - final String prefixValue = pac.getValue(); - return !"".equals(prefixValue) && element.getAttribute(pac.getLocalName()).startsWith(prefixValue); + final String prefixValue = condition.getValue(); + return !"".equals(prefixValue) + && element.getAttribute(condition.getLocalName()).startsWith(prefixValue); case SUFFIX_ATTRIBUTE_CONDITION: - final SuffixAttributeCondition sac = (SuffixAttributeCondition) condition; - final String suffixValue = sac.getValue(); - return !"".equals(suffixValue) && element.getAttribute(sac.getLocalName()).endsWith(suffixValue); + final String suffixValue = condition.getValue(); + return !"".equals(suffixValue) + && element.getAttribute(condition.getLocalName()).endsWith(suffixValue); case SUBSTRING_ATTRIBUTE_CONDITION: - final SubstringAttributeCondition suac = (SubstringAttributeCondition) condition; - final String substringValue = suac.getValue(); - return !"".equals(substringValue) && element.getAttribute(suac.getLocalName()).contains(substringValue); + final String substringValue = condition.getValue(); + return !"".equals(substringValue) + && element.getAttribute(condition.getLocalName()).contains(substringValue); case BEGIN_HYPHEN_ATTRIBUTE_CONDITION: - final BeginHyphenAttributeCondition bhac = (BeginHyphenAttributeCondition) condition; - final String v = bhac.getValue(); - final String a = element.getAttribute(bhac.getLocalName()); + final String v = condition.getValue(); + final String a = element.getAttribute(condition.getLocalName()); return selects(v, a, '-'); case ONE_OF_ATTRIBUTE_CONDITION: - final OneOfAttributeCondition ooac = (OneOfAttributeCondition) condition; - final String v2 = ooac.getValue(); - final String a2 = element.getAttribute(ooac.getLocalName()); + final String v2 = condition.getValue(); + final String a2 = element.getAttribute(condition.getLocalName()); return selects(v2, a2, ' '); case LANG_CONDITION: - final String lcLang = ((LangCondition) condition).getLang(); + final String lcLang = condition.getValue(); final int lcLangLength = lcLang.length(); for (DomNode node = element; node instanceof HtmlElement; node = node.getParentNode()) { final String nodeLang = ((HtmlElement) node).getAttributeDirect("lang"); @@ -529,11 +556,12 @@ static boolean selects(final BrowserVersion browserVersion, final Condition cond return false; case PSEUDO_CLASS_CONDITION: - return selectsPseudoClass(browserVersion, - (PseudoClassCondition) condition, element, fromQuerySelectorAll); + return selectsPseudoClass(browserVersion, condition, element, fromQuerySelectorAll); default: - LOG.error("Unknown CSS condition type '" + condition.getConditionType() + "'."); + if (LOG.isErrorEnabled()) { + LOG.error("Unknown CSS condition type '" + condition.getConditionType() + "'."); + } return false; } } @@ -600,7 +628,7 @@ private static boolean selectsWhitespaceSeparated(final String condition, final } private static boolean selectsPseudoClass(final BrowserVersion browserVersion, - final PseudoClassCondition condition, final DomElement element, final boolean fromQuerySelectorAll) { + final Condition condition, final DomElement element, final boolean fromQuerySelectorAll) { if (browserVersion.hasFeature(QUERYSELECTORALL_NOT_IN_QUIRKS)) { final Object sobj = element.getPage().getScriptableObject(); if (sobj instanceof HTMLDocument && ((HTMLDocument) sobj).getDocumentMode() < 8) { @@ -709,9 +737,6 @@ private static boolean selectsPseudoClass(final BrowserVersion browserVersion, return isEmpty(element); case "target": - if (fromQuerySelectorAll && browserVersion.hasFeature(QUERYSELECTORALL_NO_TARGET)) { - return false; - } final String ref = element.getPage().getUrl().getRef(); return StringUtils.isNotBlank(ref) && ref.equals(element.getId()); @@ -783,8 +808,7 @@ public void error(final CSSParseException exception) throws CSSException { final CSSOMParser parser = new CSSOMParser(new CSS3Parser()); parser.setErrorHandler(errorHandler); try { - final SelectorList selectorList - = parser.parseSelectors(new InputSource(new StringReader(selectors))); + final SelectorList selectorList = parser.parseSelectors(selectors); if (errorOccured.get() || selectorList == null || selectorList.size() != 1) { throw new CSSException("Invalid selectors: " + selectors); } @@ -830,7 +854,7 @@ private static boolean getNth(final String nth, final int index) { a = -1; } else { - if (value.startsWith("+")) { + if (value.length() > 0 && value.charAt(0) == '+') { value = value.substring(1); } a = NumberUtils.toInt(value, 1); @@ -838,7 +862,7 @@ private static boolean getNth(final String nth, final int index) { } String value = nth.substring(nIndex + 1).trim(); - if (value.startsWith("+")) { + if (value.length() > 0 && value.charAt(0) == '+') { value = value.substring(1); } final int b = NumberUtils.toInt(value, 0); @@ -855,18 +879,21 @@ private static boolean getNth(final String nth, final int index) { * returns an empty stylesheet. * * @param source the source from which to retrieve the CSS to be parsed + * @param client the client * @return the stylesheet parsed from the specified input source */ - private org.w3c.dom.css.CSSStyleSheet parseCSS(final InputSource source) { - org.w3c.dom.css.CSSStyleSheet ss; + private static CSSStyleSheetImpl parseCSS(final InputSource source, final WebClient client) { + CSSStyleSheetImpl ss; try { - final CSSErrorHandler errorHandler = getWindow().getWebWindow().getWebClient().getCssErrorHandler(); + final CSSErrorHandler errorHandler = client.getCssErrorHandler(); final CSSOMParser parser = new CSSOMParser(new CSS3Parser()); parser.setErrorHandler(errorHandler); ss = parser.parseStyleSheet(source, null); } catch (final Throwable t) { - LOG.error("Error parsing CSS from '" + toString(source) + "': " + t.getMessage(), t); + if (LOG.isErrorEnabled()) { + LOG.error("Error parsing CSS from '" + toString(source) + "': " + t.getMessage(), t); + } ss = new CSSStyleSheetImpl(); } return ss; @@ -879,7 +906,7 @@ private org.w3c.dom.css.CSSStyleSheet parseCSS(final InputSource source) { * @param source the source from which to retrieve the selectors to be parsed * @return the selectors parsed from the specified input source */ - public SelectorList parseSelectors(final InputSource source) { + public SelectorList parseSelectors(final String source) { SelectorList selectors; try { final CSSErrorHandler errorHandler = getWindow().getWebWindow().getWebClient().getCssErrorHandler(); @@ -892,7 +919,9 @@ public SelectorList parseSelectors(final InputSource source) { } } catch (final Throwable t) { - LOG.error("Error parsing CSS selectors from '" + toString(source) + "': " + t.getMessage(), t); + if (LOG.isErrorEnabled()) { + LOG.error("Error parsing CSS selectors from '" + source + "': " + t.getMessage(), t); + } selectors = new SelectorListImpl(); } return selectors; @@ -905,8 +934,8 @@ public SelectorList parseSelectors(final InputSource source) { * @param source the source from which to retrieve the media to be parsed * @return the media parsed from the specified input source */ - static MediaList parseMedia(final CSSErrorHandler errorHandler, final String mediaString) { - MediaList media = media_.get(mediaString); + static MediaListImpl parseMedia(final CSSErrorHandler errorHandler, final String mediaString) { + MediaListImpl media = media_.get(mediaString); if (media != null) { return media; } @@ -915,15 +944,14 @@ static MediaList parseMedia(final CSSErrorHandler errorHandler, final String med final CSSOMParser parser = new CSSOMParser(new CSS3Parser()); parser.setErrorHandler(errorHandler); - final InputSource source = new InputSource(new StringReader(mediaString)); - media = new MediaListImpl(parser.parseMedia(source)); - if (media != null) { - media_.put(mediaString, media); - return media; - } + media = new MediaListImpl(parser.parseMedia(mediaString)); + media_.put(mediaString, media); + return media; } catch (final Exception e) { - LOG.error("Error parsing CSS media from '" + mediaString + "': " + e.getMessage(), e); + if (LOG.isErrorEnabled()) { + LOG.error("Error parsing CSS media from '" + mediaString + "': " + e.getMessage(), e); + } } media = new MediaListImpl(null); @@ -950,6 +978,7 @@ private static String toString(final InputSource source) { return ""; } catch (final IOException e) { + LOG.error(e.getMessage(), e); return ""; } } @@ -1035,9 +1064,9 @@ public String getHref() { public int insertRule(final String rule, final int position) { try { initCssRules(); - final int result = wrapped_.insertRule(rule, fixIndex(position)); + wrapped_.insertRule(rule, fixIndex(position)); refreshCssRules(); - return result; + return position; } catch (final DOMException e) { // in case of error try with an empty rule @@ -1045,9 +1074,9 @@ public int insertRule(final String rule, final int position) { if (pos > -1) { final String newRule = rule.substring(0, pos) + "{}"; try { - final int result = wrapped_.insertRule(newRule, fixIndex(position)); + wrapped_.insertRule(newRule, fixIndex(position)); refreshCssRules(); - return result; + return position; } catch (final DOMException ex) { throw Context.throwAsScriptRuntimeEx(ex); @@ -1065,11 +1094,11 @@ private void refreshCssRules() { cssRules_.clearRules(); cssRulesIndexFix_.clear(); - final CSSRuleListImpl ruleList = (CSSRuleListImpl) getWrappedSheet().getCssRules(); - final List rules = ruleList.getRules(); + final CSSRuleListImpl ruleList = getWrappedSheet().getCssRules(); + final List rules = ruleList.getRules(); int pos = 0; - for (CSSRule rule : rules) { - if (rule instanceof org.w3c.dom.css.CSSCharsetRule) { + for (AbstractCSSRuleImpl rule : rules) { + if (rule instanceof CSSCharsetRuleImpl) { cssRulesIndexFix_.add(pos); continue; } @@ -1086,7 +1115,7 @@ private void refreshCssRules() { } // reset our index also - ((CSSStyleSheetImpl) getWrappedSheet()).resetRuleIndex(); + getWrappedSheet().resetRuleIndex(); } private int fixIndex(int index) { @@ -1123,7 +1152,7 @@ public void deleteRule(final int position) { * @param rule the rule * @return always return -1 as of MSDN documentation */ - @JsxFunction({IE, CHROME}) + @JsxFunction({IE, CHROME, FF68}) public int addRule(final String selector, final String rule) { String completeRule = selector + " {" + rule + "}"; try { @@ -1153,7 +1182,7 @@ public int addRule(final String selector, final String rule) { * @param position the position of the rule to be deleted * @see MSDN */ - @JsxFunction({IE, CHROME}) + @JsxFunction({IE, CHROME, FF68}) public void removeRule(final int position) { try { initCssRules(); @@ -1197,7 +1226,7 @@ else if (e instanceof HtmlLink) { } final WebClient webClient = getWindow().getWebWindow().getWebClient(); - final MediaList mediaList = parseMedia(webClient.getCssErrorHandler(), media); + final MediaListImpl mediaList = parseMedia(webClient.getCssErrorHandler(), media); return isActive(this, mediaList); } @@ -1223,13 +1252,13 @@ public void setEnabled(final boolean enabled) { * @param mediaList the media list * @return whether the specified {@link MediaList} is active or not */ - static boolean isActive(final SimpleScriptable scriptable, final MediaList mediaList) { + static boolean isActive(final SimpleScriptable scriptable, final MediaListImpl mediaList) { if (mediaList.getLength() == 0) { return true; } for (int i = 0; i < mediaList.getLength(); i++) { - final MediaQuery mediaQuery = ((MediaListImpl) mediaList).mediaQuery(i); + final MediaQuery mediaQuery = mediaList.mediaQuery(i); boolean isActive = isActive(scriptable, mediaQuery); if (mediaQuery.isNot()) { isActive = !isActive; @@ -1245,87 +1274,99 @@ private static boolean isActive(final SimpleScriptable scriptable, final MediaQu final String mediaType = mediaQuery.getMedia(); if ("screen".equalsIgnoreCase(mediaType) || "all".equalsIgnoreCase(mediaType)) { for (final Property property : mediaQuery.getProperties()) { - final float val; + final double val; switch (property.getName()) { case "max-width": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val < scriptable.getWindow().getWebWindow().getInnerWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val < scriptable.getWindow().getWebWindow().getInnerWidth()) { return false; } break; case "min-width": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val > scriptable.getWindow().getWebWindow().getInnerWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val > scriptable.getWindow().getWebWindow().getInnerWidth()) { return false; } break; case "max-device-width": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val < scriptable.getWindow().getScreen().getWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val < scriptable.getWindow().getScreen().getWidth()) { return false; } break; case "min-device-width": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val > scriptable.getWindow().getScreen().getWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val > scriptable.getWindow().getScreen().getWidth()) { return false; } break; case "max-height": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val < scriptable.getWindow().getWebWindow().getInnerWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val < scriptable.getWindow().getWebWindow().getInnerWidth()) { return false; } break; case "min-height": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val > scriptable.getWindow().getWebWindow().getInnerWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val > scriptable.getWindow().getWebWindow().getInnerWidth()) { return false; } break; case "max-device-height": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val < scriptable.getWindow().getScreen().getWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val < scriptable.getWindow().getScreen().getWidth()) { return false; } break; case "min-device-height": - val = pixelValue((CSSValueImpl) property.getValue(), scriptable); - if (val > scriptable.getWindow().getScreen().getWidth()) { + val = pixelValue(property.getValue(), scriptable); + if (val == -1 || val > scriptable.getWindow().getScreen().getWidth()) { return false; } break; case "resolution": - val = resolutionValue((CSSValueImpl) property.getValue()); - if (Math.round(val) != scriptable.getWindow().getScreen().getDeviceXDPI()) { + final CSSValueImpl propValue = property.getValue(); + val = resolutionValue(propValue); + if (propValue == null) { + return true; + } + if (val == -1 || Math.round(val) != scriptable.getWindow().getScreen().getDeviceXDPI()) { return false; } break; case "max-resolution": - val = resolutionValue((CSSValueImpl) property.getValue()); - if (val < scriptable.getWindow().getScreen().getDeviceXDPI()) { + val = resolutionValue(property.getValue()); + if (val == -1 || val < scriptable.getWindow().getScreen().getDeviceXDPI()) { return false; } break; case "min-resolution": - val = resolutionValue((CSSValueImpl) property.getValue()); - if (val > scriptable.getWindow().getScreen().getDeviceXDPI()) { + val = resolutionValue(property.getValue()); + if (val == -1 || val > scriptable.getWindow().getScreen().getDeviceXDPI()) { return false; } break; case "orientation": - final String orient = property.getValue().getCssText(); + final CSSValueImpl cssValue = property.getValue(); + if (cssValue == null) { + if (LOG.isWarnEnabled()) { + LOG.warn("CSSValue is null not supported for feature 'orientation'"); + } + return true; + } + + final String orient = cssValue.getCssText(); final WebWindow window = scriptable.getWindow().getWebWindow(); if ("portrait".equals(orient)) { if (window.getInnerWidth() > window.getInnerHeight()) { @@ -1338,8 +1379,10 @@ else if ("landscape".equals(orient)) { } } else { - LOG.warn("CSSValue '" + property.getValue().getCssText() - + "' not supported for feature 'orientation'."); + if (LOG.isWarnEnabled()) { + LOG.warn("CSSValue '" + property.getValue().getCssText() + + "' not supported for feature 'orientation'."); + } return false; } break; @@ -1352,51 +1395,77 @@ else if ("landscape".equals(orient)) { return false; } - private static float pixelValue(final CSSValueImpl cssValue, final SimpleScriptable scriptable) { - final int dpi; - switch (cssValue.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_PX: - return cssValue.getFloatValue(CSSPrimitiveValue.CSS_PX); - case CSSPrimitiveValue.CSS_EMS: - // hard coded default for the moment 16px = 1 em - return 16f * cssValue.getFloatValue(CSSPrimitiveValue.CSS_EMS); - case CSSPrimitiveValue.CSS_PERCENTAGE: - // hard coded default for the moment 16px = 100% - return 0.16f * cssValue.getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE); - case CSSPrimitiveValue.CSS_EXS: - // hard coded default for the moment 16px = 100% - return 0.16f * cssValue.getFloatValue(CSSPrimitiveValue.CSS_EXS); - case CSSPrimitiveValue.CSS_MM: - dpi = scriptable.getWindow().getScreen().getDeviceXDPI(); - return (dpi / 25.4f) * cssValue.getFloatValue(CSSPrimitiveValue.CSS_MM); - case CSSPrimitiveValue.CSS_CM: - dpi = scriptable.getWindow().getScreen().getDeviceXDPI(); - return (dpi / 254f) * cssValue.getFloatValue(CSSPrimitiveValue.CSS_CM); - case CSSPrimitiveValue.CSS_PT: - dpi = scriptable.getWindow().getScreen().getDeviceXDPI(); - return (dpi / 72f) * cssValue.getFloatValue(CSSPrimitiveValue.CSS_PT); - default: - break; + private static double pixelValue(final CSSValueImpl cssValue, final SimpleScriptable scriptable) { + if (cssValue == null) { + if (LOG.isWarnEnabled()) { + LOG.warn("CSSValue is null but has to be a 'px', 'em', '%', 'mm', 'ex', or 'pt' value."); + } + return -1; + } + + final LexicalUnit.LexicalUnitType luType = cssValue.getLexicalUnitType(); + if (luType != null) { + final int dpi; + + switch (luType) { + case PIXEL: + return cssValue.getDoubleValue(); + case EM: + // hard coded default for the moment 16px = 1 em + return 16f * cssValue.getDoubleValue(); + case PERCENTAGE: + // hard coded default for the moment 16px = 100% + return 0.16f * cssValue.getDoubleValue(); + case EX: + // hard coded default for the moment 16px = 100% + return 0.16f * cssValue.getDoubleValue(); + case REM: + // hard coded default for the moment 16px = 100% + return 0.16f * cssValue.getDoubleValue(); + case MILLIMETER: + dpi = scriptable.getWindow().getScreen().getDeviceXDPI(); + return (dpi / 25.4f) * cssValue.getDoubleValue(); + case CENTIMETER: + dpi = scriptable.getWindow().getScreen().getDeviceXDPI(); + return (dpi / 254f) * cssValue.getDoubleValue(); + case POINT: + dpi = scriptable.getWindow().getScreen().getDeviceXDPI(); + return (dpi / 72f) * cssValue.getDoubleValue(); + default: + break; + } + } + if (LOG.isWarnEnabled()) { + LOG.warn("CSSValue '" + cssValue.getCssText() + + "' has to be a 'px', 'em', '%', 'mm', 'ex', or 'pt' value."); } - LOG.warn("CSSValue '" + cssValue.getCssText() + "' has to be a 'px', 'em', '%', 'mm', 'ex', or 'pt' value."); return -1; } - private static float resolutionValue(final CSSValueImpl cssValue) { - if (cssValue.getPrimitiveType() == CSSPrimitiveValue.CSS_DIMENSION) { + private static double resolutionValue(final CSSValueImpl cssValue) { + if (cssValue == null) { + if (LOG.isWarnEnabled()) { + LOG.warn("CSSValue is null but has to be a 'dpi', 'dpcm', or 'dppx' value."); + } + return -1; + } + + if (cssValue.getPrimitiveType() == CSSPrimitiveValueType.CSS_DIMENSION) { final String text = cssValue.getCssText(); if (text.endsWith("dpi")) { - return cssValue.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION); + return cssValue.getDoubleValue(); } if (text.endsWith("dpcm")) { - return 2.54f * cssValue.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION); + return 2.54f * cssValue.getDoubleValue(); } if (text.endsWith("dppx")) { - return 96 * cssValue.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION); + return 96 * cssValue.getDoubleValue(); } } - LOG.warn("CSSValue '" + cssValue.getCssText() + "' has to be a 'dpi', 'dpcm', or 'dppx' value."); + if (LOG.isWarnEnabled()) { + LOG.warn("CSSValue '" + cssValue.getCssText() + "' has to be a 'dpi', 'dpcm', or 'dppx' value."); + } return -1; } @@ -1448,7 +1517,10 @@ private static boolean isValidSelector(final Selector selector, final int docume return isValidSelector(gas.getSelector(), documentMode, domNode) && isValidSelector(gas.getSimpleSelector(), documentMode, domNode); default: - LOG.warn("Unhandled CSS selector type '" + selector.getSelectorType() + "'. Accepting it silently."); + if (LOG.isWarnEnabled()) { + LOG.warn("Unhandled CSS selector type '" + + selector.getSelectorType() + "'. Accepting it silently."); + } return true; // at least in a first time to break less stuff } } @@ -1464,10 +1536,12 @@ private static boolean isValidCondition(final Condition condition, final int doc case ONE_OF_ATTRIBUTE_CONDITION: case BEGIN_HYPHEN_ATTRIBUTE_CONDITION: case CLASS_CONDITION: + case PREFIX_ATTRIBUTE_CONDITION: + case SUBSTRING_ATTRIBUTE_CONDITION: + case SUFFIX_ATTRIBUTE_CONDITION: return true; case PSEUDO_CLASS_CONDITION: - final PseudoClassCondition pcc = (PseudoClassCondition) condition; - String value = pcc.getValue(); + String value = condition.getValue(); if (value.endsWith(")")) { if (value.endsWith("()")) { return false; @@ -1486,14 +1560,17 @@ private static boolean isValidCondition(final Condition condition, final int doc } if ("nth-child()".equals(value)) { - final String arg = StringUtils.substringBetween(pcc.getValue(), "(", ")").trim(); + final String arg = StringUtils.substringBetween(condition.getValue(), "(", ")").trim(); return "even".equalsIgnoreCase(arg) || "odd".equalsIgnoreCase(arg) || NTH_NUMERIC.matcher(arg).matches() || NTH_COMPLEX.matcher(arg).matches(); } return CSS3_PSEUDO_CLASSES.contains(value); default: - LOG.warn("Unhandled CSS condition type '" + condition.getConditionType() + "'. Accepting it silently."); + if (LOG.isWarnEnabled()) { + LOG.warn("Unhandled CSS condition type '" + + condition.getConditionType() + "'. Accepting it silently."); + } return true; } } @@ -1507,12 +1584,12 @@ private void initCssRules() { } private CSSStyleSheetImpl.CSSStyleSheetRuleIndex getRuleIndex() { - final CSSStyleSheetImpl styleSheet = (CSSStyleSheetImpl) getWrappedSheet(); + final CSSStyleSheetImpl styleSheet = getWrappedSheet(); CSSStyleSheetImpl.CSSStyleSheetRuleIndex index = styleSheet.getRuleIndex(); if (index == null) { index = new CSSStyleSheetImpl.CSSStyleSheetRuleIndex(); - final CSSRuleListImpl ruleList = (CSSRuleListImpl) styleSheet.getCssRules(); + final CSSRuleListImpl ruleList = styleSheet.getCssRules(); index(index, ruleList, new HashSet()); styleSheet.setRuleIndex(index); @@ -1523,9 +1600,8 @@ private CSSStyleSheetImpl.CSSStyleSheetRuleIndex getRuleIndex() { private void index(final CSSStyleSheetImpl.CSSStyleSheetRuleIndex index, final CSSRuleListImpl ruleList, final Set alreadyProcessing) { - for (CSSRule rule : ruleList.getRules()) { - final short ruleType = rule.getType(); - if (CSSRule.STYLE_RULE == ruleType) { + for (AbstractCSSRuleImpl rule : ruleList.getRules()) { + if (rule instanceof CSSStyleRuleImpl) { final CSSStyleRuleImpl styleRule = (CSSStyleRuleImpl) rule; final SelectorList selectors = styleRule.getSelectors(); for (Selector selector : selectors) { @@ -1537,7 +1613,7 @@ private void index(final CSSStyleSheetImpl.CSSStyleSheetRuleIndex index, final C if (conds != null && conds.size() == 1) { final Condition c = conds.get(0); if (ConditionType.CLASS_CONDITION == c.getConditionType()) { - index.addClassSelector(es, ((ClassCondition) c).getValue(), selector, styleRule); + index.addClassSelector(es, c.getValue(), selector, styleRule); wasClass = true; } } @@ -1550,9 +1626,9 @@ private void index(final CSSStyleSheetImpl.CSSStyleSheetRuleIndex index, final C } } } - else if (CSSRule.IMPORT_RULE == ruleType) { + else if (rule instanceof CSSImportRuleImpl) { final CSSImportRuleImpl importRule = (CSSImportRuleImpl) rule; - final MediaList mediaList = importRule.getMedia(); + final MediaListImpl mediaList = importRule.getMedia(); CSSStyleSheet sheet = imports_.get(importRule); if (sheet == null) { @@ -1563,25 +1639,25 @@ else if (CSSRule.IMPORT_RULE == ruleType) { } if (!alreadyProcessing.contains(sheet.getUri())) { - final CSSRuleList sheetRuleList = sheet.getWrappedSheet().getCssRules(); + final CSSRuleListImpl sheetRuleList = sheet.getWrappedSheet().getCssRules(); alreadyProcessing.add(sheet.getUri()); if (mediaList.getLength() == 0 && index.getMediaList().getLength() == 0) { - index(index, (CSSRuleListImpl) sheetRuleList, alreadyProcessing); + index(index, sheetRuleList, alreadyProcessing); } else { - index(index.addMedia(mediaList), (CSSRuleListImpl) sheetRuleList, alreadyProcessing); + index(index.addMedia(mediaList), sheetRuleList, alreadyProcessing); } } } - else if (CSSRule.MEDIA_RULE == ruleType) { + else if (rule instanceof CSSMediaRuleImpl) { final CSSMediaRuleImpl mediaRule = (CSSMediaRuleImpl) rule; - final MediaList mediaList = mediaRule.getMedia(); + final MediaListImpl mediaList = mediaRule.getMediaList(); if (mediaList.getLength() == 0 && index.getMediaList().getLength() == 0) { - index(index, (CSSRuleListImpl) mediaRule.getCssRules(), alreadyProcessing); + index(index, mediaRule.getCssRules(), alreadyProcessing); } else { - index(index.addMedia(mediaList), (CSSRuleListImpl) mediaRule.getCssRules(), alreadyProcessing); + index(index.addMedia(mediaList), mediaRule.getCssRules(), alreadyProcessing); } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSSupportsRule.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSSupportsRule.java index 7c26b94a6e0..ebcf1fa73ef 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSSupportsRule.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSSupportsRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,14 +24,15 @@ * A JavaScript object for {@code CSSSupportsRule}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class CSSSupportsRule extends CSSConditionRule { /** * Creates a new instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public CSSSupportsRule() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValue.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValue.java index fcb4099be4c..c37d7cc36b8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValue.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.css; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; +import com.gargoylesoftware.css.dom.CSSValueImpl; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; @@ -26,10 +27,10 @@ /** * A JavaScript object for {@code CSSValue}. * - * @see org.w3c.dom.css.CSSValue * @author Marc Guillemot + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class CSSValue extends SimpleScriptable { /** @@ -65,7 +66,7 @@ public class CSSValue extends SimpleScriptable { /** * The wrapped CSS value. */ - private org.w3c.dom.css.CSSValue wrappedCssValue_; + private CSSValueImpl wrappedCssValue_; /** * Creates an instance. @@ -78,7 +79,7 @@ public CSSValue() { * Creates an instance and sets its parent scope to the one of the provided element. * @param element the element to which this style is bound */ - CSSValue(final Element element, final org.w3c.dom.css.CSSValue cssValue) { + CSSValue(final Element element, final CSSValueImpl cssValue) { setParentScope(element.getParentScope()); setPrototype(getPrototype(getClass())); setDomNode(element.getDomNodeOrNull(), false); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValueList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValueList.java index 4d19d71ccc1..919d62ef562 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValueList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CSSValueList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.css; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +23,9 @@ * A JavaScript object for {@code CSSValueList}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class CSSValueList extends CSSValue { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CaretPosition.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CaretPosition.java index 65302d971c4..8531601ce1b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CaretPosition.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/CaretPosition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java index 2c90f0b6c1b..940db39a59f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedCSSStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,12 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.css; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_COMPUTED_BLOCK_IF_NOT_ATTACHED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_COMPUTED_NO_Z_INDEX; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.CSS_STYLE_PROP_FONT_DISCONNECTED_IS_EMPTY; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDEFINITION_INLINE_IN_QUIRKS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLIENTHIGHT_INPUT_17; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLIENTHIGHT_INPUT_21; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_INPUT_TEXT_143; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_INPUT_TEXT_169; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; @@ -94,6 +97,8 @@ import org.apache.commons.lang3.StringUtils; +import com.gargoylesoftware.css.dom.CSSStyleDeclarationImpl; +import com.gargoylesoftware.css.dom.Property; import com.gargoylesoftware.css.parser.selector.Selector; import com.gargoylesoftware.css.parser.selector.SelectorSpecificity; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -105,6 +110,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlButton; import com.gargoylesoftware.htmlunit.html.HtmlButtonInput; import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput; +import com.gargoylesoftware.htmlunit.html.HtmlDefinitionDescription; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlFileInput; @@ -117,7 +123,6 @@ import com.gargoylesoftware.htmlunit.html.HtmlResetInput; import com.gargoylesoftware.htmlunit.html.HtmlSelect; import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; -import com.gargoylesoftware.htmlunit.html.HtmlTableRow; import com.gargoylesoftware.htmlunit.html.HtmlTextArea; import com.gargoylesoftware.htmlunit.html.HtmlTextInput; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -129,6 +134,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.Scriptable; /** * An object for a CSSStyleDeclaration, which is computed. @@ -259,11 +265,11 @@ protected void setStyleAttribute(final String name, final String newValue) { * @param declaration the style declaration * @param selector the selector determining that the style applies to this element */ - public void applyStyleFromSelector(final org.w3c.dom.css.CSSStyleDeclaration declaration, final Selector selector) { + public void applyStyleFromSelector(final CSSStyleDeclarationImpl declaration, final Selector selector) { final BrowserVersion browserVersion = getBrowserVersion(); final SelectorSpecificity specificity = selector.getSelectorSpecificity(); - for (int i = 0; i < declaration.getLength(); i++) { - final String name = declaration.item(i); + for (Property prop : declaration.getProperties()) { + final String name = prop.getName(); if (!browserVersion.hasFeature(CSS_COMPUTED_NO_Z_INDEX) || !"z-index".equals(name)) { final String value = declaration.getPropertyValue(name); final String priority = declaration.getPropertyPriority(name); @@ -341,7 +347,7 @@ private String defaultIfEmpty(final String str, final StyleAttributes.Definition private String defaultIfEmpty(final String str, final StyleAttributes.Definition definition, final boolean isPixel) { if (!getElement().getDomNodeOrDie().isAttachedToPage() - && getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + && getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return EMPTY_FINAL; } if (str == null || str.isEmpty()) { @@ -360,7 +366,7 @@ && getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { */ private String defaultIfEmpty(final String str, final String toReturnIfEmptyOrDefault, final String defaultValue) { if (!getElement().getDomNodeOrDie().isAttachedToPage() - && getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + && getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return EMPTY_FINAL; } if (str == null || str.isEmpty() || str.equals(defaultValue)) { @@ -483,7 +489,7 @@ public String getBorderRightColor() { */ @Override public String getBorderRightStyle() { - return defaultIfEmpty(super.getBorderRightStyle(), "none", null); + return defaultIfEmpty(super.getBorderRightStyle(), NONE, null); } /** @@ -507,7 +513,7 @@ public String getBorderTopColor() { */ @Override public String getBorderTopStyle() { - return defaultIfEmpty(super.getBorderTopStyle(), "none", null); + return defaultIfEmpty(super.getBorderTopStyle(), NONE, null); } /** @@ -553,22 +559,22 @@ public String getDisplay() { /** * Returns the {@code display} attribute. - * @param ignoreBlockIfNotAttached is - * {@link com.gargoylesoftware.htmlunit.BrowserVersionFeatures#CSS_COMPUTED_BLOCK_IF_NOT_ATTACHED} ignored + * @param ignoreBlockIfNotAttached flag * @return the {@code display} attribute */ public String getDisplay(final boolean ignoreBlockIfNotAttached) { // don't use defaultIfEmpty for performance // (no need to calculate the default if not empty) - final Element elem = getElement(); - final DomElement domElem = elem.getDomNodeOrDie(); + final DomElement domElem = getElement().getDomNodeOrDie(); boolean changeValueIfEmpty = false; if (!domElem.isAttachedToPage()) { final BrowserVersion browserVersion = getBrowserVersion(); - if (browserVersion.hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + if (browserVersion.hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return ""; } - if (!ignoreBlockIfNotAttached && browserVersion.hasFeature(CSS_COMPUTED_BLOCK_IF_NOT_ATTACHED)) { + if (!ignoreBlockIfNotAttached + && (domElem instanceof HtmlDefinitionDescription + && browserVersion.hasFeature(HTMLDEFINITION_INLINE_IN_QUIRKS))) { changeValueIfEmpty = true; } } @@ -590,7 +596,7 @@ public String getDisplay(final boolean ignoreBlockIfNotAttached) { case "table-row-group": case "list-item": case "ruby": - return "block"; + return BLOCK; default: } @@ -607,7 +613,7 @@ public String getDisplay(final boolean ignoreBlockIfNotAttached) { */ @Override public String getFont() { - if (getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX) + if (getBrowserVersion().hasFeature(CSS_STYLE_PROP_FONT_DISCONNECTED_IS_EMPTY) && getElement().getDomNodeOrDie().isAttachedToPage()) { return super.getFont(); } @@ -649,7 +655,7 @@ public String getFontFamily() { public String getHeight() { final Element elem = getElement(); if (!elem.getDomNodeOrDie().isAttachedToPage()) { - if (getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + if (getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return ""; } if (getStyleAttribute(HEIGHT, true).isEmpty()) { @@ -733,7 +739,8 @@ private String getMarginX(final String superMarginX, final Definition definition return pixelString(defaultIfEmpty(superMarginX, "0px", null)); } final Element elem = getElement(); - if (!elem.getDomNodeOrDie().isAttachedToPage() && getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + if (!elem.getDomNodeOrDie().isAttachedToPage() + && getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return ""; } @@ -762,7 +769,7 @@ public String getMarginTop() { */ @Override public String getMaxHeight() { - return defaultIfEmpty(super.getMaxHeight(), "none", null); + return defaultIfEmpty(super.getMaxHeight(), NONE, null); } /** @@ -770,7 +777,7 @@ public String getMaxHeight() { */ @Override public String getMaxWidth() { - return defaultIfEmpty(super.getMaxWidth(), "none", null); + return defaultIfEmpty(super.getMaxWidth(), NONE, null); } /** @@ -868,7 +875,7 @@ public String getTextIndent() { public String getTop() { final Element elem = getElement(); if (!elem.getDomNodeOrDie().isAttachedToPage() - && getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + && getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return ""; } final String superTop = super.getTop(); @@ -924,13 +931,13 @@ public String getPosition() { */ @Override public String getWidth() { - if ("none".equals(getDisplay())) { + if (NONE.equals(getDisplay())) { return AUTO; } final Element elem = getElement(); if (!elem.getDomNodeOrDie().isAttachedToPage()) { - if (getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + if (getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return ""; } if (getStyleAttribute(WIDTH, true).isEmpty()) { @@ -944,7 +951,7 @@ public String getWidth() { public String get(final ComputedCSSStyleDeclaration style) { final String value = style.getStyleAttribute(WIDTH, true); if (StringUtils.isEmpty(value)) { - if ("absolute".equals(getStyleAttribute(POSITION, true))) { + if (ABSOLUTE.equals(getStyleAttribute(POSITION, true))) { final String content = getDomNodeOrDie().getTextContent(); // do this only for small content // at least for empty div's this is more correct @@ -1012,7 +1019,7 @@ private int getCalculatedWidth() { } final String display = getDisplay(); - if ("none".equals(display)) { + if (NONE.equals(display)) { width_ = Integer.valueOf(0); return 0; } @@ -1033,11 +1040,11 @@ private int getCalculatedWidth() { // Width not explicitly set. final String cssFloat = getCssFloat(); if ("right".equals(cssFloat) || "left".equals(cssFloat) - || "absolute".equals(getStyleAttribute(POSITION, true))) { + || ABSOLUTE.equals(getStyleAttribute(POSITION, true))) { // We're floating; simplistic approximation: text content * pixels per character. width = node.getTextContent().length() * getBrowserVersion().getPixesPerChar(); } - else if ("block".equals(display)) { + else if (BLOCK.equals(display)) { if (element instanceof HTMLBodyElement) { width = windowWidth - 16; } @@ -1066,7 +1073,7 @@ else if (node instanceof HtmlTextInput || node instanceof HtmlPasswordInput) { if (browserVersion.hasFeature(JS_CLIENTWIDTH_INPUT_TEXT_169)) { return 169; } - width = 141; // FF45 + width = 141; // FF60 } else if (node instanceof HtmlRadioButtonInput || node instanceof HtmlCheckBoxInput) { width = 13; @@ -1169,21 +1176,16 @@ private int getCalculatedHeight() { return height_.intValue(); } - int height = getEmptyHeight(); - if (height == 0) { - height_ = Integer.valueOf(0); - return 0; - } - if (super.getHeight().isEmpty()) { final int contentHeight = getContentHeight(); if (contentHeight > 0) { - height = contentHeight; + height_ = Integer.valueOf(contentHeight); + return height_; } } - height_ = Integer.valueOf(height); - return height; + height_ = Integer.valueOf(getEmptyHeight()); + return height_; } /** @@ -1204,7 +1206,7 @@ private int getEmptyHeight() { return 0; } - if ("none".equals(getDisplay())) { + if (NONE.equals(getDisplay())) { height2_ = Integer.valueOf(0); return 0; } @@ -1231,12 +1233,16 @@ else if (node instanceof HtmlButton) { defaultHeight = 20; } else if (node instanceof HtmlInput && !(node instanceof HtmlHiddenInput)) { - if (getBrowserVersion().hasFeature(JS_CLIENTHIGHT_INPUT_17)) { + final BrowserVersion browser = getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHIGHT_INPUT_17)) { defaultHeight = 17; } - else { + else if (browser.hasFeature(JS_CLIENTHIGHT_INPUT_21)) { defaultHeight = 21; } + else { + defaultHeight = 20; + } } else if (node instanceof HtmlSelect) { defaultHeight = 20; @@ -1301,10 +1307,10 @@ public int getContentHeight() { final HTMLElement e = (HTMLElement) scriptObj; final ComputedCSSStyleDeclaration style = e.getWindow().getComputedStyle(e, null); final String pos = style.getPositionWithInheritance(); - if (STATIC.equals(pos) || "relative".equals(pos)) { + if (STATIC.equals(pos) || RELATIVE.equals(pos)) { lastFlowing = style; } - else if ("absolute".equals(pos)) { + else if (ABSOLUTE.equals(pos)) { styles.add(style); } } @@ -1366,7 +1372,7 @@ public int getTop(final boolean includeMargin, final boolean includeBorder, fina int top = 0; if (null == top_) { final String p = getPositionWithInheritance(); - if ("absolute".equals(p)) { + if (ABSOLUTE.equals(p)) { top = getTopForAbsolutePositionWithInheritance(); } else { @@ -1377,32 +1383,37 @@ public int getTop(final boolean includeMargin, final boolean includeBorder, fina if (prev instanceof HtmlElement) { final Element e = prev.getScriptableObject(); final ComputedCSSStyleDeclaration style = e.getWindow().getComputedStyle(e, null); - int prevTop = 0; - if (style.top_ == null) { - final String prevPosition = style.getPositionWithInheritance(); - if ("absolute".equals(prevPosition)) { - prevTop += style.getTopForAbsolutePositionWithInheritance(); + + // only previous block elements are counting + final String display = style.getDisplay(); + if (isBlock(display)) { + int prevTop = 0; + if (style.top_ == null) { + final String prevPosition = style.getPositionWithInheritance(); + if (ABSOLUTE.equals(prevPosition)) { + prevTop += style.getTopForAbsolutePositionWithInheritance(); + } + else { + if (RELATIVE.equals(prevPosition)) { + final String t = style.getTopWithInheritance(); + prevTop += pixelValue(t); + } + } } else { - if ("relative".equals(prevPosition)) { - final String t = style.getTopWithInheritance(); - prevTop += pixelValue(t); - } + prevHadComputedTop = true; + prevTop += style.top_; } + prevTop += style.getCalculatedHeight(true, true); + final int margin = pixelValue(style.getMarginTop()); + prevTop += margin; + top += prevTop; } - else { - prevHadComputedTop = true; - prevTop += style.top_; - } - prevTop += style.getCalculatedHeight(true, true); - final int margin = pixelValue(style.getMarginTop()); - prevTop += margin; - top += prevTop; } prev = prev.getPreviousSibling(); } // If the position is relative, we also need to add the specified "top" displacement. - if ("relative".equals(p)) { + if (RELATIVE.equals(p)) { final String t = getTopWithInheritance(); top += pixelValue(t); } @@ -1431,33 +1442,38 @@ public int getTop(final boolean includeMargin, final boolean includeBorder, fina return top; } + private static boolean isBlock(final String display) { + return display != null + && !INLINE.equals(display) + && !NONE.equals(display); + } + private int getTopForAbsolutePositionWithInheritance() { - int top = 0; final String t = getTopWithInheritance(); if (!AUTO.equals(t)) { // No need to calculate displacement caused by sibling nodes. - top = pixelValue(t); - } - else { - final String b = getBottomWithInheritance(); - - if (!AUTO.equals(b)) { - // Estimate the vertical displacement caused by *all* siblings. - // This is very rough, and doesn't even take position or display types into account. - // It also doesn't take into account the fact that the parent's height may be hardcoded in CSS. - top = 0; - DomNode child = getElement().getDomNodeOrDie().getParentNode().getFirstChild(); - while (child != null) { - if (child instanceof HtmlElement && child.mayBeDisplayed()) { - top += 20; - } - child = child.getNextSibling(); + return pixelValue(t); + } + + final String b = getBottomWithInheritance(); + if (!AUTO.equals(b)) { + // Estimate the vertical displacement caused by *all* siblings. + // This is very rough, and doesn't even take position or display types into account. + // It also doesn't take into account the fact that the parent's height may be hardcoded in CSS. + int top = 0; + DomNode child = getElement().getDomNodeOrDie().getParentNode().getFirstChild(); + while (child != null) { + if (child instanceof HtmlElement && child.mayBeDisplayed()) { + top += 20; } - top -= pixelValue(b); + child = child.getNextSibling(); } + top -= pixelValue(b); + return top; } - return top; + + return 0; } /** @@ -1473,24 +1489,24 @@ public int getLeft(final boolean includeMargin, final boolean includeBorder, fin final String r = getRightWithInheritance(); int left; - if ("absolute".equals(p) && !AUTO.equals(l)) { + if (ABSOLUTE.equals(p) && !AUTO.equals(l)) { // No need to calculate displacement caused by sibling nodes. left = pixelValue(l); } - else if ("absolute".equals(p) && !AUTO.equals(r)) { + else if (ABSOLUTE.equals(p) && !AUTO.equals(r)) { // Need to calculate the horizontal displacement caused by *all* siblings. final HTMLElement parent = (HTMLElement) getElement().getParentElement(); final ComputedCSSStyleDeclaration style = parent.getWindow().getComputedStyle(parent, null); final int parentWidth = style.getCalculatedWidth(false, false); left = parentWidth - pixelValue(r); } - else if ("fixed".equals(p) && !AUTO.equals(r)) { + else if (FIXED.equals(p) && !AUTO.equals(r)) { final HTMLElement parent = (HTMLElement) getElement().getParentElement(); final ComputedCSSStyleDeclaration style = getWindow().getComputedStyle(getElement(), null); final ComputedCSSStyleDeclaration parentStyle = parent.getWindow().getComputedStyle(parent, null); left = pixelValue(parentStyle.getWidth()) - pixelValue(style.getWidth()) - pixelValue(r); } - else if ("fixed".equals(p) && AUTO.equals(l)) { + else if (FIXED.equals(p) && AUTO.equals(l)) { // Fixed to the location at which the browser puts it via normal element flowing. final HTMLElement parent = (HTMLElement) getElement().getParentElement(); final ComputedCSSStyleDeclaration style = parent.getWindow().getComputedStyle(parent, null); @@ -1499,24 +1515,27 @@ else if ("fixed".equals(p) && AUTO.equals(l)) { else if (STATIC.equals(p)) { // We need to calculate the horizontal displacement caused by *previous* siblings. left = 0; - for (DomNode n = getDomNodeOrDie(); n != null; n = n.getPreviousSibling()) { - if (n.getScriptableObject() instanceof HTMLElement) { - final HTMLElement e = n.getScriptableObject(); + DomNode prev = getElement().getDomNodeOrDie().getPreviousSibling(); + while (prev != null) { + final Scriptable prevScriptable = prev.getScriptableObject(); + if (prevScriptable instanceof HTMLElement) { + final HTMLElement e = (HTMLElement) prevScriptable; final ComputedCSSStyleDeclaration style = e.getWindow().getComputedStyle(e, null); final String d = style.getDisplay(); - if ("block".equals(d)) { + if (isBlock(d)) { break; } - else if (!"none".equals(d)) { + else if (!NONE.equals(d)) { left += style.getCalculatedWidth(true, true); } } - else if (n.getScriptableObject() instanceof Text) { - left += n.getTextContent().length() * getBrowserVersion().getPixesPerChar(); - } - if (n instanceof HtmlTableRow) { - break; + else if (prevScriptable instanceof Text) { + final String content = prev.getTextContent(); + if (content != null) { + left += content.trim().length() * getBrowserVersion().getPixesPerChar(); + } } + prev = prev.getPreviousSibling(); } } else { @@ -1704,7 +1723,7 @@ public int getPaddingBottomValue() { private int getPaddingHorizontal() { if (paddingHorizontal_ == null) { paddingHorizontal_ = - Integer.valueOf("none".equals(getDisplay()) ? 0 : getPaddingLeftValue() + getPaddingRightValue()); + Integer.valueOf(NONE.equals(getDisplay()) ? 0 : getPaddingLeftValue() + getPaddingRightValue()); } return paddingHorizontal_.intValue(); } @@ -1712,7 +1731,7 @@ private int getPaddingHorizontal() { private int getPaddingVertical() { if (paddingVertical_ == null) { paddingVertical_ = - Integer.valueOf("none".equals(getDisplay()) ? 0 : getPaddingTopValue() + getPaddingBottomValue()); + Integer.valueOf(NONE.equals(getDisplay()) ? 0 : getPaddingTopValue() + getPaddingBottomValue()); } return paddingVertical_.intValue(); } @@ -1752,7 +1771,7 @@ public int getBorderBottomValue() { private int getBorderHorizontal() { if (borderHorizontal_ == null) { borderHorizontal_ = - Integer.valueOf("none".equals(getDisplay()) ? 0 : getBorderLeftValue() + getBorderRightValue()); + Integer.valueOf(NONE.equals(getDisplay()) ? 0 : getBorderLeftValue() + getBorderRightValue()); } return borderHorizontal_.intValue(); } @@ -1760,7 +1779,7 @@ private int getBorderHorizontal() { private int getBorderVertical() { if (borderVertical_ == null) { borderVertical_ = - Integer.valueOf("none".equals(getDisplay()) ? 0 : getBorderTopValue() + getBorderBottomValue()); + Integer.valueOf(NONE.equals(getDisplay()) ? 0 : getBorderTopValue() + getBorderBottomValue()); } return borderVertical_.intValue(); } @@ -1779,7 +1798,7 @@ public String getWordSpacing() { @Override public String getStyleAttribute(final Definition style, final boolean getDefaultValueIfEmpty) { if (!getElement().getDomNodeOrDie().isAttachedToPage() - && getBrowserVersion().hasFeature(CSS_COMPUTED_NO_Z_INDEX)) { + && getBrowserVersion().hasFeature(CSS_STYLE_PROP_DISCONNECTED_IS_EMPTY)) { return EMPTY_FINAL; } String value = super.getStyleAttribute(style, getDefaultValueIfEmpty); @@ -1830,7 +1849,7 @@ public String getPropertyValue(final String name) { * @see #pixelString(Element, CSSStyleDeclaration.CssValue) */ protected String pixelString(final String value) { - if (value == EMPTY_FINAL || value.endsWith("px")) { + if (EMPTY_FINAL == value || value.endsWith("px")) { return value; } return pixelValue(value) + "px"; @@ -1852,5 +1871,4 @@ protected String pixelString(final Element element, final CssValue value) { } return pixelValue(element, value) + "px"; } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedFont.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedFont.java index 080d2cac57e..c30271e5a77 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedFont.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/ComputedFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ * A helper class for handling font attributes of {@link ComputedCSSStyleDeclaration}. * * @author Ahmed Ashour + * @author Ronald Brill */ final class ComputedFont { @@ -27,14 +28,15 @@ final class ComputedFont { static final int LINE_HEIGHT_INDEX = 4; static final int FONT_FAMILY_INDEX = 5; - static String[] getDetails(String font, final boolean handleSpaceAfterSlash) { - while (font.contains(" ")) { - font = font.replace(" ", " "); + static String[] getDetails(final String font, final boolean handleSpaceAfterSlash) { + String fontName = font; + while (fontName.contains(" ")) { + fontName = fontName.replace(" ", " "); } - if (!handleSpaceAfterSlash && font.contains("/ ")) { + if (!handleSpaceAfterSlash && fontName.contains("/ ")) { return null; } - final String[] tokens = font.split(" "); + final String[] tokens = fontName.split(" "); if (tokens.length > 1) { final String[] fontSizeDetails = getFontSizeDetails(tokens[tokens.length - 2]); if (fontSizeDetails == null) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MediaQueryList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MediaQueryList.java index af135e43ccd..1df591238bb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MediaQueryList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/MediaQueryList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,9 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import org.w3c.dom.stylesheets.MediaList; - +import com.gargoylesoftware.css.dom.MediaListImpl; import com.gargoylesoftware.css.parser.CSSErrorHandler; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -31,6 +29,7 @@ * A JavaScript object for {@code MediaQueryList}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass public class MediaQueryList extends EventTarget { @@ -40,7 +39,7 @@ public class MediaQueryList extends EventTarget { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MediaQueryList() { } @@ -69,7 +68,7 @@ public String getMedia() { @JsxGetter public boolean isMatches() { final CSSErrorHandler errorHandler = getWindow().getWebWindow().getWebClient().getCssErrorHandler(); - final MediaList mediaList = CSSStyleSheet.parseMedia(errorHandler, media_); + final MediaListImpl mediaList = CSSStyleSheet.parseMedia(errorHandler, media_); return CSSStyleSheet.isActive(this, mediaList); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleAttributes.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleAttributes.java index c3ce2e84657..bdae408f1ee 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleAttributes.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.chrome; import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.ff; -import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.ff52up; -import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.ffBelow52; +import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.ff68up; +import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.ffBelow68; import static com.gargoylesoftware.htmlunit.javascript.host.css.BrowserConfiguration.ie; import java.util.ArrayList; @@ -94,24 +94,24 @@ public enum Definition { /** The style property {@code alignContent}. */ ALIGN_CONTENT("alignContent", "align-content", ie("stretch"), - ffBelow52("auto"), ff52up("normal"), chrome("normal")), + ff("normal"), chrome("normal")), /** The style property {@code align-content}. */ - ALIGN_CONTENT_("align-content", "align-content", ffBelow52("auto"), ff52up("normal")), + ALIGN_CONTENT_("align-content", "align-content", ff("normal")), /** The style property {@code alignItems}. */ - ALIGN_ITEMS("alignItems", "align-items", ffBelow52("start"), ff52up("normal"), + ALIGN_ITEMS("alignItems", "align-items", ff("normal"), ie("stretch"), chrome("normal")), /** The style property {@code align-items}. */ - ALIGN_ITEMS_("align-items", "align-items", ffBelow52("start"), ff52up("normal")), + ALIGN_ITEMS_("align-items", "align-items", ff("normal")), /** The style property {@code alignSelf}. */ - ALIGN_SELF("alignSelf", "align-self", ffBelow52("start"), ff52up("auto"), + ALIGN_SELF("alignSelf", "align-self", ff("auto"), ie("auto"), chrome("auto")), /** The style property {@code align-self}. */ - ALIGN_SELF_("align-self", "align-self", ffBelow52("start"), ff52up("auto")), + ALIGN_SELF_("align-self", "align-self", ff("auto")), /** The style property {@code alignmentBaseline}. */ ALIGNMENT_BASELINE("alignmentBaseline", "alignment-baseline", ie("auto"), chrome("auto")), @@ -180,6 +180,9 @@ public enum Definition { /** The style property {@code azimuth}. */ AZIMUTH("azimuth", "azimuth"), + /** The style property {@code backdropFilter}. */ + BACKDROP_FILTER("backdropFilter", "backdrop-filter", chrome("none")), + /** The style property {@code backfaceVisibility}. */ BACKFACE_VISIBILITY("backfaceVisibility", "backface-visibility", ff("visible"), ie("visible"), chrome("visible")), @@ -212,11 +215,12 @@ public enum Definition { BACKGROUND_CLIP_("background-clip", "background-clip", ff("border-box")), /** The style property {@code backgroundColor}. */ - BACKGROUND_COLOR("backgroundColor", "background-color", chrome("rgba(0, 0, 0, 0)"), ff("transparent"), + BACKGROUND_COLOR("backgroundColor", "background-color", chrome("rgba(0, 0, 0, 0)"), + ff("rgba(0, 0, 0, 0)"), ie("transparent")), /** The style property {@code background-color}. */ - BACKGROUND_COLOR_("background-color", "background-color", ff("transparent")), + BACKGROUND_COLOR_("background-color", "background-color", ff("rgba(0, 0, 0, 0)")), /** The style property {@code backgroundImage}. */ BACKGROUND_IMAGE("backgroundImage", "background-image", chrome("none"), ff("none"), ie("none")), @@ -239,17 +243,17 @@ public enum Definition { /** The style property {@code backgroundPositionX}. */ BACKGROUND_POSITION_X("backgroundPositionX", "background-position-x", - ie("undefined"), chrome("0%"), ff52up("0%")), + ie("undefined"), chrome("0%"), ff("0%")), /** The style property {@code background-position-x}. */ - BACKGROUND_POSITION_X_("background-position-x", "background-position-x", ff52up("0%")), + BACKGROUND_POSITION_X_("background-position-x", "background-position-x", ff("0%")), /** The style property {@code backgroundPositionY}. */ BACKGROUND_POSITION_Y("backgroundPositionY", "background-position-y", - ie("undefined"), chrome("0%"), ff52up("0%")), + ie("undefined"), chrome("0%"), ff("0%")), /** The style property {@code background-position-y}. */ - BACKGROUND_POSITION_Y_("background-position-y", "background-position-y", ff52up("0%")), + BACKGROUND_POSITION_Y_("background-position-y", "background-position-y", ff("0%")), /** The style property {@code backgroundRepeat}. */ BACKGROUND_REPEAT("backgroundRepeat", "background-repeat", chrome("repeat"), ff("repeat"), ie("repeat")), @@ -264,10 +268,11 @@ public enum Definition { BACKGROUND_REPEAT_Y("backgroundRepeatY", "background-repeat-y", chrome("")), /** The style property {@code backgroundSize}. */ - BACKGROUND_SIZE("backgroundSize", "background-size", ff("auto auto"), ie("auto"), chrome("auto")), + BACKGROUND_SIZE("backgroundSize", "background-size", ffBelow68("auto auto"), ff68up("auto"), + ie("auto"), chrome("auto")), /** The style property {@code background-size}. */ - BACKGROUND_SIZE_("background-size", "background-size", ff("auto auto")), + BACKGROUND_SIZE_("background-size", "background-size", ffBelow68("auto auto"), ff68up("auto")), /** The style property {@code baselineShift}. */ BASELINE_SHIFT("baselineShift", "baseline-shift", ie("baseline"), chrome("0px")), @@ -276,61 +281,95 @@ public enum Definition { BEHAVIOR("behavior", "behavior"), /** The style property {@code blockSize}. */ - BLOCK_SIZE("blockSize", "block-size", ff(""), chrome("0px")), + BLOCK_SIZE("blockSize", "block-size", chrome("322px"), ffBelow68(""), ff68up("343px")), /** The style property {@code block-size}. */ - BLOCK_SIZE_("block-size", "block-size", ff("")), + BLOCK_SIZE_("block-size", "block-size", ffBelow68(""), ff68up("343px")), /** The style property {@code border}. */ BORDER("border", "border", chrome("0px none rgb(0, 0, 0)"), ff(""), ie("")), + /** The style property {@code borderBlock}. */ + BORDER_BLOCK("borderBlock", "border-block", ff68up("")), + + /** The style property {@code border-block}. */ + BORDER_BLOCK_("border-block", "border-block", ff68up("")), + + /** The style property {@code borderBlockColor}. */ + BORDER_BLOCK_COLOR("borderBlockColor", "border-block-color", ff68up("")), + + /** The style property {@code border-block-color}. */ + BORDER_BLOCK_COLOR_("border-block-color", "border-block-color", ff68up("")), + /** The style property {@code borderBlockEnd}. */ - BORDER_BLOCK_END("borderBlockEnd", "border-block-end", ff("")), + BORDER_BLOCK_END("borderBlockEnd", "border-block-end", chrome("0px none rgb(0, 0, 0)"), ff("")), /** The style property {@code border-block-end}. */ BORDER_BLOCK_END_("border-block-end", "border-block-end", ff("")), /** The style property {@code borderBlockEndColor}. */ - BORDER_BLOCK_END_COLOR("borderBlockEndColor", "border-block-end-color", ff("")), + BORDER_BLOCK_END_COLOR("borderBlockEndColor", "border-block-end-color", chrome("rgb(0, 0, 0)"), + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code border-block-end-color}. */ - BORDER_BLOCK_END_COLOR_("border-block-end-color", "border-block-end-color", ff("")), + BORDER_BLOCK_END_COLOR_("border-block-end-color", "border-block-end-color", + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code borderBlockEndStyle}. */ - BORDER_BLOCK_END_STYLE("borderBlockEndStyle", "border-block-end-style", ff("")), + BORDER_BLOCK_END_STYLE("borderBlockEndStyle", "border-block-end-style", chrome("none"), + ffBelow68(""), ff68up("none")), /** The style property {@code border-block-end-style}. */ - BORDER_BLOCK_END_STYLE_("border-block-end-style", "border-block-end-style", ff("")), + BORDER_BLOCK_END_STYLE_("border-block-end-style", "border-block-end-style", ffBelow68(""), ff68up("none")), /** The style property {@code borderBlockEndWidth}. */ - BORDER_BLOCK_END_WIDTH("borderBlockEndWidth", "border-block-end-width", ff("")), + BORDER_BLOCK_END_WIDTH("borderBlockEndWidth", "border-block-end-width", chrome("0px"), + ffBelow68(""), ff68up("0px")), /** The style property {@code border-block-end-width}. */ - BORDER_BLOCK_END_WIDTH_("border-block-end-width", "border-block-end-width", ff("")), + BORDER_BLOCK_END_WIDTH_("border-block-end-width", "border-block-end-width", ffBelow68(""), ff68up("0px")), /** The style property {@code borderBlockStart}. */ - BORDER_BLOCK_START("borderBlockStart", "border-block-start", ff("")), + BORDER_BLOCK_START("borderBlockStart", "border-block-start", chrome("0px none rgb(0, 0, 0)"), ff("")), /** The style property {@code border-block-start}. */ BORDER_BLOCK_START_("border-block-start", "border-block-start", ff("")), /** The style property {@code borderBlockStartColor}. */ - BORDER_BLOCK_START_COLOR("borderBlockStartColor", "border-block-start-color", ff("")), + BORDER_BLOCK_START_COLOR("borderBlockStartColor", "border-block-start-color", chrome("rgb(0, 0, 0)"), + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code border-block-start-color}. */ - BORDER_BLOCK_START_COLOR_("border-block-start-color", "border-block-start-color", ff("")), + BORDER_BLOCK_START_COLOR_("border-block-start-color", "border-block-start-color", + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code borderBlockStartStyle}. */ - BORDER_BLOCK_START_STYLE("borderBlockStartStyle", "border-block-start-style", ff("")), + BORDER_BLOCK_START_STYLE("borderBlockStartStyle", "border-block-start-style", chrome("none"), + ffBelow68(""), ff68up("none")), /** The style property {@code border-block-start-style}. */ - BORDER_BLOCK_START_STYLE_("border-block-start-style", "border-block-start-style", ff("")), + BORDER_BLOCK_START_STYLE_("border-block-start-style", "border-block-start-style", + ffBelow68(""), ff68up("none")), /** The style property {@code borderBlockStartWidth}. */ - BORDER_BLOCK_START_WIDTH("borderBlockStartWidth", "border-block-start-width", ff("")), + BORDER_BLOCK_START_WIDTH("borderBlockStartWidth", "border-block-start-width", chrome("0px"), + ffBelow68(""), ff68up("0px")), /** The style property {@code border-block-start-width}. */ - BORDER_BLOCK_START_WIDTH_("border-block-start-width", "border-block-start-width", ff("")), + BORDER_BLOCK_START_WIDTH_("border-block-start-width", "border-block-start-width", + ffBelow68(""), ff68up("0px")), + + /** The style property {@code borderBlockStyle}. */ + BORDER_BLOCK_STYLE("borderBlockStyle", "border-block-style", ff68up("")), + + /** The style property {@code border-block-style}. */ + BORDER_BLOCK_STYLE_("border-block-style", "border-block-style", ff68up("")), + + /** The style property {@code borderBlockWidth}. */ + BORDER_BLOCK_WIDTH("borderBlockWidth", "border-block-width", ff68up("")), + + /** The style property {@code border-block-width}. */ + BORDER_BLOCK_WIDTH_("border-block-width", "border-block-width", ff68up("")), /** The style property {@code borderBottom}. */ BORDER_BOTTOM("borderBottom", "border-bottom", chrome("0px none rgb(0, 0, 0)"), ff(""), ie("")), @@ -383,6 +422,18 @@ public enum Definition { /** The style property {@code border-color}. */ BORDER_COLOR_("border-color", "border-color", ff("")), + /** The style property {@code borderEndEndRadius}. */ + BORDER_END_END_RADIUS("borderEndEndRadius", "border-end-end-radius", ff68up("0px")), + + /** The style property {@code border-end-end-radius}. */ + BORDER_END_END_RADIUS_("border-end-end-radius", "border-end-end-radius", ff68up("0px")), + + /** The style property {@code borderEndStartRadius}. */ + BORDER_END_START_RADIUS("borderEndStartRadius", "border-end-start-radius", ff68up("0px")), + + /** The style property {@code border-end-start-radius}. */ + BORDER_END_START_RADIUS_("border-end-start-radius", "border-end-start-radius", ff68up("0px")), + /** The style property {@code borderImage}. */ BORDER_IMAGE("borderImage", "border-image", ff(""), ie(""), chrome("none")), @@ -390,24 +441,27 @@ public enum Definition { BORDER_IMAGE_("border-image", "border-image", ff("")), /** The style property {@code borderImageOutset}. */ - BORDER_IMAGE_OUTSET("borderImageOutset", "border-image-outset", ff("0 0 0 0"), ie("0"), chrome("0px")), + BORDER_IMAGE_OUTSET("borderImageOutset", "border-image-outset", ie("0"), chrome("0px"), + ff("0")), /** The style property {@code border-image-outset}. */ - BORDER_IMAGE_OUTSET_("border-image-outset", "border-image-outset", ff("0 0 0 0")), + BORDER_IMAGE_OUTSET_("border-image-outset", "border-image-outset", ff("0")), /** The style property {@code borderImageRepeat}. */ BORDER_IMAGE_REPEAT("borderImageRepeat", "border-image-repeat", - ff("stretch stretch"), ie("stretch"), chrome("stretch")), + ffBelow68("stretch stretch"), ff68up("stretch"), ie("stretch"), chrome("stretch")), /** The style property {@code border-image-repeat}. */ - BORDER_IMAGE_REPEAT_("border-image-repeat", "border-image-repeat", ff("stretch stretch")), + BORDER_IMAGE_REPEAT_("border-image-repeat", "border-image-repeat", + ffBelow68("stretch stretch"), ff68up("stretch")), /** The style property {@code borderImageSlice}. */ - BORDER_IMAGE_SLICE("borderImageSlice", "border-image-slice", - ff("100% 100% 100% 100%"), ie("100%"), chrome("100%")), + BORDER_IMAGE_SLICE("borderImageSlice", "border-image-slice", ie("100%"), chrome("100%"), + ff("100%")), /** The style property {@code border-image-slice}. */ - BORDER_IMAGE_SLICE_("border-image-slice", "border-image-slice", ff("100% 100% 100% 100%")), + BORDER_IMAGE_SLICE_("border-image-slice", "border-image-slice", + ff("100%")), /** The style property {@code borderImageSource}. */ BORDER_IMAGE_SOURCE("borderImageSource", "border-image-source", ff("none"), ie("none"), chrome("none")), @@ -416,58 +470,95 @@ public enum Definition { BORDER_IMAGE_SOURCE_("border-image-source", "border-image-source", ff("none")), /** The style property {@code borderImageWidth}. */ - BORDER_IMAGE_WIDTH("borderImageWidth", "border-image-width", ff("1 1 1 1"), ie("1"), chrome("1")), + BORDER_IMAGE_WIDTH("borderImageWidth", "border-image-width", ie("1"), chrome("1"), + ff("1")), /** The style property {@code border-image-width}. */ - BORDER_IMAGE_WIDTH_("border-image-width", "border-image-width", ff("1 1 1 1")), + BORDER_IMAGE_WIDTH_("border-image-width", "border-image-width", ff("1")), + + /** The style property {@code borderInline}. */ + BORDER_INLINE("borderInline", "border-inline", ff68up("")), + + /** The style property {@code border-inline}. */ + BORDER_INLINE_("border-inline", "border-inline", ff68up("")), + + /** The style property {@code borderInlineColor}. */ + BORDER_INLINE_COLOR("borderInlineColor", "border-inline-color", ff68up("")), + + /** The style property {@code border-inline-color}. */ + BORDER_INLINE_COLOR_("border-inline-color", "border-inline-color", ff68up("")), /** The style property {@code borderInlineEnd}. */ - BORDER_INLINE_END("borderInlineEnd", "border-inline-end", ff("")), + BORDER_INLINE_END("borderInlineEnd", "border-inline-end", chrome("0px none rgb(0, 0, 0)"), ff("")), /** The style property {@code border-inline-end}. */ BORDER_INLINE_END_("border-inline-end", "border-inline-end", ff("")), /** The style property {@code borderInlineEndColor}. */ - BORDER_INLINE_END_COLOR("borderInlineEndColor", "border-inline-end-color", ff("")), + BORDER_INLINE_END_COLOR("borderInlineEndColor", "border-inline-end-color", chrome("rgb(0, 0, 0)"), + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code border-inline-end-color}. */ - BORDER_INLINE_END_COLOR_("border-inline-end-color", "border-inline-end-color", ff("")), + BORDER_INLINE_END_COLOR_("border-inline-end-color", "border-inline-end-color", + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code borderInlineEndStyle}. */ - BORDER_INLINE_END_STYLE("borderInlineEndStyle", "border-inline-end-style", ff("")), + BORDER_INLINE_END_STYLE("borderInlineEndStyle", "border-inline-end-style", chrome("none"), + ffBelow68(""), ff68up("none")), /** The style property {@code border-inline-end-style}. */ - BORDER_INLINE_END_STYLE_("border-inline-end-style", "border-inline-end-style", ff("")), + BORDER_INLINE_END_STYLE_("border-inline-end-style", "border-inline-end-style", + ffBelow68(""), ff68up("none")), /** The style property {@code borderInlineEndWidth}. */ - BORDER_INLINE_END_WIDTH("borderInlineEndWidth", "border-inline-end-width", ff("")), + BORDER_INLINE_END_WIDTH("borderInlineEndWidth", "border-inline-end-width", chrome("0px"), + ffBelow68(""), ff68up("0px")), /** The style property {@code border-inline-end-width}. */ - BORDER_INLINE_END_WIDTH_("border-inline-end-width", "border-inline-end-width", ff("")), + BORDER_INLINE_END_WIDTH_("border-inline-end-width", "border-inline-end-width", + ffBelow68(""), ff68up("0px")), /** The style property {@code borderInlineStart}. */ - BORDER_INLINE_START("borderInlineStart", "border-inline-start", ff("")), + BORDER_INLINE_START("borderInlineStart", "border-inline-start", chrome("0px none rgb(0, 0, 0)"), ff("")), /** The style property {@code border-inline-start}. */ BORDER_INLINE_START_("border-inline-start", "border-inline-start", ff("")), /** The style property {@code borderInlineStartColor}. */ - BORDER_INLINE_START_COLOR("borderInlineStartColor", "border-inline-start-color", ff("")), + BORDER_INLINE_START_COLOR("borderInlineStartColor", "border-inline-start-color", + chrome("rgb(0, 0, 0)"), ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code border-inline-start-color}. */ - BORDER_INLINE_START_COLOR_("border-inline-start-color", "border-inline-start-color", ff("")), + BORDER_INLINE_START_COLOR_("border-inline-start-color", "border-inline-start-color", + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code borderInlineStartStyle}. */ - BORDER_INLINE_START_STYLE("borderInlineStartStyle", "border-inline-start-style", ff("")), + BORDER_INLINE_START_STYLE("borderInlineStartStyle", "border-inline-start-style", chrome("none"), + ffBelow68(""), ff68up("none")), /** The style property {@code border-inline-start-style}. */ - BORDER_INLINE_START_STYLE_("border-inline-start-style", "border-inline-start-style", ff("")), + BORDER_INLINE_START_STYLE_("border-inline-start-style", "border-inline-start-style", + ffBelow68(""), ff68up("none")), /** The style property {@code borderInlineStartWidth}. */ - BORDER_INLINE_START_WIDTH("borderInlineStartWidth", "border-inline-start-width", ff("")), + BORDER_INLINE_START_WIDTH("borderInlineStartWidth", "border-inline-start-width", chrome("0px"), + ffBelow68(""), ff68up("0px")), /** The style property {@code border-inline-start-width}. */ - BORDER_INLINE_START_WIDTH_("border-inline-start-width", "border-inline-start-width", ff("")), + BORDER_INLINE_START_WIDTH_("border-inline-start-width", "border-inline-start-width", + ffBelow68(""), ff68up("0px")), + + /** The style property {@code borderInlineStyle}. */ + BORDER_INLINE_STYLE("borderInlineStyle", "border-inline-style", ff68up("")), + + /** The style property {@code border-inline-style}. */ + BORDER_INLINE_STYLE_("border-inline-style", "border-inline-style", ff68up("")), + + /** The style property {@code borderInlineWidth}. */ + BORDER_INLINE_WIDTH("borderInlineWidth", "border-inline-color", ff68up("")), + + /** The style property {@code border-inline-width}. */ + BORDER_INLINE_WIDTH_("border-inline-width", "border-inline-color", ff68up("")), /** The style property {@code borderLeft}. */ BORDER_LEFT("borderLeft", "border-left", chrome("0px none rgb(0, 0, 0)"), ff(""), ie("")), @@ -530,6 +621,18 @@ public enum Definition { /** The style property {@code border-spacing}. */ BORDER_SPACING_("border-spacing", "border-spacing", ff("0px 0px")), + /** The style property {@code borderStartEndRadius}. */ + BORDER_START_END_RADIUS("borderStartEndRadius", "border-start-end-radius", ff68up("0px")), + + /** The style property {@code border-start-end-radius}. */ + BORDER_START_END_RADIUS_("border-start-end-radius", "border-start-end-radius", ff68up("0px")), + + /** The style property {@code borderStartStartRadius}. */ + BORDER_START_START_RADIUS("borderStartStartRadius", "border-start-start-radius", ff68up("0px")), + + /** The style property {@code border-start-start-radius}. */ + BORDER_START_START_RADIUS_("border-start-start-radius", "border-start-start-radius", ff68up("0px")), + /** The style property {@code borderStyle}. */ BORDER_STYLE("borderStyle", "border-style", chrome("none"), ff(""), ie("")), @@ -602,13 +705,22 @@ public enum Definition { BOX_SIZING_("box-sizing", "box-sizing", ff("content-box")), /** The style property {@code breakAfter}. */ - BREAK_AFTER("breakAfter", "break-after", chrome("auto"), ie("auto")), + BREAK_AFTER("breakAfter", "break-after", chrome("auto"), ff68up("auto"), ie("auto")), + + /** The style property {@code break-after}. */ + BREAK_AFTER_("break-after", "break-after", ff68up("auto")), /** The style property {@code breakBefore}. */ - BREAK_BEFORE("breakBefore", "break-before", chrome("auto"), ie("auto")), + BREAK_BEFORE("breakBefore", "break-before", chrome("auto"), ff68up("auto"), ie("auto")), + + /** The style property {@code break-before}. */ + BREAK_BEFORE_("break-before", "break-before", ff68up("auto")), /** The style property {@code breakInside}. */ - BREAK_INSIDE("breakInside", "break-inside", chrome("auto"), ie("auto")), + BREAK_INSIDE("breakInside", "break-inside", chrome("auto"), ff68up("auto"), ie("auto")), + + /** The style property {@code break-inside}. */ + BREAK_INSIDE_("break-inside", "break-inside", ff68up("auto")), /** The style property {@code bufferedRendering}. */ BUFFERED_RENDERING("bufferedRendering", "buffered-rendering", chrome("auto")), @@ -620,7 +732,10 @@ public enum Definition { CAPTION_SIDE_("caption-side", "caption-side", ff("top")), /** The style property {@code caretColor}. */ - CARET_COLOR("caretColor", "caret-color", chrome("rgb(0, 0, 0)")), + CARET_COLOR("caretColor", "caret-color", chrome("rgb(0, 0, 0)"), ff("rgb(0, 0, 0)")), + + /** The style property {@code caret-color}. */ + CARET_COLOR_("caret-color", "caret-color", ff("rgb(0, 0, 0)")), /** The style property {@code clear}. */ CLEAR("clear", "clear", chrome("none"), ff("none"), ie("none")), @@ -644,20 +759,20 @@ public enum Definition { COLOR("color", "color", chrome("rgb(0, 0, 0)"), ff(""), ie("")), /** The style property {@code colorAdjust}. */ - COLOR_ADJUST("colorAdjust", "color-adjust", ff52up("economy")), + COLOR_ADJUST("colorAdjust", "color-adjust", ff("economy")), /** The style property {@code color-adjust}. */ - COLOR_ADJUST_("color-adjust", "color-adjust", ff52up("economy")), + COLOR_ADJUST_("color-adjust", "color-adjust", ff("economy")), /** The style property {@code colorInterpolation}. */ - COLOR_INTERPOLATION("colorInterpolation", "color-interpolation", ff("srgb"), chrome("sRGB")), + COLOR_INTERPOLATION("colorInterpolation", "color-interpolation", ff("srgb"), chrome("srgb")), /** The style property {@code color-interpolation}. */ COLOR_INTERPOLATION_("color-interpolation", "color-interpolation", ff("srgb")), /** The style property {@code colorInterpolationFilters}. */ COLOR_INTERPOLATION_FILTERS("colorInterpolationFilters", - "color-interpolation-filters", ff("linearrgb"), ie(""), chrome("linearRGB")), + "color-interpolation-filters", ff("linearrgb"), ie(""), chrome("linearrgb")), /** The style property {@code color-interpolation-filters}. */ COLOR_INTERPOLATION_FILTERS_("color-interpolation-filters", "color-interpolation-filters", ff("linearrgb")), @@ -666,65 +781,65 @@ public enum Definition { COLOR_RENDERING("colorRendering", "color-rendering", chrome("auto")), /** The style property {@code columnCount}. */ - COLUMN_COUNT("columnCount", "column-count", chrome("auto"), ff52up("auto"), ie("auto")), + COLUMN_COUNT("columnCount", "column-count", chrome("auto"), ff("auto"), ie("auto")), /** The style property {@code column-count}. */ - COLUMN_COUNT_("column-count", "column-count", ff52up("auto")), + COLUMN_COUNT_("column-count", "column-count", ff("auto")), /** The style property {@code columnFill}. */ - COLUMN_FILL("columnFill", "column-fill", chrome("balance"), ff52up("balance"), ie("balance")), + COLUMN_FILL("columnFill", "column-fill", chrome("balance"), ff("balance"), ie("balance")), /** The style property {@code column-fill}. */ - COLUMN_FILL_("column-fill", "column-fill", ff52up("balance")), + COLUMN_FILL_("column-fill", "column-fill", ff("balance")), /** The style property {@code columnGap}. */ - COLUMN_GAP("columnGap", "column-gap", chrome("normal"), ff52up("16px"), ie("normal")), + COLUMN_GAP("columnGap", "column-gap", chrome("normal"), ie("normal"), ff("normal")), /** The style property {@code column-gap}. */ - COLUMN_GAP_("column-gap", "column-gap", ff52up("16px")), + COLUMN_GAP_("column-gap", "column-gap", ff("normal")), /** The style property {@code columnRule}. */ - COLUMN_RULE("columnRule", "column-rule", chrome("0px none rgb(0, 0, 0)"), ff52up(""), ie("")), + COLUMN_RULE("columnRule", "column-rule", chrome("0px none rgb(0, 0, 0)"), ff(""), ie("")), /** The style property {@code column-rule}. */ - COLUMN_RULE_("column-rule", "column-rule", ff52up("")), + COLUMN_RULE_("column-rule", "column-rule", ff("")), /** The style property {@code columnRuleColor}. */ COLUMN_RULE_COLOR("columnRuleColor", "column-rule-color", - chrome("rgb(0, 0, 0)"), ff52up("rgb(0, 0, 0)"), ie("rgb(0, 0, 0)")), + chrome("rgb(0, 0, 0)"), ff("rgb(0, 0, 0)"), ie("rgb(0, 0, 0)")), /** The style property {@code column-rule-color}. */ - COLUMN_RULE_COLOR_("column-rule-color", "column-rule-color", ff52up("rgb(0, 0, 0)")), + COLUMN_RULE_COLOR_("column-rule-color", "column-rule-color", ff("rgb(0, 0, 0)")), /** The style property {@code columnRuleStyle}. */ - COLUMN_RULE_STYLE("columnRuleStyle", "column-rule-style", chrome("none"), ff52up("none"), ie("none")), + COLUMN_RULE_STYLE("columnRuleStyle", "column-rule-style", chrome("none"), ff("none"), ie("none")), /** The style property {@code column-rule-style}. */ - COLUMN_RULE_STYLE_("column-rule-style", "column-rule-style", ff52up("none")), + COLUMN_RULE_STYLE_("column-rule-style", "column-rule-style", ff("none")), /** The style property {@code columnRuleWidth}. */ - COLUMN_RULE_WIDTH("columnRuleWidth", "column-rule-width", chrome("0px"), ff52up("0px"), ie("medium")), + COLUMN_RULE_WIDTH("columnRuleWidth", "column-rule-width", chrome("0px"), ff("0px"), ie("medium")), /** The style property {@code column-rule-width}. */ - COLUMN_RULE_WIDTH_("column-rule-width", "column-rule-width", ff52up("0px")), + COLUMN_RULE_WIDTH_("column-rule-width", "column-rule-width", ff("0px")), /** The style property {@code columnSpan}. */ COLUMN_SPAN("columnSpan", "column-span", chrome("none"), ie("1")), /** The style property {@code columnWidth}. */ - COLUMN_WIDTH("columnWidth", "column-width", chrome("auto"), ff52up("auto"), ie("auto")), + COLUMN_WIDTH("columnWidth", "column-width", chrome("auto"), ff("auto"), ie("auto")), /** The style property {@code column-width}. */ - COLUMN_WIDTH_("column-width", "column-width", ff52up("auto")), + COLUMN_WIDTH_("column-width", "column-width", ff("auto")), /** The style property {@code columns}. */ - COLUMNS("columns", "columns", chrome("auto auto"), ff52up(""), ie("")), + COLUMNS("columns", "columns", chrome("auto auto"), ff(""), ie("")), /** The style property {@code contain}. */ CONTAIN("contain", "contain", chrome("none")), /** The style property {@code content}. */ - CONTENT("content", "content", ie("normal"), chrome(""), ff("none")), + CONTENT("content", "content", ie("normal"), chrome("normal"), ff("none")), /** The style property {@code counterIncrement}. */ COUNTER_INCREMENT("counterIncrement", "counter-increment", chrome("none"), ff("none"), ie("none")), @@ -738,6 +853,12 @@ public enum Definition { /** The style property {@code counter-reset}. */ COUNTER_RESET_("counter-reset", "counter-reset", ff("none")), + /** The style property {@code counterSet}. */ + COUNTER_SET("counterSet", "counter-set", ff68up("none")), + + /** The style property {@code counter-set}. */ + COUNTER_SET_("counter-set", "counter-set", ff68up("none")), + /** The style property {@code cssFloat}. */ CSS_FLOAT("cssFloat", "css-float", chrome("none"), ff("none"), ie("none")), @@ -864,7 +985,7 @@ public enum Definition { FLOOD_OPACITY_("flood-opacity", "flood-opacity", ff("1")), /** The style property {@code font}. */ - FONT("font", "font", chrome("normal normal 400 normal 16px / normal \"Times New Roman\""), ff(""), ie("")), + FONT("font", "font", chrome("16px \"Times New Roman\""), ff(""), ie("")), /** The style property {@code fontDisplay}. */ FONT_DISPLAY("fontDisplay", "font-display", chrome("")), @@ -894,6 +1015,9 @@ public enum Definition { /** The style property {@code font-language-override}. */ FONT_LANGUAGE_OVERRIDE_("font-language-override", "font-language-override", ff("normal")), + /** The style property {@code fontOpticalSizing}. */ + FONT_OPTICAL_SIZING("fontOpticalSizing", "font-optical-sizing", chrome("auto")), + /** The style property {@code fontSize}. */ FONT_SIZE("fontSize", "font-size", chrome("16px"), ff("16px"), ie("16px")), @@ -907,10 +1031,11 @@ public enum Definition { FONT_SIZE_ADJUST_("font-size-adjust", "font-size-adjust", ff("none")), /** The style property {@code fontStretch}. */ - FONT_STRETCH("fontStretch", "font-stretch", chrome("100%"), ff("normal"), ie("normal")), + FONT_STRETCH("fontStretch", "font-stretch", chrome("100%"), + ffBelow68("normal"), ff68up("100%"), ie("normal")), /** The style property {@code font-stretch}. */ - FONT_STRETCH_("font-stretch", "font-stretch", ff("normal")), + FONT_STRETCH_("font-stretch", "font-stretch", ffBelow68("normal"), ff68up("100%")), /** The style property {@code fontStyle}. */ FONT_STYLE("fontStyle", "font-style", chrome("normal"), ff("normal"), ie("normal")), @@ -976,7 +1101,7 @@ public enum Definition { FONT_WEIGHT_("font-weight", "font-weight", ff("400")), /** The style property {@code gap}. */ - GAP("gap", "gap", chrome("normal normal")), + GAP("gap", "gap", chrome("normal"), ff68up("")), /** The style property {@code glyphOrientationHorizontal}. */ GLYPH_ORIENTATION_HORIZONTAL("glyphOrientationHorizontal", "glyph-orientation-horizontal", @@ -988,109 +1113,111 @@ public enum Definition { /** The style property {@code grid}. */ GRID("grid", "grid", chrome("none / none / none / row / auto / auto"), - ff52up("")), + ff("")), /** The style property {@code gridArea}. */ - GRID_AREA("gridArea", "grid-area", chrome("auto / auto / auto / auto"), ff52up("")), + GRID_AREA("gridArea", "grid-area", chrome("auto / auto / auto / auto"), ff("")), /** The style property {@code grid-area}. */ - GRID_AREA_("grid-area", "grid-area", ff52up("")), + GRID_AREA_("grid-area", "grid-area", ff("")), /** The style property {@code gridAutoColumns}. */ - GRID_AUTO_COLUMNS("gridAutoColumns", "grid-auto-columns", chrome("auto"), ff52up("auto")), + GRID_AUTO_COLUMNS("gridAutoColumns", "grid-auto-columns", chrome("auto"), ff("auto")), /** The style property {@code grid-auto-columns}. */ - GRID_AUTO_COLUMNS_("grid-auto-columns", "grid-auto-columns", ff52up("auto")), + GRID_AUTO_COLUMNS_("grid-auto-columns", "grid-auto-columns", ff("auto")), /** The style property {@code gridAutoFlow}. */ - GRID_AUTO_FLOW("gridAutoFlow", "grid-auto-flow", chrome("row"), ff52up("row")), + GRID_AUTO_FLOW("gridAutoFlow", "grid-auto-flow", chrome("row"), ff("row")), /** The style property {@code grid-auto-flow}. */ - GRID_AUTO_FLOW_("grid-auto-flow", "grid-auto-flow", ff52up("row")), + GRID_AUTO_FLOW_("grid-auto-flow", "grid-auto-flow", ff("row")), /** The style property {@code gridAutoRows}. */ - GRID_AUTO_ROWS("gridAutoRows", "grid-auto-rows", chrome("auto"), ff52up("auto")), + GRID_AUTO_ROWS("gridAutoRows", "grid-auto-rows", chrome("auto"), ff("auto")), /** The style property {@code grid-auto-rows}. */ - GRID_AUTO_ROWS_("grid-auto-rows", "grid-auto-rows", ff52up("auto")), + GRID_AUTO_ROWS_("grid-auto-rows", "grid-auto-rows", ff("auto")), /** The style property {@code gridColumn}. */ - GRID_COLUMN("gridColumn", "grid-column", chrome("auto / auto"), ff52up("")), + GRID_COLUMN("gridColumn", "grid-column", chrome("auto / auto"), ff("")), /** The style property {@code grid-column}. */ - GRID_COLUMN_("grid-column", "grid-column", ff52up("")), + GRID_COLUMN_("grid-column", "grid-column", ff("")), /** The style property {@code gridColumnEnd}. */ - GRID_COLUMN_END("gridColumnEnd", "grid-column-end", chrome("auto"), ff52up("auto")), + GRID_COLUMN_END("gridColumnEnd", "grid-column-end", chrome("auto"), ff("auto")), /** The style property {@code grid-column-end}. */ - GRID_COLUMN_END_("grid-column-end", "grid-column-end", ff52up("auto")), + GRID_COLUMN_END_("grid-column-end", "grid-column-end", ff("auto")), /** The style property {@code gridColumnGap}. */ - GRID_COLUMN_GAP("gridColumnGap", "grid-column-gap", chrome("normal"), ff52up("0px")), + GRID_COLUMN_GAP("gridColumnGap", "grid-column-gap", chrome("normal"), ffBelow68("0px"), ff68up("normal")), /** The style property {@code grid-column-gap}. */ - GRID_COLUMN_GAP_("grid-column-gap", "grid-column-gap", ff52up("0px")), + GRID_COLUMN_GAP_("grid-column-gap", "grid-column-gap", ffBelow68("0px"), ff68up("normal")), /** The style property {@code gridColumnStart}. */ - GRID_COLUMN_START("gridColumnStart", "grid-column-start", chrome("auto"), ff52up("auto")), + GRID_COLUMN_START("gridColumnStart", "grid-column-start", chrome("auto"), ff("auto")), /** The style property {@code grid-column-start}. */ - GRID_COLUMN_START_("grid-column-start", "grid-column-start", ff52up("auto")), + GRID_COLUMN_START_("grid-column-start", "grid-column-start", ff("auto")), /** The style property {@code gridGap}. */ - GRID_GAP("gridGap", "grid-gap", chrome("normal normal"), ff52up("")), + GRID_GAP("gridGap", "grid-gap", chrome("normal normal"), ff("")), /** The style property {@code grid-gap}. */ - GRID_GAP_("grid-gap", "grid-gap", ff52up("")), + GRID_GAP_("grid-gap", "grid-gap", ff("")), /** The style property {@code gridRow}. */ - GRID_ROW("gridRow", "grid-row", chrome("auto / auto"), ff52up("")), + GRID_ROW("gridRow", "grid-row", chrome("auto / auto"), ff("")), /** The style property {@code grid-row}. */ - GRID_ROW_("grid-row", "grid-row", ff52up("")), + GRID_ROW_("grid-row", "grid-row", ff("")), /** The style property {@code gridRowEnd}. */ - GRID_ROW_END("gridRowEnd", "grid-row-end", chrome("auto"), ff52up("auto")), + GRID_ROW_END("gridRowEnd", "grid-row-end", chrome("auto"), ff("auto")), /** The style property {@code grid-row-end}. */ - GRID_ROW_END_("grid-row-end", "grid-row-end", ff52up("auto")), + GRID_ROW_END_("grid-row-end", "grid-row-end", ff("auto")), /** The style property {@code gridRowGap}. */ - GRID_ROW_GAP("gridRowGap", "grid-row-gap", chrome("normal"), ff52up("0px")), + GRID_ROW_GAP("gridRowGap", "grid-row-gap", chrome("normal"), ffBelow68("0px"), ff68up("normal")), /** The style property {@code grid-row-gap}. */ - GRID_ROW_GAP_("grid-row-gap", "grid-row-gap", ff52up("0px")), + GRID_ROW_GAP_("grid-row-gap", "grid-row-gap", ffBelow68("0px"), ff68up("normal")), /** The style property {@code gridRowStart}. */ - GRID_ROW_START("gridRowStart", "grid-row-start", chrome("auto"), ff52up("auto")), + GRID_ROW_START("gridRowStart", "grid-row-start", chrome("auto"), ff("auto")), /** The style property {@code grid-row-start}. */ - GRID_ROW_START_("grid-row-start", "grid-row-start", ff52up("auto")), + GRID_ROW_START_("grid-row-start", "grid-row-start", ff("auto")), /** The style property {@code gridTemplate}. */ - GRID_TEMPLATE("gridTemplate", "grid-template", chrome("none / none / none"), ff52up("")), + GRID_TEMPLATE("gridTemplate", "grid-template", chrome("none / none / none"), ff("")), /** The style property {@code grid-template}. */ - GRID_TEMPLATE_("grid-template", "grid-template", ff52up("")), + GRID_TEMPLATE_("grid-template", "grid-template", ff("")), /** The style property {@code gridTemplateAreas}. */ - GRID_TEMPLATE_AREAS("gridTemplateAreas", "grid-template-areas", chrome("none"), ff52up("none")), + GRID_TEMPLATE_AREAS("gridTemplateAreas", "grid-template-areas", chrome("none"), + ff("none")), /** The style property {@code grid-template-areas}. */ - GRID_TEMPLATE_AREAS_("grid-template-areas", "grid-template-areas", ff52up("none")), + GRID_TEMPLATE_AREAS_("grid-template-areas", "grid-template-areas", + ff("none")), /** The style property {@code gridTemplateColumns}. */ - GRID_TEMPLATE_COLUMNS("gridTemplateColumns", "grid-template-columns", chrome("none"), ff52up("none")), + GRID_TEMPLATE_COLUMNS("gridTemplateColumns", "grid-template-columns", chrome("none"), ff("none")), /** The style property {@code grid-template-columns}. */ - GRID_TEMPLATE_COLUMNS_("grid-template-columns", "grid-template-columns", ff52up("none")), + GRID_TEMPLATE_COLUMNS_("grid-template-columns", "grid-template-columns", ff("none")), /** The style property {@code gridTemplateRows}. */ - GRID_TEMPLATE_ROWS("gridTemplateRows", "grid-template-rows", chrome("none"), ff52up("none")), + GRID_TEMPLATE_ROWS("gridTemplateRows", "grid-template-rows", chrome("none"), ff("none")), /** The style property {@code grid-template-rows}. */ - GRID_TEMPLATE_ROWS_("grid-template-rows", "grid-template-rows", ff52up("none")), + GRID_TEMPLATE_ROWS_("grid-template-rows", "grid-template-rows", ff("none")), /** The style property {@code height}. */ HEIGHT("height", "height", chrome(""), ff(""), ie("")), @@ -1099,10 +1226,10 @@ public enum Definition { HYPHENS("hyphens", "hyphens", ff("manual"), chrome("manual")), /** The style property {@code imageOrientation}. */ - IMAGE_ORIENTATION("imageOrientation", "image-orientation", ff("0deg")), + IMAGE_ORIENTATION("imageOrientation", "image-orientation", ffBelow68("0deg"), ff68up("none")), /** The style property {@code image-orientation}. */ - IMAGE_ORIENTATION_("image-orientation", "image-orientation", ff("0deg")), + IMAGE_ORIENTATION_("image-orientation", "image-orientation", ffBelow68("0deg"), ff68up("none")), /** The style property {@code imageRendering}. */ IMAGE_RENDERING("imageRendering", "image-rendering", ff("auto"), chrome("auto")), @@ -1117,33 +1244,72 @@ public enum Definition { IME_MODE_("ime-mode", "ime-mode", ff("auto")), /** The style property {@code inlineSize}. */ - INLINE_SIZE("inlineSize", "inline-size", ff(""), chrome("913px")), + INLINE_SIZE("inlineSize", "inline-size", ffBelow68(""), ff68up("1242px"), chrome("913px")), /** The style property {@code inline-size}. */ - INLINE_SIZE_("inline-size", "inline-size", ff("")), + INLINE_SIZE_("inline-size", "inline-size", ffBelow68(""), ff68up("1242px")), + + /** The style property {@code inset}. */ + INSET("inset", "inset", ff68up("")), + + /** The style property {@code insetBlock}. */ + INSET_BLOCK("insetBlock", "inset-block", ff68up("")), + + /** The style property {@code inset-block}. */ + INSET_BLOCK_("inset-block", "inset-block", ff68up("")), + + /** The style property {@code insetBlockEnd}. */ + INSET_BLOCK_END("insetBlockEnd", "inset-block-end", ff68up("auto")), + + /** The style property {@code inset-block-end}. */ + INSET_BLOCK_END_("inset-block-end", "inset-block-end", ff68up("auto")), + + /** The style property {@code insetBlockStart}. */ + INSET_BLOCK_START("insetBlockStart", "inset-block-start", ff68up("auto")), + + /** The style property {@code inset-block-start}. */ + INSET_BLOCK_START_("inset-block-start", "inset-block-start", ff68up("auto")), + + /** The style property {@code insetInline}. */ + INSET_INLINE("insetInline", "inset-inline", ff68up("")), + + /** The style property {@code inset-inline}. */ + INSET_INLINE_("inset-inline", "inset-inline", ff68up("")), + + /** The style property {@code insetInlineEnd}. */ + INSET_INLINE_END("insetInlineEnd", "inset-inline-end", ff68up("auto")), + + /** The style property {@code inset-inline-end}. */ + INSET_INLINE_END_("inset-inline-end", "inset-inline-end", ff68up("auto")), + + /** The style property {@code insetInlineStart}. */ + INSET_INLINE_START("insetInlineStart", "inset-inline-start", ff68up("auto")), + + /** The style property {@code inset-inline-start}. */ + INSET_INLINE_START_("inset-inline-start", "inset-inline-start", ff68up("auto")), /** The style property {@code isolation}. */ ISOLATION("isolation", "isolation", ff("auto"), chrome("auto")), /** The style property {@code justifyContent}. */ JUSTIFY_CONTENT("justifyContent", "justify-content", - ffBelow52("auto"), ff52up("normal"), + ff("normal"), ie("flex-start"), chrome("normal")), /** The style property {@code justify-content}. */ - JUSTIFY_CONTENT_("justify-content", "justify-content", ffBelow52("auto"), ff52up("normal")), + JUSTIFY_CONTENT_("justify-content", "justify-content", ff("normal")), /** The style property {@code justifyItems}. */ - JUSTIFY_ITEMS("justifyItems", "justify-items", ffBelow52("start"), ff52up("normal"), chrome("normal")), + JUSTIFY_ITEMS("justifyItems", "justify-items", ff("normal"), chrome("normal")), /** The style property {@code justify-items}. */ - JUSTIFY_ITEMS_("justify-items", "justify-items", ffBelow52("start"), ff52up("normal")), + JUSTIFY_ITEMS_("justify-items", "justify-items", ff("normal")), /** The style property {@code justifySelf}. */ - JUSTIFY_SELF("justifySelf", "justify-self", ffBelow52("start"), ff52up("auto"), chrome("auto")), + JUSTIFY_SELF("justifySelf", "justify-self", ff("auto"), chrome("auto")), /** The style property {@code justify-self}. */ - JUSTIFY_SELF_("justify-self", "justify-self", ffBelow52("start"), ff52up("auto")), + JUSTIFY_SELF_("justify-self", "justify-self", ff("auto")), /** The style property {@code kerning}. */ KERNING("kerning", "kerning", ie("auto")), @@ -1186,13 +1352,14 @@ public enum Definition { LINE_BREAK("lineBreak", "line-break", ie("undefined"), chrome("auto")), /** The style property {@code lineHeight}. */ - LINE_HEIGHT("lineHeight", "line-height", ff("20px"), ie("normal"), chrome("normal")), + LINE_HEIGHT("lineHeight", "line-height", ffBelow68("20px"), ff68up("18px"), + ie("normal"), chrome("normal")), /** The style property {@code line-height}. */ - LINE_HEIGHT_("line-height", "line-height", ff("20px")), + LINE_HEIGHT_("line-height", "line-height", ffBelow68("20px"), ff68up("18px")), /** The style property {@code listStyle}. */ - LIST_STYLE("listStyle", "list-style", chrome("disc outside none"), ff(""), ie("")), + LIST_STYLE("listStyle", "list-style", chrome("outside none disc"), ff(""), ie("")), /** The style property {@code list-style}. */ LIST_STYLE_("list-style", "list-style", ff("")), @@ -1219,17 +1386,23 @@ public enum Definition { /** The style property {@code margin}. */ MARGIN("margin", "margin", chrome("0px"), ff(""), ie("")), + /** The style property {@code marginBlock}. */ + MARGIN_BLOCK("marginBlock", "margin-block", ff68up("")), + + /** The style property {@code margin-block}. */ + MARGIN_BLOCK_("margin-block", "margin-block", ff68up("")), + /** The style property {@code marginBlockEnd}. */ - MARGIN_BLOCK_END("marginBlockEnd", "margin-block-end", ff("")), + MARGIN_BLOCK_END("marginBlockEnd", "margin-block-end", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code margin-block-end}. */ - MARGIN_BLOCK_END_("margin-block-end", "margin-block-end", ff("")), + MARGIN_BLOCK_END_("margin-block-end", "margin-block-end", ffBelow68(""), ff68up("0px")), /** The style property {@code marginBlockStart}. */ - MARGIN_BLOCK_START("marginBlockStart", "margin-block-start", ff("")), + MARGIN_BLOCK_START("marginBlockStart", "margin-block-start", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code margin-block-start}. */ - MARGIN_BLOCK_START_("margin-block-start", "margin-block-start", ff("")), + MARGIN_BLOCK_START_("margin-block-start", "margin-block-start", ffBelow68(""), ff68up("0px")), /** The style property {@code marginBottom}. */ MARGIN_BOTTOM("marginBottom", "margin-bottom", chrome("0px"), ff(""), ie("")), @@ -1237,17 +1410,23 @@ public enum Definition { /** The style property {@code margin-bottom}. */ MARGIN_BOTTOM_("margin-bottom", "margin-bottom", ff("0px")), + /** The style property {@code marginInline}. */ + MARGIN_INLINE("marginInline", "margin-inline", ff68up("")), + + /** The style property {@code margin-inline}. */ + MARGIN_INLINE_("margin-inline", "margin-inline", ff68up("")), + /** The style property {@code marginInlineEnd}. */ - MARGIN_INLINE_END("marginInlineEnd", "margin-inline-end", ff("")), + MARGIN_INLINE_END("marginInlineEnd", "margin-inline-end", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code margin-inline-end}. */ - MARGIN_INLINE_END_("margin-inline-end", "margin-inline-end", ff("")), + MARGIN_INLINE_END_("margin-inline-end", "margin-inline-end", ffBelow68(""), ff68up("0px")), /** The style property {@code marginInlineStart}. */ - MARGIN_INLINE_START("marginInlineStart", "margin-inline-start", ff("")), + MARGIN_INLINE_START("marginInlineStart", "margin-inline-start", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code margin-inline-start}. */ - MARGIN_INLINE_START_("margin-inline-start", "margin-inline-start", ff("")), + MARGIN_INLINE_START_("margin-inline-start", "margin-inline-start", ffBelow68(""), ff68up("0px")), /** The style property {@code marginLeft}. */ MARGIN_LEFT("marginLeft", "margin-left", chrome("0px"), ff(""), ie("")), @@ -1268,7 +1447,7 @@ public enum Definition { MARGIN_TOP_("margin-top", "margin-top", ff("0px")), /** The style property {@code marker}. */ - MARKER("marker", "marker", ff(""), ie("none"), chrome("")), + MARKER("marker", "marker", ff(""), ie("none"), chrome("none")), /** The style property {@code markerEnd}. */ MARKER_END("markerEnd", "marker-end", ff("none"), ie("none"), chrome("none")), @@ -1283,10 +1462,10 @@ public enum Definition { MARKER_MID_("marker-mid", "marker-mid", ff("none")), /** The style property {@code markerOffset}. */ - MARKER_OFFSET("markerOffset", "marker-offset", ffBelow52("auto")), + MARKER_OFFSET("markerOffset", "marker-offset"), /** The style property {@code marker-offset}. */ - MARKER_OFFSET_("marker-offset", "marker-offset", ffBelow52("auto")), + MARKER_OFFSET_("marker-offset", "marker-offset"), /** The style property {@code markerStart}. */ MARKER_START("markerStart", "marker-start", ff("none"), ie("none"), chrome("none")), @@ -1297,6 +1476,66 @@ public enum Definition { /** The style property {@code mask}. */ MASK("mask", "mask", ff("none"), ie("none"), chrome("none")), + /** The style property {@code maskClip}. */ + MASK_CLIP("maskClip", "mask-clip", ff("border-box")), + + /** The style property {@code mask-clip}. */ + MASK_CLIP_("mask-clip", "mask-clip", ff("border-box")), + + /** The style property {@code maskComposite}. */ + MASK_COMPOSITE("maskComposite", "mask-composite", ff("add")), + + /** The style property {@code mask-composite}. */ + MASK_COMPOSITE_("mask-composite", "mask-composite", ff("add")), + + /** The style property {@code maskImage}. */ + MASK_IMAGE("maskImage", "mask-image", ff("none")), + + /** The style property {@code mask-image}. */ + MASK_IMAGE_("mask-image", "mask-image", ff("none")), + + /** The style property {@code maskMode}. */ + MASK_MODE("maskMode", "mask-mode", ff("match-source")), + + /** The style property {@code mask-mode}. */ + MASK_MODE_("mask-mode", "mask-mode", ff("match-source")), + + /** The style property {@code maskOrigin}. */ + MASK_ORIGIN("maskOrigin", "mask-origin", ff("border-box")), + + /** The style property {@code mask-origin}. */ + MASK_ORIGIN_("mask-origin", "mask-origin", ff("border-box")), + + /** The style property {@code maskPosition}. */ + MASK_POSITION("maskPosition", "mask-position", ff("0% 0%")), + + /** The style property {@code mask-position}. */ + MASK_POSITION_("mask-position", "mask-position", ff("0% 0%")), + + /** The style property {@code maskPositionX}. */ + MASK_POSITION_X("maskPositionX", "mask-position-x", ff("0%")), + + /** The style property {@code mask-position-x}. */ + MASK_POSITION_X_("mask-position-x", "mask-position-x", ff("0%")), + + /** The style property {@code maskPositionY}. */ + MASK_POSITION_Y("maskPositionY", "mask-position-y", ff("0%")), + + /** The style property {@code mask-position-y}. */ + MASK_POSITION_Y_("mask-position-y", "mask-position-y", ff("0%")), + + /** The style property {@code maskRepeat}. */ + MASK_REPEAT("maskRepeat", "mask-repeat", ff("repeat")), + + /** The style property {@code mask-repeat}. */ + MASK_REPEAT_("mask-repeat", "mask-repeat", ff("repeat")), + + /** The style property {@code maskSize}. */ + MASK_SIZE("maskSize", "mask-size", ffBelow68("auto auto"), ff68up("auto")), + + /** The style property {@code mask-size}. */ + MASK_SIZE_("mask-size", "mask-size", ffBelow68("auto auto"), ff68up("auto")), + /** The style property {@code maskType}. */ MASK_TYPE("maskType", "mask-type", ff("luminance"), chrome("luminance")), @@ -1304,10 +1543,10 @@ public enum Definition { MASK_TYPE_("mask-type", "mask-type", ff("luminance")), /** The style property {@code maxBlockSize}. */ - MAX_BLOCK_SIZE("maxBlockSize", "max-block-size", ff(""), chrome("none")), + MAX_BLOCK_SIZE("maxBlockSize", "max-block-size", ffBelow68(""), ff68up("none"), chrome("none")), /** The style property {@code max-block-size}. */ - MAX_BLOCK_SIZE_("max-block-size", "max-block-size", ff("")), + MAX_BLOCK_SIZE_("max-block-size", "max-block-size", ffBelow68(""), ff68up("none")), /** The style property {@code maxHeight}. */ MAX_HEIGHT("maxHeight", "max-height", chrome("none"), ff(""), ie("")), @@ -1316,10 +1555,10 @@ public enum Definition { MAX_HEIGHT_("max-height", "max-height", ff("none")), /** The style property {@code maxInlineSize}. */ - MAX_INLINE_SIZE("maxInlineSize", "max-inline-size", ff(""), chrome("none")), + MAX_INLINE_SIZE("maxInlineSize", "max-inline-size", ffBelow68(""), ff68up("none"), chrome("none")), /** The style property {@code max-inline-size}. */ - MAX_INLINE_SIZE_("max-inline-size", "max-inline-size", ff("")), + MAX_INLINE_SIZE_("max-inline-size", "max-inline-size", ffBelow68(""), ff68up("none")), /** The style property {@code maxWidth}. */ MAX_WIDTH("maxWidth", "max-width", chrome("none"), ff(""), ie("")), @@ -1331,10 +1570,10 @@ public enum Definition { MAX_ZOOM("maxZoom", "max-zoom", chrome("")), /** The style property {@code minBlockSize}. */ - MIN_BLOCK_SIZE("minBlockSize", "min-block-size", ff(""), chrome("0px")), + MIN_BLOCK_SIZE("minBlockSize", "min-block-size", ffBelow68(""), ff68up("0px"), chrome("0px")), /** The style property {@code min-block-size}. */ - MIN_BLOCK_SIZE_("min-block-size", "min-block-size", ff("")), + MIN_BLOCK_SIZE_("min-block-size", "min-block-size", ffBelow68(""), ff68up("0px")), /** The style property {@code minHeight}. */ MIN_HEIGHT("minHeight", "min-height", chrome("0px"), ff(""), ie("")), @@ -1343,10 +1582,10 @@ public enum Definition { MIN_HEIGHT_("min-height", "min-height", ff("0px")), /** The style property {@code minInlineSize}. */ - MIN_INLINE_SIZE("minInlineSize", "min-inline-size", ff(""), chrome("0px")), + MIN_INLINE_SIZE("minInlineSize", "min-inline-size", ffBelow68(""), ff68up("0px"), chrome("0px")), /** The style property {@code min-inline-size}. */ - MIN_INLINE_SIZE_("min-inline-size", "min-inline-size", ff("")), + MIN_INLINE_SIZE_("min-inline-size", "min-inline-size", ffBelow68(""), ff68up("0px")), /** The style property {@code minWidth}. */ MIN_WIDTH("minWidth", "min-width", chrome("0px"), ff(""), ie("")), @@ -1367,50 +1606,50 @@ public enum Definition { MOZ_ANIMATION("MozAnimation", "-moz-animation", ff("")), /** The style property {@code -moz-animation}. */ - MOZ_ANIMATION__("-moz-animation", "-moz-animation", ff52up("")), + MOZ_ANIMATION__("-moz-animation", "-moz-animation", ff("")), /** The style property {@code MozAnimationDelay}. */ MOZ_ANIMATION_DELAY("MozAnimationDelay", "-moz-animation-delay", ff("0s")), /** The style property {@code -moz-animation-delay}. */ - MOZ_ANIMATION_DELAY__("-moz-animation-delay", "-moz-animation-delay", ff52up("0s")), + MOZ_ANIMATION_DELAY__("-moz-animation-delay", "-moz-animation-delay", ff("0s")), /** The style property {@code MozAnimationDirection}. */ MOZ_ANIMATION_DIRECTION("MozAnimationDirection", "-moz-animation-direction", ff("normal")), /** The style property {@code -moz-animation-direction}. */ - MOZ_ANIMATION_DIRECTION__("-moz-animation-direction", "-moz-animation-direction", ff52up("normal")), + MOZ_ANIMATION_DIRECTION__("-moz-animation-direction", "-moz-animation-direction", ff("normal")), /** The style property {@code MozAnimationDuration}. */ MOZ_ANIMATION_DURATION("MozAnimationDuration", "-moz-animation-duration", ff("0s")), /** The style property {@code -moz-animation-duration}. */ - MOZ_ANIMATION_DURATION__("-moz-animation-duration", "-moz-animation-duration", ff52up("0s")), + MOZ_ANIMATION_DURATION__("-moz-animation-duration", "-moz-animation-duration", ff("0s")), /** The style property {@code MozAnimationFillMode}. */ MOZ_ANIMATION_FILL_MODE("MozAnimationFillMode", "-moz-animation-fill-mode", ff("none")), /** The style property {@code -moz-animation-fill-mode}. */ - MOZ_ANIMATION_FILL_MODE__("-moz-animation-fill-mode", "-moz-animation-fill-mode", ff52up("none")), + MOZ_ANIMATION_FILL_MODE__("-moz-animation-fill-mode", "-moz-animation-fill-mode", ff("none")), /** The style property {@code MozAnimationIterationCount}. */ MOZ_ANIMATION_ITERATION_COUNT("MozAnimationIterationCount", "-moz-animation-iteration-count", ff("1")), /** The style property {@code -moz-animation-iteration-count}. */ MOZ_ANIMATION_ITERATION_COUNT__("-moz-animation-iteration-count", "-moz-animation-iteration-count", - ff52up("1")), + ff("1")), /** The style property {@code MozAnimationName}. */ MOZ_ANIMATION_NAME("MozAnimationName", "-moz-animation-name", ff("none")), /** The style property {@code -moz-animation-name}. */ - MOZ_ANIMATION_NAME__("-moz-animation-name", "-moz-animation-name", ff52up("none")), + MOZ_ANIMATION_NAME__("-moz-animation-name", "-moz-animation-name", ff("none")), /** The style property {@code MozAnimationPlayState}. */ MOZ_ANIMATION_PLAY_STATE("MozAnimationPlayState", "-moz-animation-play-state", ff("running")), /** The style property {@code -moz-animation-play-state}. */ - MOZ_ANIMATION_PLAY_STATE__("-moz-animation-play-state", "-moz-animation-play-state", ff52up("running")), + MOZ_ANIMATION_PLAY_STATE__("-moz-animation-play-state", "-moz-animation-play-state", ff("running")), /** The style property {@code MozAnimationTimingFunction}. */ MOZ_ANIMATION_TIMING_FUNCTION("MozAnimationTimingFunction", "-moz-animation-timing-function", @@ -1418,19 +1657,19 @@ public enum Definition { /** The style property {@code -moz-animation-timing-function}. */ MOZ_ANIMATION_TIMING_FUNCTION__("-moz-animation-timing-function", "-moz-animation-timing-function", - ff52up("ease")), + ff("ease")), /** The style property {@code MozAppearance}. */ MOZ_APPEARANCE("MozAppearance", "-moz-appearance", ff("none")), /** The style property {@code -moz-appearance}. */ - MOZ_APPEARANCE__("-moz-appearance", "-moz-appearance", ff52up("none")), + MOZ_APPEARANCE__("-moz-appearance", "-moz-appearance", ff("none")), /** The style property {@code MozBackfaceVisibility}. */ MOZ_BACKFACE_VISIBILITY("MozBackfaceVisibility", "-moz-backface-visibility", ff("visible")), /** The style property {@code -moz-backface-visibility}. */ - MOZ_BACKFACE_VISIBILITY__("-moz-backface-visibility", "-moz-backface-visibility", ff52up("visible")), + MOZ_BACKFACE_VISIBILITY__("-moz-backface-visibility", "-moz-backface-visibility", ff("visible")), /** The style property {@code MozBackgroundClip}. */ MOZ_BACKGROUND_CLIP("MozBackgroundClip", "-moz-background-clip"), @@ -1442,53 +1681,56 @@ public enum Definition { MOZ_BACKGROUND_SIZE("MozBackgroundSize", "-moz-background-size"), /** The style property {@code MozBinding}. */ - MOZ_BINDING("MozBinding", "-moz-binding", ff("none")), + MOZ_BINDING("MozBinding", "-moz-binding", ffBelow68("none")), /** The style property {@code -moz-binding}. */ - MOZ_BINDING__("-moz-binding", "-moz-binding", ff52up("none")), + MOZ_BINDING__("-moz-binding", "-moz-binding", ffBelow68("none")), /** The style property {@code MozBorderBottomColors}. */ - MOZ_BORDER_BOTTOM_COLORS("MozBorderBottomColors", "-moz-border-bottom-colors", ff("none")), + MOZ_BORDER_BOTTOM_COLORS("MozBorderBottomColors", "-moz-border-bottom-colors", + ff("none").setIteratable(false)), /** The style property {@code -moz-border-bottom-colors}. */ MOZ_BORDER_BOTTOM_COLORS__("-moz-border-bottom-colors", "-moz-border-bottom-colors", - ff52up("none")), + ff("none").setIteratable(false)), /** The style property {@code MozBorderEnd}. */ MOZ_BORDER_END("MozBorderEnd", "-moz-border-end", ff("")), /** The style property {@code -moz-border-end}. */ - MOZ_BORDER_END__("-moz-border-end", "-moz-border-end", ff52up("")), + MOZ_BORDER_END__("-moz-border-end", "-moz-border-end", ff("")), /** The style property {@code MozBorderEndColor}. */ - MOZ_BORDER_END_COLOR("MozBorderEndColor", "-moz-border-end-color", ff("")), + MOZ_BORDER_END_COLOR("MozBorderEndColor", "-moz-border-end-color", ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code -moz-border-end-color}. */ - MOZ_BORDER_END_COLOR__("-moz-border-end-color", "-moz-border-end-color", ff52up("")), + MOZ_BORDER_END_COLOR__("-moz-border-end-color", "-moz-border-end-color", ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code MozBorderEndStyle}. */ - MOZ_BORDER_END_STYLE("MozBorderEndStyle", "-moz-border-end-style", ff("")), + MOZ_BORDER_END_STYLE("MozBorderEndStyle", "-moz-border-end-style", ffBelow68(""), ff68up("none")), /** The style property {@code -moz-border-end-style}. */ - MOZ_BORDER_END_STYLE__("-moz-border-end-style", "-moz-border-end-style", ff52up("")), + MOZ_BORDER_END_STYLE__("-moz-border-end-style", "-moz-border-end-style", ffBelow68(""), ff68up("none")), /** The style property {@code MozBorderEndWidth}. */ - MOZ_BORDER_END_WIDTH("MozBorderEndWidth", "-moz-border-end-width", ff("")), + MOZ_BORDER_END_WIDTH("MozBorderEndWidth", "-moz-border-end-width", ffBelow68(""), ff68up("0px")), /** The style property {@code -moz-border-end-width}. */ - MOZ_BORDER_END_WIDTH__("-moz-border-end-width", "-moz-border-end-width", ff52up("")), + MOZ_BORDER_END_WIDTH__("-moz-border-end-width", "-moz-border-end-width", ffBelow68(""), ff68up("0px")), /** The style property {@code MozBorderImage}. */ MOZ_BORDER_IMAGE("MozBorderImage", "-moz-border-image", ff("")), /** The style property {@code -moz-border-image}. */ - MOZ_BORDER_IMAGE__("-moz-border-image", "-moz-border-image", ff52up("")), + MOZ_BORDER_IMAGE__("-moz-border-image", "-moz-border-image", ff("")), /** The style property {@code MozBorderLeftColors}. */ - MOZ_BORDER_LEFT_COLORS("MozBorderLeftColors", "-moz-border-left-colors", ff("none")), + MOZ_BORDER_LEFT_COLORS("MozBorderLeftColors", "-moz-border-left-colors", + ff("none").setIteratable(false)), /** The style property {@code -moz-border-left-colors}. */ - MOZ_BORDER_LEFT_COLORS__("-moz-border-left-colors", "-moz-border-left-colors", ff52up("none")), + MOZ_BORDER_LEFT_COLORS__("-moz-border-left-colors", "-moz-border-left-colors", + ff("none").setIteratable(false)), /** The style property {@code MozBorderRadius}. */ MOZ_BORDER_RADIUS("MozBorderRadius", "-moz-border-radius"), @@ -1506,76 +1748,81 @@ public enum Definition { MOZ_BORDER_RADIUS_TOPRIGHT("MozBorderRadiusTopright", "-moz-border-radius-topright"), /** The style property {@code MozBorderRightColors}. */ - MOZ_BORDER_RIGHT_COLORS("MozBorderRightColors", "-moz-border-right-colors", ff("none")), + MOZ_BORDER_RIGHT_COLORS("MozBorderRightColors", "-moz-border-right-colors", + ff("none").setIteratable(false)), /** The style property {@code -moz-border-right-colors}. */ - MOZ_BORDER_RIGHT_COLORS__("-moz-border-right-colors", "-moz-border-right-colors", ff52up("none")), + MOZ_BORDER_RIGHT_COLORS__("-moz-border-right-colors", "-moz-border-right-colors", + ff("none").setIteratable(false)), /** The style property {@code MozBorderStart}. */ MOZ_BORDER_START("MozBorderStart", "-moz-border-start", ff("")), /** The style property {@code -moz-border-start}. */ - MOZ_BORDER_START__("-moz-border-start", "-moz-border-start", ff52up("")), + MOZ_BORDER_START__("-moz-border-start", "-moz-border-start", ff("")), /** The style property {@code MozBorderStartColor}. */ - MOZ_BORDER_START_COLOR("MozBorderStartColor", "-moz-border-start-color", ff("")), + MOZ_BORDER_START_COLOR("MozBorderStartColor", "-moz-border-start-color", ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code -moz-border-start-color}. */ - MOZ_BORDER_START_COLOR__("-moz-border-start-color", "-moz-border-start-color", ff52up("")), + MOZ_BORDER_START_COLOR__("-moz-border-start-color", "-moz-border-start-color", + ffBelow68(""), ff68up("rgb(0, 0, 0)")), /** The style property {@code MozBorderStartStyle}. */ - MOZ_BORDER_START_STYLE("MozBorderStartStyle", "-moz-border-start-style", ff("")), + MOZ_BORDER_START_STYLE("MozBorderStartStyle", "-moz-border-start-style", ffBelow68(""), ff68up("none")), /** The style property {@code -moz-border-start-style}. */ - MOZ_BORDER_START_STYLE__("-moz-border-start-style", "-moz-border-start-style", ff52up("")), + MOZ_BORDER_START_STYLE__("-moz-border-start-style", "-moz-border-start-style", ffBelow68(""), ff68up("none")), /** The style property {@code MozBorderStartWidth}. */ - MOZ_BORDER_START_WIDTH("MozBorderStartWidth", "-moz-border-start-width", ff("")), + MOZ_BORDER_START_WIDTH("MozBorderStartWidth", "-moz-border-start-width", ffBelow68(""), ff68up("0px")), /** The style property {@code -moz-border-start-width}. */ - MOZ_BORDER_START_WIDTH__("-moz-border-start-width", "-moz-border-start-width", ff52up("")), + MOZ_BORDER_START_WIDTH__("-moz-border-start-width", "-moz-border-start-width", ffBelow68(""), ff68up("0px")), /** The style property {@code MozBorderTopColors}. */ - MOZ_BORDER_TOP_COLORS("MozBorderTopColors", "-moz-border-top-colors", ff("none")), + MOZ_BORDER_TOP_COLORS("MozBorderTopColors", "-moz-border-top-colors", + ff("none").setIteratable(false)), /** The style property {@code -moz-border-top-colors}. */ - MOZ_BORDER_TOP_COLORS__("-moz-border-top-colors", "-moz-border-top-colors", ff52up("none")), + MOZ_BORDER_TOP_COLORS__("-moz-border-top-colors", "-moz-border-top-colors", + ff("none").setIteratable(false)), /** The style property {@code MozBoxAlign}. */ MOZ_BOX_ALIGN("MozBoxAlign", "-moz-box-align", ff("stretch")), /** The style property {@code -moz-box-align}. */ - MOZ_BOX_ALIGN__("-moz-box-align", "-moz-box-align", ff52up("stretch")), + MOZ_BOX_ALIGN__("-moz-box-align", "-moz-box-align", ff("stretch")), /** The style property {@code MozBoxDirection}. */ MOZ_BOX_DIRECTION("MozBoxDirection", "-moz-box-direction", ff("normal")), /** The style property {@code -moz-box-direction}. */ - MOZ_BOX_DIRECTION__("-moz-box-direction", "-moz-box-direction", ff52up("normal")), + MOZ_BOX_DIRECTION__("-moz-box-direction", "-moz-box-direction", ff("normal")), /** The style property {@code MozBoxFlex}. */ MOZ_BOX_FLEX("MozBoxFlex", "-moz-box-flex", ff("0")), /** The style property {@code -moz-box-flex}. */ - MOZ_BOX_FLEX__("-moz-box-flex", "-moz-box-flex", ff52up("0")), + MOZ_BOX_FLEX__("-moz-box-flex", "-moz-box-flex", ff("0")), /** The style property {@code MozBoxOrdinalGroup}. */ MOZ_BOX_ORDINAL_GROUP("MozBoxOrdinalGroup", "-moz-box-ordinal-group", ff("1")), /** The style property {@code -moz-box-ordinal-group}. */ - MOZ_BOX_ORDINAL_GROUP__("-moz-box-ordinal-group", "-moz-box-ordinal-group", ff52up("1")), + MOZ_BOX_ORDINAL_GROUP__("-moz-box-ordinal-group", "-moz-box-ordinal-group", ff("1")), /** The style property {@code MozBoxOrient}. */ MOZ_BOX_ORIENT("MozBoxOrient", "-moz-box-orient", ff("horizontal")), /** The style property {@code -moz-box-orient}. */ - MOZ_BOX_ORIENT__("-moz-box-orient", "-moz-box-orient", ff52up("horizontal")), + MOZ_BOX_ORIENT__("-moz-box-orient", "-moz-box-orient", ff("horizontal")), /** The style property {@code MozBoxPack}. */ MOZ_BOX_PACK("MozBoxPack", "-moz-box-pack", ff("start")), /** The style property {@code -moz-box-pack}. */ - MOZ_BOX_PACK__("-moz-box-pack", "-moz-box-pack", ff52up("start")), + MOZ_BOX_PACK__("-moz-box-pack", "-moz-box-pack", ff("start")), /** The style property {@code MozBoxShadow}. */ MOZ_BOX_SHADOW("MozBoxShadow", "-moz-box-shadow"), @@ -1584,31 +1831,31 @@ public enum Definition { MOZ_BOX_SIZING("MozBoxSizing", "-moz-box-sizing", ff("content-box")), /** The style property {@code -moz-box-sizing}. */ - MOZ_BOX_SIZING__("-moz-box-sizing", "-moz-box-sizing", ff52up("content-box")), + MOZ_BOX_SIZING__("-moz-box-sizing", "-moz-box-sizing", ff("content-box")), /** The style property {@code MozColumnCount}. */ MOZ_COLUMN_COUNT("MozColumnCount", "-moz-column-count", ff("auto")), /** The style property {@code -moz-column-count}. */ - MOZ_COLUMN_COUNT__("-moz-column-count", "-moz-column-count", ff52up("auto")), + MOZ_COLUMN_COUNT__("-moz-column-count", "-moz-column-count", ff("auto")), /** The style property {@code MozColumnFill}. */ MOZ_COLUMN_FILL("MozColumnFill", "-moz-column-fill", ff("balance")), /** The style property {@code -moz-column-fill}. */ - MOZ_COLUMN_FILL__("-moz-column-fill", "-moz-column-fill", ff52up("balance")), + MOZ_COLUMN_FILL__("-moz-column-fill", "-moz-column-fill", ff("balance")), /** The style property {@code MozColumnGap}. */ - MOZ_COLUMN_GAP("MozColumnGap", "-moz-column-gap", ff("16px")), + MOZ_COLUMN_GAP("MozColumnGap", "-moz-column-gap", ff("normal")), /** The style property {@code -moz-column-gap}. */ - MOZ_COLUMN_GAP__("-moz-column-gap", "-moz-column-gap", ff52up("16px")), + MOZ_COLUMN_GAP__("-moz-column-gap", "-moz-column-gap", ff("normal")), /** The style property {@code MozColumnRule}. */ MOZ_COLUMN_RULE("MozColumnRule", "-moz-column-rule", ff("")), /** The style property {@code -moz-column-rule}. */ - MOZ_COLUMN_RULE__("-moz-column-rule", "-moz-column-rule", ff52up("")), + MOZ_COLUMN_RULE__("-moz-column-rule", "-moz-column-rule", ff("")), /** The style property {@code MozColumnRuleColor}. */ MOZ_COLUMN_RULE_COLOR("MozColumnRuleColor", "-moz-column-rule-color", @@ -1616,7 +1863,7 @@ public enum Definition { /** The style property {@code -moz-column-rule-color}. */ MOZ_COLUMN_RULE_COLOR__("-moz-column-rule-color", "-moz-column-rule-color", - ff52up("rgb(0, 0, 0)")), + ff("rgb(0, 0, 0)")), /** The style property {@code MozColumnRuleStyle}. */ MOZ_COLUMN_RULE_STYLE("MozColumnRuleStyle", "-moz-column-rule-style", @@ -1624,7 +1871,7 @@ public enum Definition { /** The style property {@code -moz-column-rule-style}. */ MOZ_COLUMN_RULE_STYLE__("-moz-column-rule-style", "-moz-column-rule-style", - ff52up("none")), + ff("none")), /** The style property {@code MozColumnRuleWidth}. */ MOZ_COLUMN_RULE_WIDTH("MozColumnRuleWidth", "-moz-column-rule-width", @@ -1632,25 +1879,25 @@ public enum Definition { /** The style property {@code -moz-column-rule-width}. */ MOZ_COLUMN_RULE_WIDTH__("-moz-column-rule-width", "-moz-column-rule-width", - ff52up("0px")), + ff("0px")), /** The style property {@code MozColumnWidth}. */ MOZ_COLUMN_WIDTH("MozColumnWidth", "-moz-column-width", ff("auto")), /** The style property {@code -moz-column-width}. */ - MOZ_COLUMN_WIDTH__("-moz-column-width", "-moz-column-width", ff52up("auto")), + MOZ_COLUMN_WIDTH__("-moz-column-width", "-moz-column-width", ff("auto")), /** The style property {@code MozColumns}. */ MOZ_COLUMNS("MozColumns", "-moz-columns", ff("")), /** The style property {@code -moz-columns}. */ - MOZ_COLUMNS__("-moz-columns", "-moz-columns", ff52up("")), + MOZ_COLUMNS__("-moz-columns", "-moz-columns", ff("")), /** The style property {@code MozFloatEdge}. */ MOZ_FLOAT_EDGE("MozFloatEdge", "-moz-float-edge", ff("content-box")), /** The style property {@code -moz-float-edge}. */ - MOZ_FLOAT_EDGE__("-moz-float-edge", "-moz-float-edge", ff52up("content-box")), + MOZ_FLOAT_EDGE__("-moz-float-edge", "-moz-float-edge", ff("content-box")), /** The style property {@code MozFontFeatureSettings}. */ MOZ_FONT_FEATURE_SETTINGS("MozFontFeatureSettings", "-moz-font-feature-settings", @@ -1658,7 +1905,7 @@ public enum Definition { /** The style property {@code -moz-font-feature-settings}. */ MOZ_FONT_FEATURE_SETTINGS__("-moz-font-feature-settings", "-moz-font-feature-settings", - ff52up("normal")), + ff("normal")), /** The style property {@code MozFontLanguageOverride}. */ MOZ_FONT_LANGUAGE_OVERRIDE("MozFontLanguageOverride", "-moz-font-language-override", @@ -1666,7 +1913,7 @@ public enum Definition { /** The style property {@code -moz-font-language-override}. */ MOZ_FONT_LANGUAGE_OVERRIDE__("-moz-font-language-override", "-moz-font-language-override", - ff52up("normal")), + ff("normal")), /** The style property {@code MozForceBrokenImageIcon}. */ MOZ_FORCE_BROKEN_IMAGE_ICON("MozForceBrokenImageIcon", "-moz-force-broken-image-icon", @@ -1674,31 +1921,31 @@ public enum Definition { /** The style property {@code -moz-force-broken-image-icon}. */ MOZ_FORCE_BROKEN_IMAGE_ICON__("-moz-force-broken-image-icon", "-moz-force-broken-image-icon", - ff52up("0")), + ff("0")), /** The style property {@code MozHyphens}. */ MOZ_HYPHENS("MozHyphens", "-moz-hyphens", ff("manual")), /** The style property {@code -moz-hyphens}. */ - MOZ_HYPHENS__("-moz-hyphens", "-moz-hyphens", ff52up("manual")), + MOZ_HYPHENS__("-moz-hyphens", "-moz-hyphens", ff("manual")), /** The style property {@code MozImageRegion}. */ MOZ_IMAGE_REGION("MozImageRegion", "-moz-image-region", ff("auto")), /** The style property {@code -moz-image-region}. */ - MOZ_IMAGE_REGION__("-moz-image-region", "-moz-image-region", ff52up("auto")), + MOZ_IMAGE_REGION__("-moz-image-region", "-moz-image-region", ff("auto")), /** The style property {@code MozMarginEnd}. */ - MOZ_MARGIN_END("MozMarginEnd", "-moz-margin-end", ff("")), + MOZ_MARGIN_END("MozMarginEnd", "-moz-margin-end", ffBelow68(""), ff68up("0px")), /** The style property {@code -moz-margin-end}. */ - MOZ_MARGIN_END__("-moz-margin-end", "-moz-margin-end", ff52up("")), + MOZ_MARGIN_END__("-moz-margin-end", "-moz-margin-end", ffBelow68(""), ff68up("0px")), /** The style property {@code MozMarginStart}. */ - MOZ_MARGIN_START("MozMarginStart", "-moz-margin-start", ff("")), + MOZ_MARGIN_START("MozMarginStart", "-moz-margin-start", ffBelow68(""), ff68up("0px")), /** The style property {@code -moz-margin-start}. */ - MOZ_MARGIN_START__("-moz-margin-start", "-moz-margin-start", ff52up("")), + MOZ_MARGIN_START__("-moz-margin-start", "-moz-margin-start", ffBelow68(""), ff68up("0px")), /** The style property {@code MozOpacity}. */ MOZ_OPACITY("MozOpacity", "-moz-opacity"), @@ -1707,7 +1954,7 @@ public enum Definition { MOZ_ORIENT("MozOrient", "-moz-orient", ff("inline")), /** The style property {@code -moz-orient}. */ - MOZ_ORIENT__("-moz-orient", "-moz-orient", ff52up("inline")), + MOZ_ORIENT__("-moz-orient", "-moz-orient", ff("inline")), /** The style property {@code MozOutline}. */ MOZ_OUTLINE("MozOutline", "-moz-outline"), @@ -1722,7 +1969,7 @@ public enum Definition { MOZ_OUTLINE_RADIUS("MozOutlineRadius", "-moz-outline-radius", ff("")), /** The style property {@code -moz-outline-radius}. */ - MOZ_OUTLINE_RADIUS__("-moz-outline-radius", "-moz-outline-radius", ff52up("")), + MOZ_OUTLINE_RADIUS__("-moz-outline-radius", "-moz-outline-radius", ff("")), /** The style property {@code MozOutlineRadiusBottomleft}. */ MOZ_OUTLINE_RADIUS_BOTTOMLEFT("MozOutlineRadiusBottomleft", @@ -1730,7 +1977,7 @@ public enum Definition { /** The style property {@code -moz-outline-radius-bottomleft}. */ MOZ_OUTLINE_RADIUS_BOTTOMLEFT__("-moz-outline-radius-bottomleft", - "-moz-outline-radius-bottomleft", ff52up("0px")), + "-moz-outline-radius-bottomleft", ff("0px")), /** The style property {@code MozOutlineRadiusBottomright}. */ MOZ_OUTLINE_RADIUS_BOTTOMRIGHT("MozOutlineRadiusBottomright", @@ -1738,7 +1985,7 @@ public enum Definition { /** The style property {@code -moz-outline-radius-bottomright}. */ MOZ_OUTLINE_RADIUS_BOTTOMRIGHT__("-moz-outline-radius-bottomright", - "-moz-outline-radius-bottomright", ff52up("0px")), + "-moz-outline-radius-bottomright", ff("0px")), /** The style property {@code MozOutlineRadiusTopleft}. */ MOZ_OUTLINE_RADIUS_TOPLEFT("MozOutlineRadiusTopleft", @@ -1746,7 +1993,7 @@ public enum Definition { /** The style property {@code -moz-outline-radius-topleft}. */ MOZ_OUTLINE_RADIUS_TOPLEFT__("-moz-outline-radius-topleft", - "-moz-outline-radius-topleft", ff52up("0px")), + "-moz-outline-radius-topleft", ff("0px")), /** The style property {@code MozOutlineRadiusTopright}. */ MOZ_OUTLINE_RADIUS_TOPRIGHT("MozOutlineRadiusTopright", @@ -1754,7 +2001,7 @@ public enum Definition { /** The style property {@code -moz-outline-radius-topright}. */ MOZ_OUTLINE_RADIUS_TOPRIGHT__("-moz-outline-radius-topright", - "-moz-outline-radius-topright", ff52up("0px")), + "-moz-outline-radius-topright", ff("0px")), /** The style property {@code MozOutlineStyle}. */ MOZ_OUTLINE_STYLE("MozOutlineStyle", "-moz-outline-style"), @@ -1763,50 +2010,50 @@ public enum Definition { MOZ_OUTLINE_WIDTH("MozOutlineWidth", "-moz-outline-width"), /** The style property {@code MozPaddingEnd}. */ - MOZ_PADDING_END("MozPaddingEnd", "-moz-padding-end", ff("")), + MOZ_PADDING_END("MozPaddingEnd", "-moz-padding-end", ffBelow68(""), ff68up("0px")), /** The style property {@code -moz-padding-end}. */ - MOZ_PADDING_END__("-moz-padding-end", "-moz-padding-end", ff52up("")), + MOZ_PADDING_END__("-moz-padding-end", "-moz-padding-end", ffBelow68(""), ff68up("0px")), /** The style property {@code MozPaddingStart}. */ - MOZ_PADDING_START("MozPaddingStart", "-moz-padding-start", ff("")), + MOZ_PADDING_START("MozPaddingStart", "-moz-padding-start", ffBelow68(""), ff68up("0px")), /** The style property {@code -moz-padding-start}. */ - MOZ_PADDING_START__("-moz-padding-start", "-moz-padding-start", ff52up("")), + MOZ_PADDING_START__("-moz-padding-start", "-moz-padding-start", ffBelow68(""), ff68up("0px")), /** The style property {@code MozPerspective}. */ MOZ_PERSPECTIVE("MozPerspective", "-moz-perspective", ff("none")), /** The style property {@code -moz-perspective}. */ - MOZ_PERSPECTIVE__("-moz-perspective", "-moz-perspective", ff52up("none")), + MOZ_PERSPECTIVE__("-moz-perspective", "-moz-perspective", ff("none")), /** The style property {@code MozPerspectiveOrigin}. */ MOZ_PERSPECTIVE_ORIGIN("MozPerspectiveOrigin", - "-moz-perspective-origin", ffBelow52("705px 172.5px"), ff52up("625px 172.5px")), + "-moz-perspective-origin", ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code -moz-perspective-origin}. */ MOZ_PERSPECTIVE_ORIGIN__("-moz-perspective-origin", - "-moz-perspective-origin", ff52up("625px 172.5px")), + "-moz-perspective-origin", ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code MozStackSizing}. */ MOZ_STACK_SIZING("MozStackSizing", "-moz-stack-sizing", ff("stretch-to-fit")), /** The style property {@code -moz-stack-sizing}. */ - MOZ_STACK_SIZING__("-moz-stack-sizing", "-moz-stack-sizing", ff52up("stretch-to-fit")), + MOZ_STACK_SIZING__("-moz-stack-sizing", "-moz-stack-sizing", ff("stretch-to-fit")), /** The style property {@code MozTabSize}. */ MOZ_TAB_SIZE("MozTabSize", "-moz-tab-size", ff("8")), /** The style property {@code -moz-tab-size}. */ - MOZ_TAB_SIZE__("-moz-tab-size", "-moz-tab-size", ff52up("8")), + MOZ_TAB_SIZE__("-moz-tab-size", "-moz-tab-size", ff("8")), /** The style property {@code MozTextAlignLast}. */ MOZ_TEXT_ALIGN_LAST("MozTextAlignLast", "-moz-text-align-last", - ff("auto")), + ff("auto").setIteratable(false)), /** The style property {@code -moz-text-align-last}. */ MOZ_TEXT_ALIGN_LAST__("-moz-text-align-last", "-moz-text-align-last", - ff52up("auto")), + ff("auto").setIteratable(false)), /** The style property {@code MozTextSizeAdjust}. */ MOZ_TEXT_SIZE_ADJUST("MozTextSizeAdjust", "-moz-text-size-adjust", @@ -1814,21 +2061,21 @@ public enum Definition { /** The style property {@code -moz-text-size-adjust}. */ MOZ_TEXT_SIZE_ADJUST__("-moz-text-size-adjust", "-moz-text-size-adjust", - ff52up("auto")), + ff("auto")), /** The style property {@code MozTransform}. */ MOZ_TRANSFORM("MozTransform", "-moz-transform", ff("none")), /** The style property {@code -moz-transform}. */ - MOZ_TRANSFORM__("-moz-transform", "-moz-transform", ff52up("none")), + MOZ_TRANSFORM__("-moz-transform", "-moz-transform", ff("none")), /** The style property {@code MozTransformOrigin}. */ MOZ_TRANSFORM_ORIGIN("MozTransformOrigin", "-moz-transform-origin", - ffBelow52("705px 172.5px"), ff52up("625px 172.5px")), + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code -moz-transform-origin}. */ MOZ_TRANSFORM_ORIGIN__("-moz-transform-origin", "-moz-transform-origin", - ff52up("625px 172.5px")), + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code MozTransformStyle}. */ MOZ_TRANSFORM_STYLE("MozTransformStyle", "-moz-transform-style", @@ -1836,13 +2083,13 @@ public enum Definition { /** The style property {@code -moz-transform-style}. */ MOZ_TRANSFORM_STYLE__("-moz-transform-style", "-moz-transform-style", - ff52up("flat")), + ff("flat")), /** The style property {@code MozTransition}. */ MOZ_TRANSITION("MozTransition", "-moz-transition", ff("")), /** The style property {@code -moz-transition}. */ - MOZ_TRANSITION__("-moz-transition", "-moz-transition", ff52up("")), + MOZ_TRANSITION__("-moz-transition", "-moz-transition", ff("")), /** The style property {@code MozTransitionDelay}. */ MOZ_TRANSITION_DELAY("MozTransitionDelay", "-moz-transition-delay", @@ -1850,7 +2097,7 @@ public enum Definition { /** The style property {@code -moz-transition-delay}. */ MOZ_TRANSITION_DELAY__("-moz-transition-delay", "-moz-transition-delay", - ff52up("0s")), + ff("0s")), /** The style property {@code MozTransitionDuration}. */ MOZ_TRANSITION_DURATION("MozTransitionDuration", "-moz-transition-duration", @@ -1858,7 +2105,7 @@ public enum Definition { /** The style property {@code -moz-transition-duration}. */ MOZ_TRANSITION_DURATION__("-moz-transition-duration", "-moz-transition-duration", - ff52up("0s")), + ff("0s")), /** The style property {@code MozTransitionProperty}. */ MOZ_TRANSITION_PROPERTY("MozTransitionProperty", "-moz-transition-property", @@ -1866,7 +2113,7 @@ public enum Definition { /** The style property {@code -moz-transition-property}. */ MOZ_TRANSITION_PROPERTY__("-moz-transition-property", "-moz-transition-property", - ff52up("all")), + ff("all")), /** The style property {@code MozTransitionTimingFunction}. */ MOZ_TRANSITION_TIMING_FUNCTION("MozTransitionTimingFunction", @@ -1874,37 +2121,37 @@ public enum Definition { /** The style property {@code -moz-transition-timing-function}. */ MOZ_TRANSITION_TIMING_FUNCTION__("-moz-transition-timing-function", - "-moz-transition-timing-function", ff52up("ease")), + "-moz-transition-timing-function", ff("ease")), /** The style property {@code MozUserFocus}. */ MOZ_USER_FOCUS("MozUserFocus", "-moz-user-focus", ff("none")), /** The style property {@code -moz-user-focus}. */ - MOZ_USER_FOCUS__("-moz-user-focus", "-moz-user-focus", ff52up("none")), + MOZ_USER_FOCUS__("-moz-user-focus", "-moz-user-focus", ff("none")), /** The style property {@code MozUserInput}. */ MOZ_USER_INPUT("MozUserInput", "-moz-user-input", ff("auto")), /** The style property {@code -moz-user-input}. */ - MOZ_USER_INPUT__("-moz-user-input", "-moz-user-input", ff52up("auto")), + MOZ_USER_INPUT__("-moz-user-input", "-moz-user-input", ff("auto")), /** The style property {@code MozUserModify}. */ MOZ_USER_MODIFY("MozUserModify", "-moz-user-modify", ff("read-only")), /** The style property {@code -moz-user-modify}. */ - MOZ_USER_MODIFY__("-moz-user-modify", "-moz-user-modify", ff52up("read-only")), + MOZ_USER_MODIFY__("-moz-user-modify", "-moz-user-modify", ff("read-only")), /** The style property {@code MozUserSelect}. */ MOZ_USER_SELECT("MozUserSelect", "-moz-user-select", ff("auto")), /** The style property {@code -moz-user-select}. */ - MOZ_USER_SELECT__("-moz-user-select", "-moz-user-select", ff52up("auto")), + MOZ_USER_SELECT__("-moz-user-select", "-moz-user-select", ff("auto")), /** The style property {@code MozWindowDragging}. */ - MOZ_WINDOW_DRAGGING("MozWindowDragging", "-moz-window-dragging", ffBelow52("no-drag"), ff52up("default")), + MOZ_WINDOW_DRAGGING("MozWindowDragging", "-moz-window-dragging", ff("default")), /** The style property {@code -moz-window-dragging}. */ - MOZ_WINDOW_DRAGGING__("-moz-window-dragging", "-moz-window-dragging", ff52up("default")), + MOZ_WINDOW_DRAGGING__("-moz-window-dragging", "-moz-window-dragging", ff("default")), /** The style property {@code msAnimation}. */ MS_ANIMATION("msAnimation", "-ms-animation", ie("")), @@ -2183,31 +2430,31 @@ public enum Definition { OFFSET("offset", "offset", chrome("none 0px auto 0deg")), /** The style property {@code offsetBlockEnd}. */ - OFFSET_BLOCK_END("offsetBlockEnd", "offset-block-end", ff("")), + OFFSET_BLOCK_END("offsetBlockEnd", "offset-block-end", ffBelow68("")), /** The style property {@code offset-block-end}. */ - OFFSET_BLOCK_END_("offset-block-end", "offset-block-end", ff("")), + OFFSET_BLOCK_END_("offset-block-end", "offset-block-end", ffBelow68("")), /** The style property {@code offsetBlockStart}. */ - OFFSET_BLOCK_START("offsetBlockStart", "offset-block-start", ff("")), + OFFSET_BLOCK_START("offsetBlockStart", "offset-block-start", ffBelow68("")), /** The style property {@code offset-block-start}. */ - OFFSET_BLOCK_START_("offset-block-start", "offset-block-start", ff("")), + OFFSET_BLOCK_START_("offset-block-start", "offset-block-start", ffBelow68("")), /** The style property {@code offsetDistance}. */ OFFSET_DISTANCE("offsetDistance", "offsetDistance", chrome("0px")), /** The style property {@code offsetInlineEnd}. */ - OFFSET_INLINE_END("offsetInlineEnd", "offset-inline-end", ff("")), + OFFSET_INLINE_END("offsetInlineEnd", "offset-inline-end", ffBelow68("")), /** The style property {@code offset-inline-end}. */ - OFFSET_INLINE_END_("offset-inline-end", "offset-inline-end", ff("")), + OFFSET_INLINE_END_("offset-inline-end", "offset-inline-end", ffBelow68("")), /** The style property {@code offsetInlineStart}. */ - OFFSET_INLINE_START("offsetInlineStart", "offset-inline-start", ff("")), + OFFSET_INLINE_START("offsetInlineStart", "offset-inline-start", ffBelow68("")), /** The style property {@code offset-inline-start}. */ - OFFSET_INLINE_START_("offset-inline-start", "offset-inline-start", ff("")), + OFFSET_INLINE_START_("offset-inline-start", "offset-inline-start", ffBelow68("")), /** The style property {@code offsetPath}. */ OFFSET_PATH("offsetPath", "offsetPath", chrome("none")), @@ -2259,13 +2506,16 @@ public enum Definition { OVERFLOW("overflow", "overflow", chrome("visible"), ff("visible"), ie("visible")), /** The style property {@code overflowAnchor}. */ - OVERFLOW_ANCHOR("overflowAnchor", "overflow-anchor", chrome("auto")), + OVERFLOW_ANCHOR("overflowAnchor", "overflow-anchor", chrome("auto"), ff68up("auto")), + + /** The style property {@code overflow-anchor}. */ + OVERFLOW_ANCHOR_("overflow-anchor", "overflow-anchor", ff68up("auto")), /** The style property {@code overflowWrap}. */ - OVERFLOW_WRAP("overflowWrap", "overflow-wrap", chrome("normal"), ff52up("normal")), + OVERFLOW_WRAP("overflowWrap", "overflow-wrap", chrome("normal"), ff("normal")), /** The style property {@code overflow-wrap}. */ - OVERFLOW_WRAP_("overflow-wrap", "overflow-wrap", ff52up("normal")), + OVERFLOW_WRAP_("overflow-wrap", "overflow-wrap", ff("normal")), /** The style property {@code overflowX}. */ OVERFLOW_X("overflowX", "overflow-x", chrome("visible"), ff("visible"), ie("visible")), @@ -2280,28 +2530,50 @@ public enum Definition { OVERFLOW_Y_("overflow-y", "overflow-y", ff("visible")), /** The style property {@code overscrollBehavior}. */ - OVERSCROLL_BEHAVIOR("overscrollBehavior", "overscroll-behavior", chrome("auto auto")), + OVERSCROLL_BEHAVIOR("overscrollBehavior", "overscroll-behavior", chrome("auto"), ff("")), + + /** The style property {@code overscroll-behavior}. */ + OVERSCROLL_BEHAVIOR_("overscroll-behavior", "overscroll-behavior", ff("")), + + /** The style property {@code overscrollBehaviorBlock}. */ + OVERSCROLL_BEHAVIOR_BLOCK("overscrollBehaviorBlock", "overscroll-behavior-block", chrome("auto")), + + /** The style property {@code overscrollBehaviorInline}. */ + OVERSCROLL_BEHAVIOR_INLINR("overscrollBehaviorInline", "overscroll-behavior-inline", chrome("auto")), /** The style property {@code overscrollBehaviorX}. */ - OVERSCROLL_BEHAVIOR_X("overscrollBehaviorX", "overscroll-behavior_x", chrome("auto")), + OVERSCROLL_BEHAVIOR_X("overscrollBehaviorX", "overscroll-behavior-x", chrome("auto"), ff("auto")), + + /** The style property {@code overscroll-behavior-x}. */ + OVERSCROLL_BEHAVIOR_X_("overscroll-behavior-x", "overscroll-behavior-x", ff("auto")), /** The style property {@code overscrollBehaviorY}. */ - OVERSCROLL_BEHAVIOR_Y("overscrollBehaviorY", "overscroll-behavior_y", chrome("auto")), + OVERSCROLL_BEHAVIOR_Y("overscrollBehaviorY", "overscroll-behavior-y", chrome("auto"), ff("auto")), + + /** The style property {@code overscroll-behavior-y}. */ + OVERSCROLL_BEHAVIOR_Y_("overscroll-behavior-y", "overscroll-behavior-y", ff("auto")), /** The style property {@code padding}. */ PADDING("padding", "padding", chrome("0px"), ff(""), ie("")), + /** The style property {@code paddingBlock}. */ + PADDING_BLOCK("paddingBlock", "padding-block", ff68up("")), + + /** The style property {@code padding-block}. */ + PADDING_BLOCK_("padding-block", "padding-block", ff68up("")), + /** The style property {@code paddingBlockEnd}. */ - PADDING_BLOCK_END("paddingBlockEnd", "padding-block-end", ff("")), + PADDING_BLOCK_END("paddingBlockEnd", "padding-block-end", chrome("0px"), + ffBelow68(""), ff68up("0px")), /** The style property {@code padding-block-end}. */ - PADDING_BLOCK_END_("padding-block-end", "padding-block-end", ff("")), + PADDING_BLOCK_END_("padding-block-end", "padding-block-end", ffBelow68(""), ff68up("0px")), /** The style property {@code paddingBlockStart}. */ - PADDING_BLOCK_START("paddingBlockStart", "padding-block-start", ff("")), + PADDING_BLOCK_START("paddingBlockStart", "padding-block-start", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code padding-block-start}. */ - PADDING_BLOCK_START_("padding-block-start", "padding-block-start", ff("")), + PADDING_BLOCK_START_("padding-block-start", "padding-block-start", ffBelow68(""), ff68up("0px")), /** The style property {@code paddingBottom}. */ PADDING_BOTTOM("paddingBottom", "padding-bottom", chrome("0px"), ff(""), ie("")), @@ -2309,17 +2581,23 @@ public enum Definition { /** The style property {@code padding-bottom}. */ PADDING_BOTTOM_("padding-bottom", "padding-bottom", ff("0px")), + /** The style property {@code paddingInline}. */ + PADDING_INLINE("paddingInline", "padding-inline", ff68up("")), + + /** The style property {@code padding-inline}. */ + PADDING_INLINE_("padding-inline", "padding-inline", ff68up("")), + /** The style property {@code paddingInlineEnd}. */ - PADDING_INLINE_END("paddingInlineEnd", "padding-inline-end", ff("")), + PADDING_INLINE_END("paddingInlineEnd", "padding-inline-end", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code padding-inline-end}. */ - PADDING_INLINE_END_("padding-inline-end", "padding-inline-end", ff("")), + PADDING_INLINE_END_("padding-inline-end", "padding-inline-end", ffBelow68(""), ff68up("0px")), /** The style property {@code paddingInlineStart}. */ - PADDING_INLINE_START("paddingInlineStart", "padding-inline-start", ff("")), + PADDING_INLINE_START("paddingInlineStart", "padding-inline-start", chrome("0px"), ffBelow68(""), ff68up("0px")), /** The style property {@code padding-inline-start}. */ - PADDING_INLINE_START_("padding-inline-start", "padding-inline-start", ff("")), + PADDING_INLINE_START_("padding-inline-start", "padding-inline-start", ffBelow68(""), ff68up("0px")), /** The style property {@code paddingLeft}. */ PADDING_LEFT("paddingLeft", "padding-left", chrome("0px"), ff(""), ie("")), @@ -2361,7 +2639,7 @@ public enum Definition { PAGE_BREAK_INSIDE_("page-break-inside", "page-break-inside", ff("auto")), /** The style property {@code paintOrder}. */ - PAINT_ORDER("paintOrder", "paint-order", ff("normal"), chrome("fill stroke markers")), + PAINT_ORDER("paintOrder", "paint-order", ff("normal"), chrome("normal")), /** The style property {@code paint-order}. */ PAINT_ORDER_("paint-order", "paint-order", ff("normal")), @@ -2380,11 +2658,11 @@ public enum Definition { /** The style property {@code perspectiveOrigin}. */ PERSPECTIVE_ORIGIN("perspectiveOrigin", "perspective-origin", - ffBelow52("705px 172.5px"), ff52up("625px 172.5px"), ie("620px 163.2px"), chrome("456.5px 161px")), + ffBelow68("625px 172.5px"), ff68up("621px 171.5px"), ie("620px 163.2px"), chrome("456.5px 161px")), /** The style property {@code perspective-origin}. */ PERSPECTIVE_ORIGIN_("perspective-origin", "perspective-origin", - ffBelow52("705px 172.5px"), ff52up("625px 172.5px")), + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code pitch}. */ PITCH("pitch", "pitch"), @@ -2393,40 +2671,40 @@ public enum Definition { PITCH_RANGE("pitchRange", "pitch-range"), /** The style property {@code pixelBottom}. */ - PIXEL_BOTTOM("pixelBottom", "pixel-bottom", ie("").setIteratable(false)), + PIXEL_BOTTOM("pixelBottom", "pixel-bottom", ie("")), /** The style property {@code pixelHeight}. */ - PIXEL_HEIGHT("pixelHeight", "pixel-height", ie("").setIteratable(false)), + PIXEL_HEIGHT("pixelHeight", "pixel-height", ie("")), /** The style property {@code pixelLeft}. */ - PIXEL_LEFT("pixelLeft", "pixel-left", ie("").setIteratable(false)), + PIXEL_LEFT("pixelLeft", "pixel-left", ie("")), /** The style property {@code pixelRight}. */ - PIXEL_RIGHT("pixelRight", "pixel-right", ie("").setIteratable(false)), + PIXEL_RIGHT("pixelRight", "pixel-right", ie("")), /** The style property {@code pixelTop}. */ - PIXEL_TOP("pixelTop", "pixel-top", ie("").setIteratable(false)), + PIXEL_TOP("pixelTop", "pixel-top", ie("")), /** The style property {@code pixelWidth}. */ - PIXEL_WIDTH("pixelWidth", "pixel-width", ie("").setIteratable(false)), + PIXEL_WIDTH("pixelWidth", "pixel-width", ie("")), /** The style property {@code placeContent}. */ - PLACE_CONTENT("placeContent", "place-content", chrome("normal normal"), ff52up("")), + PLACE_CONTENT("placeContent", "place-content", chrome("normal"), ff("")), /** The style property {@code place-content}. */ - PLACE_CONTENT_("place-content", "place-content", ff52up("")), + PLACE_CONTENT_("place-content", "place-content", ff("")), /** The style property {@code placeItems}. */ - PLACE_ITEMS("placeItems", "place-items", chrome("normal normal"), ff52up("")), + PLACE_ITEMS("placeItems", "place-items", chrome("normal"), ff("")), /** The style property {@code place-items}. */ - PLACE_ITEMS_("place-items", "place-items", ff52up("")), + PLACE_ITEMS_("place-items", "place-items", ff("")), /** The style property {@code placeSelf}. */ - PLACE_SELF("placeSelf", "place-self", chrome("auto auto"), ff52up("")), + PLACE_SELF("placeSelf", "place-self", chrome("auto"), ff("")), /** The style property {@code place-self}. */ - PLACE_SELF_("place-self", "place-self", ff52up("")), + PLACE_SELF_("place-self", "place-self", ff("")), /** The style property {@code pointerEvents}. */ POINTER_EVENTS("pointerEvents", "pointer-events", ie("visiblePainted"), chrome("auto"), ff("auto")), @@ -2435,22 +2713,22 @@ public enum Definition { POINTER_EVENTS_("pointer-events", "pointer-events", ff("auto")), /** The style property {@code posBottom}. */ - POS_BOTTOM("posBottom", "pos-bottom", ie("").setIteratable(false)), + POS_BOTTOM("posBottom", "pos-bottom", ie("")), /** The style property {@code posHeight}. */ - POS_HEIGHT("posHeight", "pos-height", ie("").setIteratable(false)), + POS_HEIGHT("posHeight", "pos-height", ie("")), /** The style property {@code posLeft}. */ - POS_LEFT("posLeft", "pos-left", ie("").setIteratable(false)), + POS_LEFT("posLeft", "pos-left", ie("")), /** The style property {@code posRight}. */ - POS_RIGHT("posRight", "pos-right", ie("").setIteratable(false)), + POS_RIGHT("posRight", "pos-right", ie("")), /** The style property {@code posTop}. */ - POS_TOP("posTop", "pos-top", ie("").setIteratable(false)), + POS_TOP("posTop", "pos-top", ie("")), /** The style property {@code posWidth}. */ - POS_WIDTH("posWidth", "pos-width", ie("").setIteratable(false)), + POS_WIDTH("posWidth", "pos-width", ie("")), /** The style property {@code position}. */ POSITION("position", "position", chrome("static"), ff("static"), ie("static")), @@ -2471,7 +2749,10 @@ public enum Definition { RIGHT("right", "right", chrome("auto"), ff(""), ie("")), /** The style property {@code rowGap}. */ - ROW_GAP("rowGap", "rowGap", chrome("normal")), + ROW_GAP("rowGap", "row-gap", chrome("normal"), ff68up("normal")), + + /** The style property {@code row-gap}. */ + ROW_GAP_("row-gap", "row-gap", ff68up("normal")), /** The style property {@code rubyAlign}. */ RUBY_ALIGN("rubyAlign", "ruby-align", ff("space-around"), ie("")), @@ -2500,47 +2781,194 @@ public enum Definition { /** The style property {@code scroll-behavior}. */ SCROLL_BEHAVIOR_("scroll-behavior", "scroll-behavior", ff("auto")), + /** The style property {@code scrollMargin}. */ + SCROLL_MARGIN("scrollMargin", "scroll-margin", chrome("0px"), ff68up("")), + + /** The style property {@code scroll-margin}. */ + SCROLL_MARGIN_("scroll-margin", "scroll-margin", ff68up("")), + + /** The style property {@code scrollMarginBlock}. */ + SCROLL_MARGIN_BLOCK("scrollMarginBlock", "scroll-margin-block", chrome("0px"), ff68up("")), + + /** The style property {@code scroll-margin-block}. */ + SCROLL_MARGIN_BLOCK_("scroll-margin-block", "scroll-margin-block", ff68up("")), + + /** The style property {@code scrollMarginBlockEnd}. */ + SCROLL_MARGIN_BLOCK_END("scrollMarginBlockEnd", "scroll-margin-block-end", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-block-end}. */ + SCROLL_MARGIN_BLOCK_END_("scroll-margin-block-end", "scroll-margin-block-end", ff68up("0px")), + + /** The style property {@code scrollMarginBlockStart}. */ + SCROLL_MARGIN_BLOCK_START("scrollMarginBlockStart", "scroll-margin-block-start", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-block-start}. */ + SCROLL_MARGIN_BLOCK_START_("scroll-margin-block-start", "scroll-margin-block-start", ff68up("0px")), + + /** The style property {@code scrollMarginBottom}. */ + SCROLL_MARGIN_BOTTOM("scrollMarginBottom", "scroll-margin-bottom", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-bottom}. */ + SCROLL_MARGIN_BOTTOM_("scroll-margin-bottom", "scroll-margin-bottom", ff68up("0px")), + + /** The style property {@code scrollMarginInline}. */ + SCROLL_MARGIN_INLINE("scrollMarginInline", "scroll-margin-inline", chrome("0px"), ff68up("")), + + /** The style property {@code scroll-margin-inline}. */ + SCROLL_MARGIN_INLINE_("scroll-margin-inline", "scroll-margin-inline", ff68up("")), + + /** The style property {@code scrollMarginInlineEnd}. */ + SCROLL_MARGIN_INLINE_END("scrollMarginInlineEnd", "scroll-margin-inline-end", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-inline-end}. */ + SCROLL_MARGIN_INLINE_END_("scroll-margin-inline-end", "scroll-margin-inline-end", ff68up("0px")), + + /** The style property {@code scrollMarginInlineStart}. */ + SCROLL_MARGIN_INLINE_START("scrollMarginInlineStart", "scroll-margin-inline-start", + chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-inline-start}. */ + SCROLL_MARGIN_INLINE_START_("scroll-margin-inline-start", "scroll-margin-inline-start", ff68up("0px")), + + /** The style property {@code scrollMarginLeft}. */ + SCROLL_MARGIN_LEFT("scrollMarginLeft", "scroll-margin-left", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-left}. */ + SCROLL_MARGIN_LEFT_("scroll-margin-left", "scroll-margin-left", ff68up("0px")), + + /** The style property {@code scrollMarginRight}. */ + SCROLL_MARGIN_RIGHT("scrollMarginRight", "scroll-margin-right", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-right}. */ + SCROLL_MARGIN_RIGHT_("scroll-margin-right", "scroll-margin-right", ff68up("0px")), + + /** The style property {@code scrollMarginTop}. */ + SCROLL_MARGIN_TOP("scrollMarginTop", "scroll-margin-top", chrome("0px"), ff68up("0px")), + + /** The style property {@code scroll-margin-top}. */ + SCROLL_MARGIN_TOP_("scroll-margin-top", "scroll-margin-top", ff68up("0px")), + + /** The style property {@code scrollPadding}. */ + SCROLL_PADDING("scrollPadding", "scroll-padding", chrome("auto"), ff68up("")), + + /** The style property {@code scroll-padding}. */ + SCROLL_PADDING_("scroll-padding", "scroll-padding", ff68up("")), + + /** The style property {@code scrollPaddingBlock}. */ + SCROLL_PADDING_BLOCK("scrollPaddingBlock", "scroll-padding-block", + chrome("auto"), ff68up("")), + + /** The style property {@code scroll-padding-block}. */ + SCROLL_PADDING_BLOCK_("scroll-padding-block", "scroll-padding-block", ff68up("")), + + /** The style property {@code scrollPaddingBlockEnd}. */ + SCROLL_PADDING_BLOCK_END("scrollPaddingBlockEnd", "scroll-padding-block-end", + chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-block-end}. */ + SCROLL_PADDING_BLOCK_END_("scroll-padding-block-end", "scroll-padding-block-end", ff68up("auto")), + + /** The style property {@code scrollPaddingBlockStart}. */ + SCROLL_PADDING_BLOCK_START("scrollPaddingBlockStart", "scroll-padding-block-start", + chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-block-start}. */ + SCROLL_PADDING_BLOCK_START_("scroll-padding-block-start", "scroll-padding-block-start", ff68up("auto")), + + /** The style property {@code scrollPaddingBottom}. */ + SCROLL_PADDING_BOTTOM("scrollPaddingBottom", "scroll-padding-bottom", chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-bottom}. */ + SCROLL_PADDING_BOTTOM_("scroll-padding-bottom", "scroll-padding-bottom", ff68up("auto")), + + /** The style property {@code scrollPaddingInline}. */ + SCROLL_PADDING_INLINE("scrollPaddingInline", "scroll-padding-inline", chrome("auto"), ff68up("")), + + /** The style property {@code scroll-padding-inline}. */ + SCROLL_PADDING_INLINE_("scroll-padding-inline", "scroll-padding-inline", ff68up("")), + + /** The style property {@code scrollPaddingInlineEnd}. */ + SCROLL_PADDING_INLINE_END("scrollPaddingInlineEnd", "scroll-padding-inline-end", + chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-inline-end}. */ + SCROLL_PADDING_INLINE_END_("scroll-padding-inline-end", "scroll-padding-inline-end", ff68up("auto")), + + /** The style property {@code scrollPaddingInlineStart}. */ + SCROLL_PADDING_INLINE_START("scrollPaddingInlineStart", "scroll-padding-inline-start", + chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-inline-start}. */ + SCROLL_PADDING_INLINE_START_("scroll-padding-inline-start", "scroll-padding-inline-start", ff68up("auto")), + + /** The style property {@code scrollPaddingLeft}. */ + SCROLL_PADDING_LEFT("scrollPaddingLeft", "scroll-padding-left", chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-left}. */ + SCROLL_PADDING_LEFT_("scroll-padding-left", "scroll-padding-left", ff68up("auto")), + + /** The style property {@code scrollPaddingRight}. */ + SCROLL_PADDING_RIGHT("scrollPaddingRight", "scroll-padding-right", chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-right}. */ + SCROLL_PADDING_RIGHT_("scroll-padding-right", "scroll-padding-right", ff68up("auto")), + + /** The style property {@code scrollPaddingTop}. */ + SCROLL_PADDING_TOP("scrollPaddingTop", "scroll-padding-top", chrome("auto"), ff68up("auto")), + + /** The style property {@code scroll-padding-top}. */ + SCROLL_PADDING_TOP_("scroll-padding-top", "scroll-padding-top", ff68up("auto")), + + /** The style property {@code scrollSnapAlign}. */ + SCROLL_SNAP_ALIGN("scrollSnapAlign", "scroll-snap-align", chrome("none"), ff68up("none")), + + /** The style property {@code scroll-snap-align}. */ + SCROLL_SNAP_ALIGN_("scroll-snap-align", "scroll-snap-align", ff68up("none")), + /** The style property {@code scrollSnapCoordinate}. */ - SCROLL_SNAP_COORDINATE("scrollSnapCoordinate", "scroll-snap-coordinate", ff("none")), + SCROLL_SNAP_COORDINATE("scrollSnapCoordinate", "scroll-snap-coordinate", ffBelow68("none")), /** The style property {@code scroll-snap-coordinate}. */ - SCROLL_SNAP_COORDINATE_("scroll-snap-coordinate", "scroll-snap-coordinate", ff("none")), + SCROLL_SNAP_COORDINATE_("scroll-snap-coordinate", "scroll-snap-coordinate", ffBelow68("none")), /** The style property {@code scrollSnapDestination}. */ - SCROLL_SNAP_DESTINATION("scrollSnapDestination", "scroll-snap-destination", ff("0px 0px")), + SCROLL_SNAP_DESTINATION("scrollSnapDestination", "scroll-snap-destination", ffBelow68("0px 0px")), /** The style property {@code scroll-snap-destination}. */ - SCROLL_SNAP_DESTINATION_("scroll-snap-destination", "scroll-snap-destination", ff("0px 0px")), + SCROLL_SNAP_DESTINATION_("scroll-snap-destination", "scroll-snap-destination", ffBelow68("0px 0px")), /** The style property {@code scrollSnapPointsX}. */ - SCROLL_SNAP_POINTS_X("scrollSnapPointsX", "scroll-snap-points-x", ff("none")), + SCROLL_SNAP_POINTS_X("scrollSnapPointsX", "scroll-snap-points-x", ffBelow68("none")), /** The style property {@code scroll-snap-points-x}. */ - SCROLL_SNAP_POINTS_X_("scroll-snap-points-x", "scroll-snap-points-x", ff("none")), + SCROLL_SNAP_POINTS_X_("scroll-snap-points-x", "scroll-snap-points-x", ffBelow68("none")), /** The style property {@code scrollSnapPointsY}. */ - SCROLL_SNAP_POINTS_Y("scrollSnapPointsY", "scroll-snap-points-y", ff("none")), + SCROLL_SNAP_POINTS_Y("scrollSnapPointsY", "scroll-snap-points-y", ffBelow68("none")), /** The style property {@code scroll-snap-points-y}. */ - SCROLL_SNAP_POINTS_Y_("scroll-snap-points-y", "scroll-snap-points-y", ff("none")), + SCROLL_SNAP_POINTS_Y_("scroll-snap-points-y", "scroll-snap-points-y", ffBelow68("none")), + + /** The style property {@code scrollSnapStop}. */ + SCROLL_SNAP_STOP("scrollSnapStop", "scroll-snap-stop", chrome("normal")), /** The style property {@code scrollSnapType}. */ - SCROLL_SNAP_TYPE("scrollSnapType", "scroll-snap-type", ff("")), + SCROLL_SNAP_TYPE("scrollSnapType", "scroll-snap-type", chrome("none"), ffBelow68(""), ff68up("none")), /** The style property {@code scroll-snap-type}. */ - SCROLL_SNAP_TYPE_("scroll-snap-type", "scroll-snap-type", ff("")), + SCROLL_SNAP_TYPE_("scroll-snap-type", "scroll-snap-type", ffBelow68(""), ff68up("none")), /** The style property {@code scrollSnapTypeX}. */ - SCROLL_SNAP_TYPE_X("scrollSnapTypeX", "scroll-snap-type-x", ff("none")), + SCROLL_SNAP_TYPE_X("scrollSnapTypeX", "scroll-snap-type-x", ffBelow68("none")), /** The style property {@code scroll-snap-type-x}. */ - SCROLL_SNAP_TYPE_X_("scroll-snap-type-x", "scroll-snap-type-x", ff("none")), + SCROLL_SNAP_TYPE_X_("scroll-snap-type-x", "scroll-snap-type-x", ffBelow68("none")), /** The style property {@code scrollSnapTypeY}. */ - SCROLL_SNAP_TYPE_Y("scrollSnapTypeY", "scroll-snap-type-y", ff("none")), + SCROLL_SNAP_TYPE_Y("scrollSnapTypeY", "scroll-snap-type-y", ffBelow68("none")), /** The style property {@code scroll-snap-type-y}. */ - SCROLL_SNAP_TYPE_Y_("scroll-snap-type-y", "scroll-snap-type-y", ff("none")), + SCROLL_SNAP_TYPE_Y_("scroll-snap-type-y", "scroll-snap-type-y", ffBelow68("none")), /** The style property {@code scrollbar3dLightColor}. */ SCROLLBAR_3DLIGHT_COLOR("scrollbar3dLightColor", "scrollbar-3dlight-color", ie("undefined")), @@ -2551,6 +2979,12 @@ public enum Definition { /** The style property {@code scrollbarBaseColor}. */ SCROLLBAR_BASE_COLOR("scrollbarBaseColor", "scrollbar-base-color", ie("undefined")), + /** The style property {@code scrollbarColor}. */ + SCROLLBAR_COLOR("scrollbarColor", "scrollbar-color", ff68up("auto")), + + /** The style property {@code scrollbar-color}. */ + SCROLLBAR_COLOR_("scrollbar-color", "scrollbar-color", ff68up("auto")), + /** The style property {@code scrollbarDarkShadowColor}. */ SCROLLBAR_DARKSHADOW_COLOR("scrollbarDarkShadowColor", "scrollbar-darkshadow-color", ie("undefined")), @@ -2566,14 +3000,29 @@ public enum Definition { /** The style property {@code scrollbarTrackColor}. */ SCROLLBAR_TRACK_COLOR("scrollbarTrackColor", "scrollbar-track-color", ie("undefined")), + /** The style property {@code scrollbarWidth}. */ + SCROLLBAR_WIDTH("scrollbarWidth", "scrollbar-width", ff68up("auto")), + + /** The style property {@code scrollbar-width}. */ + SCROLLBAR_WIDTH_("scrollbar-width", "scrollbar-width", ff68up("auto")), + /** The style property {@code shapeImageThreshold}. */ - SHAPE_IMAGE_THRESHOLD("shapeImageThreshold", "shape-image-threshold", chrome("0")), + SHAPE_IMAGE_THRESHOLD("shapeImageThreshold", "shape-image-threshold", chrome("0"), ff68up("0")), + + /** The style property {@code shape-image-threshold}. */ + SHAPE_IMAGE_THRESHOLD_("shape-image-threshold", "shape-image-threshold", ff68up("0")), /** The style property {@code shapeMargin}. */ - SHAPE_MARGIN("shapeMargin", "shape-margin", chrome("0px")), + SHAPE_MARGIN("shapeMargin", "shape-margin", chrome("0px"), ff68up("0px")), + + /** The style property {@code shape-margin}. */ + SHAPE_MARGIN_("shape-margin", "shape-margin", ff68up("0px")), /** The style property {@code shapeOutside}. */ - SHAPE_OUTSIDE("shapeOutside", "shape-outside", chrome("none")), + SHAPE_OUTSIDE("shapeOutside", "shape-outside", chrome("none"), ff68up("none")), + + /** The style property {@code shape-outside}. */ + SHAPE_OUTSIDE_("shape-outside", "shape-outside", ff68up("none")), /** The style property {@code shapeRendering}. */ SHAPE_RENDERING("shapeRendering", "shape-rendering", ff("auto"), chrome("auto")), @@ -2681,10 +3130,10 @@ public enum Definition { TEXT_ALIGN_("text-align", "text-align", ff("start")), /** The style property {@code textAlignLast}. */ - TEXT_ALIGN_LAST("textAlignLast", "text-align-last", ie("auto"), chrome("auto"), ff52up("auto")), + TEXT_ALIGN_LAST("textAlignLast", "text-align-last", ie("auto"), chrome("auto"), ff("auto")), /** The style property {@code text-align-last}. */ - TEXT_ALIGN_LAST_("text-align-last", "text-align-last", ff52up("auto")), + TEXT_ALIGN_LAST_("text-align-last", "text-align-last", ff("auto")), /** The style property {@code textAnchor}. */ TEXT_ANCHOR("textAnchor", "text-anchor", ff("start"), ie("start"), chrome("start")), @@ -2696,10 +3145,10 @@ public enum Definition { TEXT_AUTOSPACE("textAutospace", "text-autospace", ie("undefined")), /** The style property {@code textCombineUpright}. */ - TEXT_COMBINE_UPRIGHT("textCombineUpright", "text-combine-upright", chrome("none"), ff52up("none")), + TEXT_COMBINE_UPRIGHT("textCombineUpright", "text-combine-upright", chrome("none"), ff("none")), /** The style property {@code text-combine-upright}. */ - TEXT_COMBINE_UPRIGHT_("text-combine-upright", "text-combine-upright", ff52up("none")), + TEXT_COMBINE_UPRIGHT_("text-combine-upright", "text-combine-upright", ff("none")), /** The style property {@code textDecoration}. */ TEXT_DECORATION("textDecoration", "text-decoration", chrome("none solid rgb(0, 0, 0)"), ff("none"), ie("none")), @@ -2708,7 +3157,7 @@ public enum Definition { TEXT_DECORATION_("text-decoration", "text-decoration", ff("none")), /** The style property {@code textDecorationBlink}. */ - TEXT_DECORATION_BLINK("textDecorationBlink", "text-decoration-blink", ie("false").setIteratable(false)), + TEXT_DECORATION_BLINK("textDecorationBlink", "text-decoration-blink", ie("false")), /** The style property {@code textDecorationColor}. */ TEXT_DECORATION_COLOR("textDecorationColor", "text-decoration-color", @@ -2725,14 +3174,14 @@ public enum Definition { /** The style property {@code textDecorationLineThrough}. */ TEXT_DECORATION_LINE_THROUGH("textDecorationLineThrough", "text-decoration-line-through", - ie("false").setIteratable(false)), + ie("false")), /** The style property {@code textDecorationNone}. */ - TEXT_DECORATION_NONE("textDecorationNone", "text-decoration-none", ie("false").setIteratable(false)), + TEXT_DECORATION_NONE("textDecorationNone", "text-decoration-none", ie("false")), /** The style property {@code textDecorationOverline}. */ TEXT_DECORATION_OVERLINE("textDecorationOverline", "text-decoration-overline", - ie("false").setIteratable(false)), + ie("false")), /** The style property {@code textDecorationSkipInk}. */ TEXT_DECORATION_SKIP("textDecorationSkipInk", "text-decoration-skip-ink", chrome("auto")), @@ -2745,31 +3194,31 @@ public enum Definition { /** The style property {@code textDecorationUnderline}. */ TEXT_DECORATION_UNDERLINE("textDecorationUnderline", "text-decoration-underline", - ie("false").setIteratable(false)), + ie("false")), /** The style property {@code textEmphasis}. */ - TEXT_EMPHASIS("textEmphasis", "text-emphasis", ff52up("")), + TEXT_EMPHASIS("textEmphasis", "text-emphasis", ff("")), /** The style property {@code text-emphasis}. */ - TEXT_EMPHASIS_("text-emphasis", "text-emphasis", ff52up("")), + TEXT_EMPHASIS_("text-emphasis", "text-emphasis", ff("")), /** The style property {@code textEmphasisColor}. */ - TEXT_EMPHASIS_COLOR("textEmphasisColor", "text-emphasis-color", ff52up("rgb(0, 0, 0)")), + TEXT_EMPHASIS_COLOR("textEmphasisColor", "text-emphasis-color", ff("rgb(0, 0, 0)")), /** The style property {@code text-emphasis-color}. */ - TEXT_EMPHASIS_COLOR_("text-emphasis-color", "text-emphasis-color", ff52up("rgb(0, 0, 0)")), + TEXT_EMPHASIS_COLOR_("text-emphasis-color", "text-emphasis-color", ff("rgb(0, 0, 0)")), /** The style property {@code textEmphasisPosition}. */ - TEXT_EMPHASIS_POSITION("textEmphasisPosition", "text-emphasis-position", ff52up("over right")), + TEXT_EMPHASIS_POSITION("textEmphasisPosition", "text-emphasis-position", ff("over right")), /** The style property {@code text-emphasis-position}. */ - TEXT_EMPHASIS_POSITION_("text-emphasis-position", "text-emphasis-position", ff52up("over right")), + TEXT_EMPHASIS_POSITION_("text-emphasis-position", "text-emphasis-position", ff("over right")), /** The style property {@code textEmphasisStyle}. */ - TEXT_EMPHASIS_STYLE("textEmphasisStyle", "text-emphasis-style", ff52up("none")), + TEXT_EMPHASIS_STYLE("textEmphasisStyle", "text-emphasis-style", ff("none")), /** The style property {@code text-emphasis-style}. */ - TEXT_EMPHASIS_STYLE_("text-emphasis-style", "text-emphasis-style", ff52up("none")), + TEXT_EMPHASIS_STYLE_("text-emphasis-style", "text-emphasis-style", ff("none")), /** The style property {@code textIndent}. */ TEXT_INDENT("textIndent", "text-indent", chrome("0px"), ff(""), ie("")), @@ -2778,7 +3227,10 @@ public enum Definition { TEXT_INDENT_("text-indent", "text-indent", ff("0px")), /** The style property {@code textJustify}. */ - TEXT_JUSTIFY("textJustify", "text-justify", ie("auto")), + TEXT_JUSTIFY("textJustify", "text-justify", ie("auto"), ff("auto")), + + /** The style property {@code text-justify}. */ + TEXT_JUSTIFY_("text-justify", "text-justify", ff("auto")), /** The style property {@code textJustifyTrim}. */ TEXT_JUSTIFY_TRIM("textJustifyTrim", "text-justify-trim", ie("undefined")), @@ -2829,23 +3281,26 @@ public enum Definition { TOP("top", "top", ff("auto"), ie("auto"), chrome("auto")), /** The style property {@code touchAction}. */ - TOUCH_ACTION("touchAction", "touch-action", ie("auto"), chrome("auto"), ff52up("auto")), + TOUCH_ACTION("touchAction", "touch-action", ie("auto"), chrome("auto"), ff("auto")), /** The style property {@code touch-action}. */ - TOUCH_ACTION_("touch-action", "touch-action", ff52up("auto")), + TOUCH_ACTION_("touch-action", "touch-action", ff("auto")), /** The style property {@code transform}. */ TRANSFORM("transform", "transform", ff("none"), ie("none"), chrome("none")), /** The style property {@code transformBox}. */ - TRANSFORM_BOX("transformBox", "transform-box", chrome("view-box")), + TRANSFORM_BOX("transformBox", "transform-box", chrome("view-box"), ff("border-box")), + + /** The style property {@code transform-box}. */ + TRANSFORM_BOX_("transform-box", "transform-box", ff("border-box")), /** The style property {@code transformOrigin}. */ TRANSFORM_ORIGIN("transformOrigin", "transform-origin", - ffBelow52("705px 172.5px"), ff52up("625px 172.5px"), ie("620px 163.2px"), chrome("456.5px 161px")), + ffBelow68("625px 172.5px"), ff68up("621px 171.5px"), ie("620px 163.2px"), chrome("456.5px 161px")), /** The style property {@code transform-origin}. */ - TRANSFORM_ORIGIN_("transform-origin", "transform-origin", ffBelow52("705px 172.5px"), ff52up("625px 172.5px")), + TRANSFORM_ORIGIN_("transform-origin", "transform-origin", ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code transformStyle}. */ TRANSFORM_STYLE("transformStyle", "transform-style", ff("flat"), ie("flat"), chrome("flat")), @@ -2887,10 +3342,10 @@ public enum Definition { /** The style property {@code unicodeBidi}. */ UNICODE_BIDI("unicodeBidi", "unicode-bidi", - ffBelow52("-moz-isolate"), ff52up("isolate"), ie("normal"), chrome("normal")), + ff("isolate"), ie("normal"), chrome("normal")), /** The style property {@code unicode-bidi}. */ - UNICODE_BIDI_("unicode-bidi", "unicode-bidi", ffBelow52("-moz-isolate"), ff52up("isolate")), + UNICODE_BIDI_("unicode-bidi", "unicode-bidi", ff("isolate")), /** The style property {@code unicodeRange}. */ UNICODE_RANGE("unicodeRange", "unicode-range", chrome("")), @@ -2923,163 +3378,177 @@ public enum Definition { VOLUME("volume", "volume"), /** The style property {@code webkitAlignContent}. */ - WEBKIT_ALIGN_CONTENT("webkitAlignContent", "webkit-align-content", ff52up("normal")), + WEBKIT_ALIGN_CONTENT("webkitAlignContent", "webkit-align-content", chrome("normal"), ff("normal")), /** The style property {@code WebkitAlignContent}. */ - WEBKIT_ALIGN_CONTENT_("WebkitAlignContent", "webkit-align-content", ff52up("normal")), + WEBKIT_ALIGN_CONTENT_("WebkitAlignContent", "webkit-align-content", ff("normal")), /** The style property {@code -webkit-align-content}. */ - WEBKIT_ALIGN_CONTENT__("-webkit-align-content", "webkit-align-content", ff52up("normal")), + WEBKIT_ALIGN_CONTENT__("-webkit-align-content", "webkit-align-content", ff("normal")), /** The style property {@code webkitAlignItems}. */ - WEBKIT_ALIGN_ITEMS("webkitAlignItems", "webkit-align-items", ff52up("normal")), + WEBKIT_ALIGN_ITEMS("webkitAlignItems", "webkit-align-items", chrome("normal"), ff("normal")), /** The style property {@code WebkitAlignItems}. */ - WEBKIT_ALIGN_ITEMS_("WebkitAlignItems", "webkit-align-items", ff52up("normal")), + WEBKIT_ALIGN_ITEMS_("WebkitAlignItems", "webkit-align-items", ff("normal")), /** The style property {@code -webkit-align-items}. */ - WEBKIT_ALIGN_ITEMS__("-webkit-align-items", "webkit-align-items", ff52up("normal")), + WEBKIT_ALIGN_ITEMS__("-webkit-align-items", "webkit-align-items", ff("normal")), /** The style property {@code webkitAlignSelf}. */ - WEBKIT_ALIGN_SELF("webkitAlignSelf", "webkit-align-self", ff52up("auto")), + WEBKIT_ALIGN_SELF("webkitAlignSelf", "webkit-align-self", chrome("auto"), ff("auto")), /** The style property {@code WebkitAlignSelf}. */ - WEBKIT_ALIGN_SELF_("WebkitAlignSelf", "webkit-align-self", ff52up("auto")), + WEBKIT_ALIGN_SELF_("WebkitAlignSelf", "webkit-align-self", ff("auto")), /** The style property {@code -webkit-align-self}. */ - WEBKIT_ALIGN_SELF__("-webkit-align-self", "webkit-align-self", ff52up("auto")), + WEBKIT_ALIGN_SELF__("-webkit-align-self", "webkit-align-self", ff("auto")), /** The style property {@code webkitAnimation}. */ - WEBKIT_ANIMATION("webkitAnimation", "webkit-animation", ff52up("")), + WEBKIT_ANIMATION("webkitAnimation", "webkit-animation", + chrome("none 0s ease 0s 1 normal none running"), ff("")), /** The style property {@code WebkitAnimation}. */ - WEBKIT_ANIMATION_("WebkitAnimation", "webkit-animation", ff52up("")), + WEBKIT_ANIMATION_("WebkitAnimation", "webkit-animation", ff("")), /** The style property {@code -webkit-animation}. */ - WEBKIT_ANIMATION__("-webkit-animation", "webkit-animation", ff52up("")), + WEBKIT_ANIMATION__("-webkit-animation", "webkit-animation", ff("")), /** The style property {@code webkitAnimationDelay}. */ - WEBKIT_ANIMATION_DELAY("webkitAnimationDelay", "webkit-animation-delay", ff52up("0s")), + WEBKIT_ANIMATION_DELAY("webkitAnimationDelay", "webkit-animation-delay", chrome("0s"), ff("0s")), /** The style property {@code WebkitAnimationDelay}. */ - WEBKIT_ANIMATION_DELAY_("WebkitAnimationDelay", "webkit-animation-delay", ff52up("0s")), + WEBKIT_ANIMATION_DELAY_("WebkitAnimationDelay", "webkit-animation-delay", ff("0s")), /** The style property {@code -webkit-animation-delay}. */ - WEBKIT_ANIMATION_DELAY__("-webkit-animation-delay", "webkit-animation-delay", ff52up("0s")), + WEBKIT_ANIMATION_DELAY__("-webkit-animation-delay", "webkit-animation-delay", ff("0s")), /** The style property {@code webkitAnimationDirection}. */ - WEBKIT_ANIMATION_DIRECTION("webkitAnimationDirection", "webkit-animation-direction", ff52up("normal")), + WEBKIT_ANIMATION_DIRECTION("webkitAnimationDirection", "webkit-animation-direction", + chrome("normal"), ff("normal")), /** The style property {@code WebkitAnimationDirection}. */ - WEBKIT_ANIMATION_DIRECTION_("WebkitAnimationDirection", "webkit-animation-direction", ff52up("normal")), + WEBKIT_ANIMATION_DIRECTION_("WebkitAnimationDirection", "webkit-animation-direction", ff("normal")), /** The style property {@code -webkit-animation-direction}. */ - WEBKIT_ANIMATION_DIRECTION__("-webkit-animation-direction", "webkit-animation-direction", ff52up("normal")), + WEBKIT_ANIMATION_DIRECTION__("-webkit-animation-direction", "webkit-animation-direction", ff("normal")), /** The style property {@code webkitAnimationDuration}. */ - WEBKIT_ANIMATION_DURATION("webkitAnimationDuration", "webkit-animation-duration", ff52up("0s")), + WEBKIT_ANIMATION_DURATION("webkitAnimationDuration", "webkit-animation-duration", chrome("0s"), ff("0s")), /** The style property {@code WebkitAnimationDuration}. */ - WEBKIT_ANIMATION_DURATION_("WebkitAnimationDuration", "webkit-animation-duration", ff52up("0s")), + WEBKIT_ANIMATION_DURATION_("WebkitAnimationDuration", "webkit-animation-duration", ff("0s")), /** The style property {@code -webkit-animation-duration}. */ - WEBKIT_ANIMATION_DURATION__("-webkit-animation-duration", "webkit-animation-duration", ff52up("0s")), + WEBKIT_ANIMATION_DURATION__("-webkit-animation-duration", "webkit-animation-duration", ff("0s")), /** The style property {@code webkitAnimationFillMode}. */ - WEBKIT_ANIMATION_FILL_MODE("webkitAnimationFillMode", "webkit-animation-fill-mode", ff52up("none")), + WEBKIT_ANIMATION_FILL_MODE("webkitAnimationFillMode", "webkit-animation-fill-mode", chrome("none"), ff("none")), /** The style property {@code WebkitAnimationFillMode}. */ - WEBKIT_ANIMATION_FILL_MODE_("WebkitAnimationFillMode", "webkit-animation-fill-mode", ff52up("none")), + WEBKIT_ANIMATION_FILL_MODE_("WebkitAnimationFillMode", "webkit-animation-fill-mode", ff("none")), /** The style property {@code -webkit-animation-fill-mode}. */ - WEBKIT_ANIMATION_FILL_MODE__("-webkit-animation-fill-mode", "webkit-animation-fill-mode", ff52up("none")), + WEBKIT_ANIMATION_FILL_MODE__("-webkit-animation-fill-mode", "webkit-animation-fill-mode", ff("none")), /** The style property {@code webkitAnimationIterationCount}. */ WEBKIT_ANIMATION_ITERATION_COUNT("webkitAnimationIterationCount", "webkit-animation-iteration-count", - ff52up("1")), + chrome("1"), ff("1")), /** The style property {@code WebkitAnimationIterationCount}. */ WEBKIT_ANIMATION_ITERATION_COUNT_("WebkitAnimationIterationCount", "webkit-animation-iteration-count", - ff52up("1")), + ff("1")), /** The style property {@code -webkit-animation-iteration-count}. */ WEBKIT_ANIMATION_ITERATION_COUNT__("-webkit-animation-iteration-count", "webkit-animation-iteration-count", - ff52up("1")), + ff("1")), /** The style property {@code webkitAnimationName}. */ - WEBKIT_ANIMATION_NAME("webkitAnimationName", "webkit-animation-name", ff52up("none")), + WEBKIT_ANIMATION_NAME("webkitAnimationName", "webkit-animation-name", chrome("none"), ff("none")), /** The style property {@code WebkitAnimationName}. */ - WEBKIT_ANIMATION_NAME_("WebkitAnimationName", "webkit-animation-name", ff52up("none")), + WEBKIT_ANIMATION_NAME_("WebkitAnimationName", "webkit-animation-name", ff("none")), /** The style property {@code -webkit-animation-name}. */ - WEBKIT_ANIMATION_NAME__("-webkit-animation-name", "webkit-animation-name", ff52up("none")), + WEBKIT_ANIMATION_NAME__("-webkit-animation-name", "webkit-animation-name", ff("none")), /** The style property {@code webkitAnimationPlayState}. */ - WEBKIT_ANIMATION_PLAY_STATE("webkitAnimationPlayState", "webkit-animation-play-state", ff52up("running")), + WEBKIT_ANIMATION_PLAY_STATE("webkitAnimationPlayState", "webkit-animation-play-state", + chrome("running"), ff("running")), /** The style property {@code WebkitAnimationPlayState}. */ - WEBKIT_ANIMATION_PLAY_STATE_("WebkitAnimationPlayState", "webkit-animation-play-state", ff52up("running")), + WEBKIT_ANIMATION_PLAY_STATE_("WebkitAnimationPlayState", "webkit-animation-play-state", ff("running")), /** The style property {@code -webkit-animation-play-state}. */ - WEBKIT_ANIMATION_PLAY_STATE__("-webkit-animation-play-state", "webkit-animation-play-state", ff52up("running")), + WEBKIT_ANIMATION_PLAY_STATE__("-webkit-animation-play-state", "webkit-animation-play-state", ff("running")), /** The style property {@code webkitAnimationTimingFunction}. */ WEBKIT_ANIMATION_TIMING_FUNCTION("webkitAnimationTimingFunction", "webkit-animation-timing-function", - ff52up("ease")), + chrome("ease"), ff("ease")), /** The style property {@code WebkitAnimationTimingFunction}. */ WEBKIT_ANIMATION_TIMING_FUNCTION_("WebkitAnimationTimingFunction", "webkit-animation-timing-function", - ff52up("ease")), + ff("ease")), /** The style property {@code -webkit-animation-timing-function}. */ WEBKIT_ANIMATION_TIMING_FUNCTION__("-webkit-animation-timing-function", "webkit-animation-timing-function", - ff52up("ease")), + ff("ease")), /** The style property {@code webkitAppRegion}. */ - WEBKIT_APP_REGION("webkitAppRegion", "webkit-app-region", chrome("no-drag")), + WEBKIT_APP_REGION("webkitAppRegion", "webkit-app-region", chrome("none")), /** The style property {@code webkitAppearance}. */ - WEBKIT_APPEARANCE("webkitAppearance", "webkit-appearance", chrome("none")), + WEBKIT_APPEARANCE("webkitAppearance", "webkit-appearance", chrome("none"), ff68up("none")), + + /** The style property {@code WebkitAppearance}. */ + WEBKIT_APPEARANCE_("WebkitAppearance", "webkit-appearance", ff68up("none")), + + /** The style property {@code -webkit-appearance}. */ + WEBKIT_APPEARANCE__("-webkit-appearance", "webkit-appearance", ff68up("none")), /** The style property {@code webkitBackfaceVisibility}. */ WEBKIT_BACKFACE_VISIBILITY("webkitBackfaceVisibility", "webkit-backface-visibility", - ff52up("visible")), + chrome("visible"), ff("visible")), /** The style property {@code WebkitBackfaceVisibility}. */ WEBKIT_BACKFACE_VISIBILITY_("WebkitBackfaceVisibility", "webkit-backface-visibility", - ff52up("visible")), + ff("visible")), /** The style property {@code -webkit-backface-visibility}. */ WEBKIT_BACKFACE_VISIBILITY__("-webkit-backface-visibility", "webkit-backface-visibility", - ff52up("visible")), + ff("visible")), /** The style property {@code webkitBackgroundClip}. */ - WEBKIT_BACKGROUND_CLIP("webkitBackgroundClip", "webkit-background-clip", ff52up("border-box")), + WEBKIT_BACKGROUND_CLIP("webkitBackgroundClip", "webkit-background-clip", + chrome("border-box"), ff("border-box")), /** The style property {@code WebkitBackgroundClip}. */ - WEBKIT_BACKGROUND_CLIP_("WebkitBackgroundClip", "webkit-background-clip", ff52up("border-box")), + WEBKIT_BACKGROUND_CLIP_("WebkitBackgroundClip", "webkit-background-clip", ff("border-box")), /** The style property {@code -webkit-background-clip}. */ - WEBKIT_BACKGROUND_CLIP__("-webkit-background-clip", "webkit-background-clip", ff52up("border-box")), + WEBKIT_BACKGROUND_CLIP__("-webkit-background-clip", "webkit-background-clip", ff("border-box")), /** The style property {@code webkitBackgroundOrigin}. */ - WEBKIT_BACKGROUND_ORIGIN("webkitBackgroundOrigin", "webkit-background-origin", ff52up("padding-box")), + WEBKIT_BACKGROUND_ORIGIN("webkitBackgroundOrigin", "webkit-background-origin", + chrome("padding-box"), ff("padding-box")), /** The style property {@code WebkitBackgroundOrigin}. */ - WEBKIT_BACKGROUND_ORIGIN_("WebkitBackgroundOrigin", "webkit-background-origin", ff52up("padding-box")), + WEBKIT_BACKGROUND_ORIGIN_("WebkitBackgroundOrigin", "webkit-background-origin", ff("padding-box")), /** The style property {@code -webkit-background-origin}. */ - WEBKIT_BACKGROUND_ORIGIN__("-webkit-background-origin", "webkit-background-origin", ff52up("padding-box")), + WEBKIT_BACKGROUND_ORIGIN__("-webkit-background-origin", "webkit-background-origin", ff("padding-box")), /** The style property {@code webkitBackgroundSize}. */ - WEBKIT_BACKGROUND_SIZE("webkitBackgroundSize", "webkit-background-size", ff52up("auto auto")), + WEBKIT_BACKGROUND_SIZE("webkitBackgroundSize", "webkit-background-size", chrome("auto"), + ffBelow68("auto auto"), ff68up("auto")), /** The style property {@code WebkitBackgroundSize}. */ - WEBKIT_BACKGROUND_SIZE_("WebkitBackgroundSize", "webkit-background-size", ff52up("auto auto")), + WEBKIT_BACKGROUND_SIZE_("WebkitBackgroundSize", "webkit-background-size", + ffBelow68("auto auto"), ff68up("auto")), /** The style property {@code -webkit-background-size}. */ - WEBKIT_BACKGROUND_SIZE__("-webkit-background-size", "webkit-background-size", ff52up("auto auto")), + WEBKIT_BACKGROUND_SIZE__("-webkit-background-size", "webkit-background-size", + ffBelow68("auto auto"), ff68up("auto")), /** The style property {@code webkitBorderAfter}. */ WEBKIT_BORDER_AFTER("webkitBorderAfter", "webkit-border-after", chrome("0px none rgb(0, 0, 0)")), @@ -3107,27 +3576,27 @@ public enum Definition { /** The style property {@code webkitBorderBottomLeftRadius}. */ WEBKIT_BORDER_BOTTOM_LEFT_RADIUS("webkitBorderBottomLeftRadius", "webkit-border-bottom-left-radius", - ff52up("0px")), + chrome("0px"), ff("0px")), /** The style property {@code WebkitBorderBottomLeftRadius}. */ WEBKIT_BORDER_BOTTOM_LEFT_RADIUS_("WebkitBorderBottomLeftRadius", "webkit-border-bottom-left-radius", - ff52up("0px")), + ff("0px")), /** The style property {@code -webkit-border-bottom-left-radius}. */ WEBKIT_BORDER_BOTTOM_LEFT_RADIUS__("-webkit-border-bottom-left-radius", "webkit-border-bottom-left-radius", - ff52up("0px")), + ff("0px")), /** The style property {@code webkitBorderBottomRightRadius}. */ WEBKIT_BORDER_BOTTOM_RIGHT_RADIUS("webkitBorderBottomRightRadius", "webkit-border-bottom-right-radius", - ff52up("0px")), + chrome("0px"), ff("0px")), /** The style property {@code WebkitBorderBottomRightRadius}. */ WEBKIT_BORDER_BOTTOM_RIGHT_RADIUS_("WebkitBorderBottomRightRadius", "webkit-border-bottom-right-radius", - ff52up("0px")), + ff("0px")), /** The style property {@code -webkit-border-bottom-right-radius}. */ WEBKIT_BORDER_BOTTOM_RIGHT_RADIUS__("-webkit-border-bottom-right-radius", "webkit-border-bottom-right-radius", - ff52up("0px")), + ff("0px")), /** The style property {@code webkitBorderEnd}. */ WEBKIT_BORDER_END("webkitBorderEnd", "webkit-border-end", chrome("0px none rgb(0, 0, 0)")), @@ -3146,22 +3615,22 @@ public enum Definition { chrome("0px")), /** The style property {@code webkitBorderImage}. */ - WEBKIT_BORDER_IMAGE("webkitBorderImage", "webkit-border-image", chrome("none"), ff52up("")), + WEBKIT_BORDER_IMAGE("webkitBorderImage", "webkit-border-image", chrome("none"), ff("")), /** The style property {@code WebkitBorderImage}. */ - WEBKIT_BORDER_IMAGE_("WebkitBorderImage", "webkit-border-image", ff52up("")), + WEBKIT_BORDER_IMAGE_("WebkitBorderImage", "webkit-border-image", ff("")), /** The style property {@code -webkit-border-image}. */ - WEBKIT_BORDER_IMAGE__("-webkit-border-image", "webkit-border-image", ff52up("")), + WEBKIT_BORDER_IMAGE__("-webkit-border-image", "webkit-border-image", ff("")), /** The style property {@code webkitBorderRadius}. */ - WEBKIT_BORDER_RADIUS("webkitBorderRadius", "webkit-border-radius", ff52up("")), + WEBKIT_BORDER_RADIUS("webkitBorderRadius", "webkit-border-radius", chrome("0px"), ff("")), /** The style property {@code WebkitBorderRadius}. */ - WEBKIT_BORDER_RADIUS_("WebkitBorderRadius", "webkit-border-radius", ff52up("")), + WEBKIT_BORDER_RADIUS_("WebkitBorderRadius", "webkit-border-radius", ff("")), /** The style property {@code -webkit-border-radius}. */ - WEBKIT_BORDER_RADIUS__("-webkit-border-radius", "webkit-border-radius", ff52up("")), + WEBKIT_BORDER_RADIUS__("-webkit-border-radius", "webkit-border-radius", ff("")), /** The style property {@code webkitBorderStart}. */ WEBKIT_BORDER_START("webkitBorderStart", "webkit-border-start", chrome("0px none rgb(0, 0, 0)")), @@ -3176,111 +3645,116 @@ public enum Definition { WEBKIT_BORDER_START_WIDTH("webkitBorderStartWidth", "webkit-border-start-width", chrome("0px")), /** The style property {@code webkitBorderTopLeftRadius}. */ - WEBKIT_BORDER_TOP_LEFT_RADIUS("webkitBorderTopLeftRadius", "webkit-border-top-left-radius", ff52up("0px")), + WEBKIT_BORDER_TOP_LEFT_RADIUS("webkitBorderTopLeftRadius", "webkit-border-top-left-radius", + chrome("0px"), ff("0px")), /** The style property {@code WebkitBorderTopLeftRadius}. */ - WEBKIT_BORDER_TOP_LEFT_RADIUS_("WebkitBorderTopLeftRadius", "webkit-border-top-left-radius", ff52up("0px")), + WEBKIT_BORDER_TOP_LEFT_RADIUS_("WebkitBorderTopLeftRadius", "webkit-border-top-left-radius", ff("0px")), /** The style property {@code -webkit-border-top-left-radius}. */ WEBKIT_BORDER_TOP_LEFT_RADIUS__("-webkit-border-top-left-radius", "webkit-border-top-left-radius", - ff52up("0px")), + ff("0px")), /** The style property {@code webkitBorderTopRightRadius}. */ - WEBKIT_BORDER_TOP_RIGHT_RADIUS("webkitBorderTopRightRadius", "webkit-border-top-right-radius", ff52up("0px")), + WEBKIT_BORDER_TOP_RIGHT_RADIUS("webkitBorderTopRightRadius", "webkit-border-top-right-radius", + chrome("0px"), ff("0px")), /** The style property {@code WebkitBorderTopRightRadius}. */ - WEBKIT_BORDER_TOP_RIGHT_RADIUS_("WebkitBorderTopRightRadius", "webkit-border-top-right-radius", ff52up("0px")), + WEBKIT_BORDER_TOP_RIGHT_RADIUS_("WebkitBorderTopRightRadius", "webkit-border-top-right-radius", ff("0px")), /** The style property {@code -webkit-border-top-right-radius}. */ WEBKIT_BORDER_TOP_RIGHT_RADIUS__("-webkit-border-top-right-radius", "webkit-border-top-right-radius", - ff52up("0px")), + ff("0px")), /** The style property {@code webkitBorderVerticalSpacing}. */ WEBKIT_BORDER_VERTICAL_SPACING("webkitBorderVerticalSpacing", "webkit-border-vertical-spacing", chrome("0px")), /** The style property {@code webkitBoxAlign}. */ - WEBKIT_BOX_ALIGN("webkitBoxAlign", "webkit-box-align", chrome("stretch"), ff52up("stretch")), + WEBKIT_BOX_ALIGN("webkitBoxAlign", "webkit-box-align", chrome("stretch"), ff("stretch")), /** The style property {@code WebkitBoxAlign}. */ - WEBKIT_BOX_ALIGN_("WebkitBoxAlign", "webkit-box-align", ff52up("stretch")), + WEBKIT_BOX_ALIGN_("WebkitBoxAlign", "webkit-box-align", ff("stretch")), /** The style property {@code -webkit-box-align}. */ - WEBKIT_BOX_ALIGN__("-webkit-box-align", "webkit-box-align", ff52up("stretch")), + WEBKIT_BOX_ALIGN__("-webkit-box-align", "webkit-box-align", ff("stretch")), /** The style property {@code webkitBoxDecorationBreak}. */ WEBKIT_BOX_DECORATION_BREAK("webkitBoxDecorationBreak", "webkit-box-decoration-break", chrome("slice")), /** The style property {@code webkitBoxDirection}. */ - WEBKIT_BOX_DIRECTION("webkitBoxDirection", "webkit-box-direction", chrome("normal"), ff52up("normal")), + WEBKIT_BOX_DIRECTION("webkitBoxDirection", "webkit-box-direction", chrome("normal"), ff("normal")), /** The style property {@code WebkitBoxDirection}. */ - WEBKIT_BOX_DIRECTION_("WebkitBoxDirection", "webkit-box-direction", ff52up("normal")), + WEBKIT_BOX_DIRECTION_("WebkitBoxDirection", "webkit-box-direction", ff("normal")), /** The style property {@code -webkit-box-direction}. */ - WEBKIT_BOX_DIRECTION__("-webkit-box-direction", "webkit-box-direction", ff52up("normal")), + WEBKIT_BOX_DIRECTION__("-webkit-box-direction", "webkit-box-direction", ff("normal")), /** The style property {@code webkitBoxFlex}. */ - WEBKIT_BOX_FLEX("webkitBoxFlex", "webkit-box-flex", chrome("0"), ff52up("0")), + WEBKIT_BOX_FLEX("webkitBoxFlex", "webkit-box-flex", chrome("0"), ff("0")), /** The style property {@code WebkitBoxFlex}. */ - WEBKIT_BOX_FLEX_("WebkitBoxFlex", "webkit-box-flex", ff52up("0")), + WEBKIT_BOX_FLEX_("WebkitBoxFlex", "webkit-box-flex", ff("0")), /** The style property {@code -webkit-box-flex}. */ - WEBKIT_BOX_FLEX__("-webkit-box-flex", "webkit-box-flex", ff52up("0")), + WEBKIT_BOX_FLEX__("-webkit-box-flex", "webkit-box-flex", ff("0")), /** The style property {@code webkitBoxFlexGroup}. */ - WEBKIT_BOX_FLEX_GROUP("webkitBoxFlexGroup", "webkit-box-flex-group", chrome("1")), + WEBKIT_BOX_FLEX_GROUP("webkitBoxFlexGroup", "webkit-box-flex-group", chrome("1").setIteratable(false)), /** The style property {@code webkitBoxLines}. */ - WEBKIT_BOX_LINES("webkitBoxLines", "webkit-box-lines", chrome("single")), + WEBKIT_BOX_LINES("webkitBoxLines", "webkit-box-lines", chrome("single").setIteratable(false)), /** The style property {@code webkitBoxOrdinalGroup}. */ - WEBKIT_BOX_ORDINAL_GROUP("webkitBoxOrdinalGroup", "webkit-box-ordinal-group", chrome("1"), ff52up("1")), + WEBKIT_BOX_ORDINAL_GROUP("webkitBoxOrdinalGroup", "webkit-box-ordinal-group", chrome("1"), ff("1")), /** The style property {@code WebkitBoxOrdinalGroup}. */ - WEBKIT_BOX_ORDINAL_GROUP_("WebkitBoxOrdinalGroup", "webkit-box-ordinal-group", ff52up("1")), + WEBKIT_BOX_ORDINAL_GROUP_("WebkitBoxOrdinalGroup", "webkit-box-ordinal-group", ff("1")), /** The style property {@code -webkit-box-ordinal-group}. */ - WEBKIT_BOX_ORDINAL_GROUP__("-webkit-box-ordinal-group", "webkit-box-ordinal-group", ff52up("1")), + WEBKIT_BOX_ORDINAL_GROUP__("-webkit-box-ordinal-group", "webkit-box-ordinal-group", ff("1")), /** The style property {@code webkitBoxOrient}. */ - WEBKIT_BOX_ORIENT("webkitBoxOrient", "webkit-box-orient", chrome("horizontal"), ff52up("horizontal")), + WEBKIT_BOX_ORIENT("webkitBoxOrient", "webkit-box-orient", chrome("horizontal"), ff("horizontal")), /** The style property {@code WebkitBoxOrient}. */ - WEBKIT_BOX_ORIENT_("WebkitBoxOrient", "webkit-box-orient", ff52up("horizontal")), + WEBKIT_BOX_ORIENT_("WebkitBoxOrient", "webkit-box-orient", ff("horizontal")), /** The style property {@code -webkit-box-orient}. */ - WEBKIT_BOX_ORIENT__("-webkit-box-orient", "webkit-box-orient", ff52up("horizontal")), + WEBKIT_BOX_ORIENT__("-webkit-box-orient", "webkit-box-orient", ff("horizontal")), /** The style property {@code webkitBoxPack}. */ - WEBKIT_BOX_PACK("webkitBoxPack", "webkit-box-pack", chrome("start"), ff52up("start")), + WEBKIT_BOX_PACK("webkitBoxPack", "webkit-box-pack", chrome("start"), ff("start")), /** The style property {@code WebkitBoxPack}. */ - WEBKIT_BOX_PACK_("WebkitBoxPack", "webkit-box-pack", ff52up("start")), + WEBKIT_BOX_PACK_("WebkitBoxPack", "webkit-box-pack", ff("start")), /** The style property {@code -webkit-box-pack}. */ - WEBKIT_BOX_PACK__("-webkit-box-pack", "webkit-box-pack", ff52up("start")), + WEBKIT_BOX_PACK__("-webkit-box-pack", "webkit-box-pack", ff("start")), /** The style property {@code webkitBoxReflect}. */ WEBKIT_BOX_REFLECT("webkitBoxReflect", "webkit-box-reflect", chrome("none")), /** The style property {@code webkitBoxShadow}. */ - WEBKIT_BOX_SHADOW("webkitBoxShadow", "webkit-box-shadow", ff52up("none")), + WEBKIT_BOX_SHADOW("webkitBoxShadow", "webkit-box-shadow", chrome("none"), ff("none")), /** The style property {@code WebkitBoxShadow}. */ - WEBKIT_BOX_SHADOW_("WebkitBoxShadow", "webkit-box-shadow", ff52up("none")), + WEBKIT_BOX_SHADOW_("WebkitBoxShadow", "webkit-box-shadow", ff("none")), /** The style property {@code -webkit-box-shadow}. */ - WEBKIT_BOX_SHADOW__("-webkit-box-shadow", "webkit-box-shadow", ff52up("none")), + WEBKIT_BOX_SHADOW__("-webkit-box-shadow", "webkit-box-shadow", ff("none")), /** The style property {@code webkitBoxSizing}. */ - WEBKIT_BOX_SIZING("webkitBoxSizing", "webkit-box-sizing", ff52up("content-box")), + WEBKIT_BOX_SIZING("webkitBoxSizing", "webkit-box-sizing", chrome("content-box"), ff("content-box")), /** The style property {@code WebkitBoxSizing}. */ - WEBKIT_BOX_SIZING_("WebkitBoxSizing", "webkit-box-sizing", ff52up("content-box")), + WEBKIT_BOX_SIZING_("WebkitBoxSizing", "webkit-box-sizing", ff("content-box")), /** The style property {@code -webkit-box-sizing}. */ - WEBKIT_BOX_SIZING__("-webkit-box-sizing", "webkit-box-sizing", ff52up("content-box")), + WEBKIT_BOX_SIZING__("-webkit-box-sizing", "webkit-box-sizing", ff("content-box")), + + /** The style property {@code webkitClipPath}. */ + WEBKIT_CLIP_PATH("webkitClipPath", "webkit-clip-path", chrome("none")), /** The style property {@code webkitColumnBreakAfter}. */ WEBKIT_COLUMN_BREAK_AFTER("webkitColumnBreakAfter", "webkit-column-break-after", chrome("auto")), @@ -3291,77 +3765,107 @@ public enum Definition { /** The style property {@code webkitColumnBreakInside}. */ WEBKIT_COLUMN_BREAK_INSIDE("webkitColumnBreakInside", "webkit-column-break-inside", chrome("auto")), + /** The style property {@code webkitColumnCount}. */ + WEBKIT_COLUMN_COUNT("webkitColumnCount", "webkit-column-count", chrome("auto")), + + /** The style property {@code webkitColumnGap}. */ + WEBKIT_COLUMN_GAP("webkitColumnGap", "webkit-column-gap", chrome("normal")), + + /** The style property {@code webkitColumnRule}. */ + WEBKIT_COLUMN_RULE("webkitColumnRule", "webkit-column-rule", chrome("0px none rgb(0, 0, 0)")), + + /** The style property {@code webkitColumnRuleColor}. */ + WEBKIT_COLUMN_RULE_COLOR("webkitColumnRuleColor", "webkit-column-rule-color", chrome("rgb(0, 0, 0)")), + + /** The style property {@code webkitColumnRuleStyle}. */ + WEBKIT_COLUMN_RULE_STYLE("webkitColumnRuleStyle", "webkit-column-rule-style", chrome("none")), + + /** The style property {@code webkitColumnRuleWidth}. */ + WEBKIT_COLUMN_RULE_WIDTH("webkitColumnRuleWidth", "webkit-column-rule-width", chrome("0px")), + + /** The style property {@code webkitColumnSpan}. */ + WEBKIT_COLUMN_SPAN("webkitColumnSpan", "webkit-column-rule-span", chrome("none")), + + /** The style property {@code webkitColumnWidth}. */ + WEBKIT_COLUMN_WIDTH("webkitColumnWidth", "webkit-column-width", chrome("auto")), + + /** The style property {@code webkitColumns}. */ + WEBKIT_COLUMNS("webkitColumns", "webkit-columns", chrome("auto auto")), + /** The style property {@code webkitFilter}. */ - WEBKIT_FILTER("webkitFilter", "webkit-filter", ff52up("none")), + WEBKIT_FILTER("webkitFilter", "webkit-filter", chrome("none"), ff("none")), /** The style property {@code WebkitFilter}. */ - WEBKIT_FILTER_("WebkitFilter", "webkit-filter", ff52up("none")), + WEBKIT_FILTER_("WebkitFilter", "webkit-filter", ff("none")), /** The style property {@code -webkit-filter}. */ - WEBKIT_FILTER__("-webkit-filter", "webkit-filter", ff52up("none")), + WEBKIT_FILTER__("-webkit-filter", "webkit-filter", ff("none")), /** The style property {@code webkitFlex}. */ - WEBKIT_FLEX("webkitFlex", "webkit-flex", ff52up("")), + WEBKIT_FLEX("webkitFlex", "webkit-flex", chrome("0 1 auto"), ff("")), /** The style property {@code WebkitFlex}. */ - WEBKIT_FLEX_("WebkitFlex", "webkit-flex", ff52up("")), + WEBKIT_FLEX_("WebkitFlex", "webkit-flex", ff("")), /** The style property {@code -webkit-flex}. */ - WEBKIT_FLEX__("-webkit-flex", "webkit-flex", ff52up("")), + WEBKIT_FLEX__("-webkit-flex", "webkit-flex", ff("")), /** The style property {@code webkitFlexBasis}. */ - WEBKIT_FLEX_BASIS("webkitFlexBasis", "webkit-flex-basis", ff52up("auto")), + WEBKIT_FLEX_BASIS("webkitFlexBasis", "webkit-flex-basis", chrome("auto"), ff("auto")), /** The style property {@code WebkitFlexBasis}. */ - WEBKIT_FLEX_BASIS_("WebkitFlexBasis", "webkit-flex-basis", ff52up("auto")), + WEBKIT_FLEX_BASIS_("WebkitFlexBasis", "webkit-flex-basis", ff("auto")), /** The style property {@code -webkit-flex-basis}. */ - WEBKIT_FLEX_BASIS__("-webkit-flex-basis", "webkit-flex-basis", ff52up("auto")), + WEBKIT_FLEX_BASIS__("-webkit-flex-basis", "webkit-flex-basis", ff("auto")), /** The style property {@code webkitFlexDirection}. */ - WEBKIT_FLEX_DIRECTION("webkitFlexDirection", "webkit-flex-direction", ff52up("row")), + WEBKIT_FLEX_DIRECTION("webkitFlexDirection", "webkit-flex-direction", chrome("row"), ff("row")), /** The style property {@code WebkitFlexDirection}. */ - WEBKIT_FLEX_DIRECTION_("WebkitFlexDirection", "webkit-flex-direction", ff52up("row")), + WEBKIT_FLEX_DIRECTION_("WebkitFlexDirection", "webkit-flex-direction", ff("row")), /** The style property {@code -webkit-flex-direction}. */ - WEBKIT_FLEX_DIRECTION__("-webkit-flex-direction", "webkit-flex-direction", ff52up("row")), + WEBKIT_FLEX_DIRECTION__("-webkit-flex-direction", "webkit-flex-direction", ff("row")), /** The style property {@code webkitFlexFlow}. */ - WEBKIT_FLEX_FLOW("webkitFlexFlow", "webkit-flex-flow", ff52up("")), + WEBKIT_FLEX_FLOW("webkitFlexFlow", "webkit-flex-flow", chrome("row nowrap"), ff("")), /** The style property {@code WebkitFlexFlow}. */ - WEBKIT_FLEX_FLOW_("WebkitFlexFlow", "webkit-flex-flow", ff52up("")), + WEBKIT_FLEX_FLOW_("WebkitFlexFlow", "webkit-flex-flow", ff("")), /** The style property {@code -webkit-flex-flow}. */ - WEBKIT_FLEX_FLOW__("-webkit-flex-flow", "webkit-flex-flow", ff52up("")), + WEBKIT_FLEX_FLOW__("-webkit-flex-flow", "webkit-flex-flow", ff("")), /** The style property {@code webkitFlexGrow}. */ - WEBKIT_FLEX_GROW("webkitFlexGrow", "webkit-flex-grow", ff52up("0")), + WEBKIT_FLEX_GROW("webkitFlexGrow", "webkit-flex-grow", chrome("0"), ff("0")), /** The style property {@code WebkitFlexGrow}. */ - WEBKIT_FLEX_GROW_("WebkitFlexGrow", "webkit-flex-grow", ff52up("0")), + WEBKIT_FLEX_GROW_("WebkitFlexGrow", "webkit-flex-grow", ff("0")), /** The style property {@code -webkit-flex-grow}. */ - WEBKIT_FLEX_GROW__("-webkit-flex-grow", "webkit-flex-grow", ff52up("0")), + WEBKIT_FLEX_GROW__("-webkit-flex-grow", "webkit-flex-grow", ff("0")), /** The style property {@code webkitFlexShrink}. */ - WEBKIT_FLEX_SHRINK("webkitFlexShrink", "webkit-flex-shrink", ff52up("1")), + WEBKIT_FLEX_SHRINK("webkitFlexShrink", "webkit-flex-shrink", chrome("1"), ff("1")), /** The style property {@code WebkitFlexShrink}. */ - WEBKIT_FLEX_SHRINK_("WebkitFlexShrink", "webkit-flex-shrink", ff52up("1")), + WEBKIT_FLEX_SHRINK_("WebkitFlexShrink", "webkit-flex-shrink", ff("1")), /** The style property {@code -webkit-flex-shrink}. */ - WEBKIT_FLEX_SHRINK__("-webkit-flex-shrink", "webkit-flex-shrink", ff52up("1")), + WEBKIT_FLEX_SHRINK__("-webkit-flex-shrink", "webkit-flex-shrink", ff("1")), /** The style property {@code webkitFlexWrap}. */ - WEBKIT_FLEX_WRAP("webkitFlexWrap", "webkit-flex-wrap", ff52up("nowrap")), + WEBKIT_FLEX_WRAP("webkitFlexWrap", "webkit-flex-wrap", chrome("nowrap"), ff("nowrap")), /** The style property {@code WebkitFlexWrap}. */ - WEBKIT_FLEX_WRAP_("WebkitFlexWrap", "webkit-flex-wrap", ff52up("nowrap")), + WEBKIT_FLEX_WRAP_("WebkitFlexWrap", "webkit-flex-wrap", ff("nowrap")), /** The style property {@code -webkit-flex-wrap}. */ - WEBKIT_FLEX_WRAP__("-webkit-flex-wrap", "webkit-flex-wrap", ff52up("nowrap")), + WEBKIT_FLEX_WRAP__("-webkit-flex-wrap", "webkit-flex-wrap", ff("nowrap")), + + /** The style property {@code webkitFontFeatureSettings}. */ + WEBKIT_FONT_FEATURE_SETTINGS("webkitFontFeatureSettings", "webkit-font-feature-settings", chrome("normal")), /** The style property {@code webkitFontSizeDelta}. */ WEBKIT_FONT_SIZE_DELTA("webkitFontSizeDelta", "webkit-font-size-delta", chrome("")), @@ -3376,19 +3880,25 @@ public enum Definition { WEBKIT_HYPHENATE_CHARACTER("webkitHyphenateCharacter", "webkit-hyphenate-character", chrome("auto")), /** The style property {@code webkitJustifyContent}. */ - WEBKIT_JUSTIFY_CONTENT("webkitJustifyContent", "webkit-justify-content", ff52up("normal")), + WEBKIT_JUSTIFY_CONTENT("webkitJustifyContent", "webkit-justify-content", chrome("normal"), ff("normal")), /** The style property {@code WebkitJustifyContent}. */ - WEBKIT_JUSTIFY_CONTENT_("WebkitJustifyContent", "webkit-justify-content", ff52up("normal")), + WEBKIT_JUSTIFY_CONTENT_("WebkitJustifyContent", "webkit-justify-content", ff("normal")), /** The style property {@code -webkit-justify-content}. */ - WEBKIT_JUSTIFY_CONTENT__("-webkit-justify-content", "webkit-justify-content", ff52up("normal")), + WEBKIT_JUSTIFY_CONTENT__("-webkit-justify-content", "webkit-justify-content", ff("normal")), /** The style property {@code webkitLineBreak}. */ WEBKIT_LINE_BREAK("webkitLineBreak", "webkit-line-break", chrome("auto")), /** The style property {@code webkitLineClamp}. */ - WEBKIT_LINE_CLAMP("webkitLineClamp", "webkit-line-clamp", chrome("none")), + WEBKIT_LINE_CLAMP("webkitLineClamp", "webkit-line-clamp", chrome("none"), ff68up("none")), + + /** The style property {@code WebkitLineClamp}. */ + WEBKIT_LINE_CLAMP_("WebkitLineClamp", "webkit-line-clamp", ff68up("none")), + + /** The style property {@code -webkit-line-clamp}. */ + WEBKIT_LINE_CLAMP__("-webkit-line-clamp", "webkit-line-clamp", ff68up("none")), /** The style property {@code webkitLocale}. */ WEBKIT_LOCALE("webkitLocale", "webkit-locale", chrome("auto")), @@ -3429,7 +3939,13 @@ public enum Definition { WEBKIT_MARGIN_TOP_COLLAPSE("webkitMarginTopCollapse", "webkit-margin-top-collapse", chrome("collapse")), /** The style property {@code webkitMask}. */ - WEBKIT_MASK("webkitMask", "webkit-mask", chrome("")), + WEBKIT_MASK("webkitMask", "webkit-mask", chrome(""), ff("none")), + + /** The style property {@code WebkitMask}. */ + WEBKIT_MASK_("WebkitMask", "webkit-mask", ff("none")), + + /** The style property {@code -webkit-mask}. */ + WEBKIT_MASK__("-webkit-mask", "webkit-mask", ff("none")), /** The style property {@code webkitMaskBoxImage}. */ WEBKIT_MASK_BOX_IMAGE("webkitMaskBoxImage", "webkit-mask-box-image", chrome("none")), @@ -3450,28 +3966,76 @@ public enum Definition { WEBKIT_MASK_BOX_IMAGE_WIDTH("webkitMaskBoxImageWidth", "webkit-mask-box-image-width", chrome("auto")), /** The style property {@code webkitMaskClip}. */ - WEBKIT_MASK_CLIP("webkitMaskClip", "webkit-mask-clip", chrome("border-box")), + WEBKIT_MASK_CLIP("webkitMaskClip", "webkit-mask-clip", chrome("border-box"), ff("border-box")), + + /** The style property {@code WebkitMaskClip}. */ + WEBKIT_MASK_CLIP_("WebkitMaskClip", "webkit-mask-clip", ff("border-box")), + + /** The style property {@code -webkit-mask-clip}. */ + WEBKIT_MASK_CLIP__("-webkit-mask-clip", "webkit-mask-clip", ff("border-box")), /** The style property {@code webkitMaskComposite}. */ - WEBKIT_MASK_COMPOSITE("webkitMaskComposite", "webkit-mask-composite", chrome("source-over")), + WEBKIT_MASK_COMPOSITE("webkitMaskComposite", "webkit-mask-composite", chrome("source-over"), ff("add")), + + /** The style property {@code WebkitMaskComposite}. */ + WEBKIT_MASK_COMPOSITE_("WebkitMaskComposite", "webkit-mask-composite", ff("add")), + + /** The style property {@code -webkit-mask-composite}. */ + WEBKIT_MASK_COMPOSITE__("-webkit-mask-composite", "webkit-mask-composite", ff("add")), /** The style property {@code webkitMaskImage}. */ - WEBKIT_MASK_IMAGE("webkitMaskImage", "webkit-mask-image", chrome("none")), + WEBKIT_MASK_IMAGE("webkitMaskImage", "webkit-mask-image", chrome("none"), ff("none")), + + /** The style property {@code WebkitMaskImage}. */ + WEBKIT_MASK_IMAGE_("WebkitMaskImage", "webkit-mask-image", ff("none")), + + /** The style property {@code -webkit-mask-image}. */ + WEBKIT_MASK_IMAGE__("-webkit-mask-image", "webkit-mask-image", ff("none")), /** The style property {@code webkitMaskOrigin}. */ - WEBKIT_MASK_ORIGIN("webkitMaskOrigin", "webkit-mask-origin", chrome("border-box")), + WEBKIT_MASK_ORIGIN("webkitMaskOrigin", "webkit-mask-origin", chrome("border-box"), ff("border-box")), + + /** The style property {@code WebkitMaskOrigin}. */ + WEBKIT_MASK_ORIGIN_("WebkitMaskOrigin", "webkit-mask-origin", ff("border-box")), + + /** The style property {@code -webkit-mask-origin}. */ + WEBKIT_MASK_ORIGIN__("-webkit-mask-origin", "webkit-mask-origin", ff("border-box")), /** The style property {@code webkitMaskPosition}. */ - WEBKIT_MASK_POSITION("webkitMaskPosition", "webkit-mask-position", chrome("0% 0%")), + WEBKIT_MASK_POSITION("webkitMaskPosition", "webkit-mask-position", chrome("0% 0%"), ff("0% 0%")), + + /** The style property {@code WebkitMaskPosition}. */ + WEBKIT_MASK_POSITION_("WebkitMaskPosition", "webkit-mask-position", ff("0% 0%")), + + /** The style property {@code -webkit-mask-position}. */ + WEBKIT_MASK_POSITION__("-webkit-mask-position", "webkit-mask-position", ff("0% 0%")), /** The style property {@code webkitMaskPositionX}. */ - WEBKIT_MASK_POSITION_X("webkitMaskPositionX", "webkit-mask-position-x", chrome("0%")), + WEBKIT_MASK_POSITION_X("webkitMaskPositionX", "webkit-mask-position-x", chrome("0%"), ff("0%")), + + /** The style property {@code WebkitMaskPositionX}. */ + WEBKIT_MASK_POSITION_X_("WebkitMaskPositionX", "webkit-mask-position-x", ff("0%")), + + /** The style property {@code -webkit-mask-position-x}. */ + WEBKIT_MASK_POSITION_X__("-webkit-mask-position-x", "webkit-mask-position-x", ff("0%")), /** The style property {@code webkitMaskPositionY}. */ - WEBKIT_MASK_POSITION_Y("webkitMaskPositionY", "webkit-mask-position-y", chrome("0%")), + WEBKIT_MASK_POSITION_Y("webkitMaskPositionY", "webkit-mask-position-y", chrome("0%"), ff("0%")), + + /** The style property {@code WebkitMaskPositionY}. */ + WEBKIT_MASK_POSITION_Y_("WebkitMaskPositionY", "webkit-mask-position-y", ff("0%")), + + /** The style property {@code -webkit-mask-position-y}. */ + WEBKIT_MASK_POSITION_Y__("-webkit-mask-position-y", "webkit-mask-position-y", ff("0%")), /** The style property {@code webkitMaskRepeat}. */ - WEBKIT_MASK_REPEAT("webkitMaskRepeat", "webkit-mask-repeat", chrome("repeat")), + WEBKIT_MASK_REPEAT("webkitMaskRepeat", "webkit-mask-repeat", chrome("repeat"), ff("repeat")), + + /** The style property {@code WebkitMaskRepeat}. */ + WEBKIT_MASK_REPEAT_("WebkitMaskRepeat", "webkit-mask-repeat", ff("repeat")), + + /** The style property {@code -webkit-mask-repeat}. */ + WEBKIT_MASK_REPEAT__("-webkit-mask-repeat", "webkit-mask-repeat", ff("repeat")), /** The style property {@code webkitMaskRepeatX}. */ WEBKIT_MASK_REPEAT_X("webkitMaskRepeatX", "webkit-mask-repeat-x", chrome("")), @@ -3480,7 +4044,13 @@ public enum Definition { WEBKIT_MASK_REPEAT_Y("webkitMaskRepeatY", "webkit-mask-repeat-y", chrome("")), /** The style property {@code webkitMaskSize}. */ - WEBKIT_MASK_SIZE("webkitMaskSize", "webkit-mask-size", chrome("auto")), + WEBKIT_MASK_SIZE("webkitMaskSize", "webkit-mask-size", chrome("auto"), ffBelow68("auto auto"), ff68up("auto")), + + /** The style property {@code WebkitMaskSize}. */ + WEBKIT_MASK_SIZE_("WebkitMaskSize", "webkit-mask-size", ffBelow68("auto auto"), ff68up("auto")), + + /** The style property {@code -webkit-mask-size}. */ + WEBKIT_MASK_SIZE__("-webkit-mask-size", "webkit-mask-size", ffBelow68("auto auto"), ff68up("auto")), /** The style property {@code webkitMaxLogicalHeight}. */ WEBKIT_MAX_LOGICAL_HEIGHT("webkitMaxLogicalHeight", "webkit-max-logical-height", chrome("none")), @@ -3494,14 +4064,17 @@ public enum Definition { /** The style property {@code webkitMinLogicalWidth}. */ WEBKIT_MIN_LOGICAL_WIDTH("webkitMinLogicalWidth", "webkit-min-logical-width", chrome("0px")), + /** The style property {@code webkitOpacity}. */ + WEBKIT_OPACITY("webkitOpacity", "webkit-opacity", chrome("1")), + /** The style property {@code webkitOrder}. */ - WEBKIT_ORDER("webkitOrder", "webkit-order", ff52up("0")), + WEBKIT_ORDER("webkitOrder", "webkit-order", chrome("0"), ff("0")), /** The style property {@code WebkitOrder}. */ - WEBKIT_ORDER_("WebkitOrder", "webkit-order", ff52up("0")), + WEBKIT_ORDER_("WebkitOrder", "webkit-order", ff("0")), /** The style property {@code -webkit-order}. */ - WEBKIT_ORDER__("-webkit-order", "webkit-order", ff52up("0")), + WEBKIT_ORDER__("-webkit-order", "webkit-order", ff("0")), /** The style property {@code webkitPaddingAfter}. */ WEBKIT_PADDING_AFTER("webkitPaddingAfter", "webkit-padding-after", chrome("0px")), @@ -3516,22 +4089,25 @@ public enum Definition { WEBKIT_PADDING_START("webkitPaddingStart", "webkit-padding-start", chrome("0px")), /** The style property {@code webkitPerspective}. */ - WEBKIT_PERSPECTIVE("webkitPerspective", "webkit-perspective", ff52up("none")), + WEBKIT_PERSPECTIVE("webkitPerspective", "webkit-perspective", chrome("none"), ff("none")), /** The style property {@code WebkitPerspective}. */ - WEBKIT_PERSPECTIVE_("WebkitPerspective", "webkit-perspective", ff52up("none")), + WEBKIT_PERSPECTIVE_("WebkitPerspective", "webkit-perspective", ff("none")), /** The style property {@code -webkit-perspective}. */ - WEBKIT_PERSPECTIVE__("-webkit-perspective", "webkit-perspective", ff52up("none")), + WEBKIT_PERSPECTIVE__("-webkit-perspective", "webkit-perspective", ff("none")), /** The style property {@code webkitPerspectiveOrigin}. */ - WEBKIT_PERSPECTIVE_ORIGIN("webkitPerspectiveOrigin", "webkit-perspective-origin", ff52up("625px 172.5px")), + WEBKIT_PERSPECTIVE_ORIGIN("webkitPerspectiveOrigin", "webkit-perspective-origin", + chrome("456.5px 161px"), ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code WebkitPerspectiveOrigin}. */ - WEBKIT_PERSPECTIVE_ORIGIN_("WebkitPerspectiveOrigin", "webkit-perspective-origin", ff52up("625px 172.5px")), + WEBKIT_PERSPECTIVE_ORIGIN_("WebkitPerspectiveOrigin", "webkit-perspective-origin", + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code -webkit-perspective-origin}. */ - WEBKIT_PERSPECTIVE_ORIGIN__("-webkit-perspective-origin", "webkit-perspective-origin", ff52up("625px 172.5px")), + WEBKIT_PERSPECTIVE_ORIGIN__("-webkit-perspective-origin", "webkit-perspective-origin", + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code webkitPerspectiveOriginX}. */ WEBKIT_PERSPECTIVE_ORIGIN_X("webkitPerspectiveOriginX", "webkit-perspective-origin-x", chrome("")), @@ -3548,6 +4124,15 @@ public enum Definition { /** The style property {@code webkitRubyPosition}. */ WEBKIT_RUBY_POSITION("webkitRubyPosition", "webkit-ruby-position", chrome("before")), + /** The style property {@code webkitShapeImageThreshold}. */ + WEBKIT_SHAPE_IMAGE_THRESHOLD("webkitShapeImageThreshold", "webkit-shape-image-threshold", chrome("0")), + + /** The style property {@code webkitShapeMargin}. */ + WEBKIT_SHAPE_MARGIN("webkitShapeMargin", "webkit-shape-margin", chrome("0px")), + + /** The style property {@code webkitShapeOutside}. */ + WEBKIT_SHAPE_OUTSIDE("webkitShapeOutside", "webkit-shape-outside", chrome("none")), + /** The style property {@code webkitTapHighlightColor}. */ WEBKIT_TAP_HIGHLIGHT_COLOR("webkitTapHighlightColor", "webkit-tap-highlight-color", chrome("rgba(0, 0, 0, 0.18)")), @@ -3576,15 +4161,15 @@ public enum Definition { /** The style property {@code webkitTextFillColor}. */ WEBKIT_TEXT_FILL_COLOR("webkitTextFillColor", "webkit-text-fill-color", - chrome("rgb(0, 0, 0)"), ff52up("rgb(0, 0, 0)")), + chrome("rgb(0, 0, 0)"), ff("rgb(0, 0, 0)")), /** The style property {@code WebkitTextFillColor}. */ WEBKIT_TEXT_FILL_COLOR_("WebkitTextFillColor", "webkit-text-fill-color", - ff52up("rgb(0, 0, 0)")), + ff("rgb(0, 0, 0)")), /** The style property {@code -webkit-text-fill-color}. */ WEBKIT_TEXT_FILL_COLOR__("-webkit-text-fill-color", "webkit-text-fill-color", - ff52up("rgb(0, 0, 0)")), + ff("rgb(0, 0, 0)")), /** The style property {@code webkitTextOrientation}. */ WEBKIT_TEXT_ORIENTATION("webkitTextOrientation", "webkit-text-orientation", chrome("vertical-right")), @@ -3593,61 +4178,64 @@ public enum Definition { WEBKIT_TEXT_SECURITY("webkitTextSecurity", "webkit-text-security", chrome("none")), /** The style property {@code webkitTextSizeAdjust}. */ - WEBKIT_TEXT_SIZE_ADJUST("webkitTextSizeAdjust", "webkit-text-size-adjust", ff52up("auto")), + WEBKIT_TEXT_SIZE_ADJUST("webkitTextSizeAdjust", "webkit-text-size-adjust", chrome("auto"), ff("auto")), /** The style property {@code WebkitTextSizeAdjust}. */ - WEBKIT_TEXT_SIZE_ADJUST_("WebkitTextSizeAdjust", "webkit-text-size-adjust", ff52up("auto")), + WEBKIT_TEXT_SIZE_ADJUST_("WebkitTextSizeAdjust", "webkit-text-size-adjust", ff("auto")), /** The style property {@code -webkit-text-size-adjust}. */ - WEBKIT_TEXT_SIZE_ADJUST__("-webkit-text-size-adjust", "webkit-text-size-adjust", ff52up("auto")), + WEBKIT_TEXT_SIZE_ADJUST__("-webkit-text-size-adjust", "webkit-text-size-adjust", ff("auto")), /** The style property {@code webkitTextStroke}. */ - WEBKIT_TEXT_STROKE("webkitTextStroke", "webkit-text-stroke", chrome(""), ff52up("")), + WEBKIT_TEXT_STROKE("webkitTextStroke", "webkit-text-stroke", chrome(""), ff("")), /** The style property {@code WebkitTextStroke}. */ - WEBKIT_TEXT_STROKE_("WebkitTextStroke", "webkit-text-stroke", ff52up("")), + WEBKIT_TEXT_STROKE_("WebkitTextStroke", "webkit-text-stroke", ff("")), /** The style property {@code -webkit-text-stroke}. */ - WEBKIT_TEXT_STROKE__("-webkit-text-stroke", "webkit-text-stroke", ff52up("")), + WEBKIT_TEXT_STROKE__("-webkit-text-stroke", "webkit-text-stroke", ff("")), /** The style property {@code webkitTextStrokeColor}. */ WEBKIT_TEXT_STROKE_COLOR("webkitTextStrokeColor", "webkit-text-stroke-color", - chrome("rgb(0, 0, 0)"), ff52up("rgb(0, 0, 0)")), + chrome("rgb(0, 0, 0)"), ff("rgb(0, 0, 0)")), /** The style property {@code WebkitTextStrokeColor}. */ WEBKIT_TEXT_STROKE_COLOR_("WebkitTextStrokeColor", "webkit-text-stroke-color", - ff52up("rgb(0, 0, 0)")), + ff("rgb(0, 0, 0)")), /** The style property {@code -webkit-text-stroke-color}. */ WEBKIT_TEXT_STROKE_COLOR__("-webkit-text-stroke-color", "webkit-text-stroke-color", - ff52up("rgb(0, 0, 0)")), + ff("rgb(0, 0, 0)")), /** The style property {@code webkitTextStrokeWidth}. */ - WEBKIT_TEXT_STROKE_WIDTH("webkitTextStrokeWidth", "webkit-text-stroke-width", chrome("0px"), ff52up("0px")), + WEBKIT_TEXT_STROKE_WIDTH("webkitTextStrokeWidth", "webkit-text-stroke-width", chrome("0px"), ff("0px")), /** The style property {@code WebkitTextStrokeWidth}. */ - WEBKIT_TEXT_STROKE_WIDTH_("WebkitTextStrokeWidth", "webkit-text-stroke-width", ff52up("0px")), + WEBKIT_TEXT_STROKE_WIDTH_("WebkitTextStrokeWidth", "webkit-text-stroke-width", ff("0px")), /** The style property {@code -webkit-text-stroke-width}. */ - WEBKIT_TEXT_STROKE_WIDTH__("-webkit-text-stroke-width", "webkit-text-stroke-width", ff52up("0px")), + WEBKIT_TEXT_STROKE_WIDTH__("-webkit-text-stroke-width", "webkit-text-stroke-width", ff("0px")), /** The style property {@code webkitTransform}. */ - WEBKIT_TRANSFORM("webkitTransform", "webkit-transform", ff52up("none")), + WEBKIT_TRANSFORM("webkitTransform", "webkit-transform", chrome("none"), ff("none")), /** The style property {@code WebkitTransform}. */ - WEBKIT_TRANSFORM_("WebkitTransform", "webkit-transform", ff52up("none")), + WEBKIT_TRANSFORM_("WebkitTransform", "webkit-transform", ff("none")), /** The style property {@code -webkit-transform}. */ - WEBKIT_TRANSFORM__("-webkit-transform", "webkit-transform", ff52up("none")), + WEBKIT_TRANSFORM__("-webkit-transform", "webkit-transform", ff("none")), /** The style property {@code webkitTransformOrigin}. */ - WEBKIT_TRANSFORM_ORIGIN("webkitTransformOrigin", "webkit-transform-origin", ff52up("625px 172.5px")), + WEBKIT_TRANSFORM_ORIGIN("webkitTransformOrigin", "webkit-transform-origin", + chrome("620px 161px"), ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code WebkitTransformOrigin}. */ - WEBKIT_TRANSFORM_ORIGIN_("WebkitTransformOrigin", "webkit-transform-origin", ff52up("625px 172.5px")), + WEBKIT_TRANSFORM_ORIGIN_("WebkitTransformOrigin", "webkit-transform-origin", + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code -webkit-transform-origin}. */ - WEBKIT_TRANSFORM_ORIGIN__("-webkit-transform-origin", "webkit-transform-origin", ff52up("625px 172.5px")), + WEBKIT_TRANSFORM_ORIGIN__("-webkit-transform-origin", "webkit-transform-origin", + ffBelow68("625px 172.5px"), ff68up("621px 171.5px")), /** The style property {@code webkitTransformOriginX}. */ WEBKIT_TRANSFORM_ORIGIN_X("webkitTransformOriginX", "webkit-transform-origin-x", chrome("")), @@ -3659,61 +4247,61 @@ public enum Definition { WEBKIT_TRANSFORM_ORIGIN_Z("webkitTransformOriginZ", "webkit-transform-origin-z", chrome("")), /** The style property {@code webkitTransformStyle}. */ - WEBKIT_TRANSFORM_STYLE("webkitTransformStyle", "webkit-transform-style", ff52up("flat")), + WEBKIT_TRANSFORM_STYLE("webkitTransformStyle", "webkit-transform-style", chrome("flat"), ff("flat")), /** The style property {@code WebkitTransformStyle}. */ - WEBKIT_TRANSFORM_STYLE_("WebkitTransformStyle", "webkit-transform-style", ff52up("flat")), + WEBKIT_TRANSFORM_STYLE_("WebkitTransformStyle", "webkit-transform-style", ff("flat")), /** The style property {@code -webkit-transform-style}. */ - WEBKIT_TRANSFORM_STYLE__("-webkit-transform-style", "webkit-transform-style", ff52up("flat")), + WEBKIT_TRANSFORM_STYLE__("-webkit-transform-style", "webkit-transform-style", ff("flat")), /** The style property {@code webkitTransition}. */ - WEBKIT_TRANSITION("webkitTransition", "webkit-transition", ff52up("")), + WEBKIT_TRANSITION("webkitTransition", "webkit-transition", chrome("all 0s ease 0s"), ff("")), /** The style property {@code WebkitTransition}. */ - WEBKIT_TRANSITION_("WebkitTransition", "webkit-transition", ff52up("")), + WEBKIT_TRANSITION_("WebkitTransition", "webkit-transition", ff("")), /** The style property {@code -webkit-transition}. */ - WEBKIT_TRANSITION__("-webkit-transition", "webkit-transition", ff52up("")), + WEBKIT_TRANSITION__("-webkit-transition", "webkit-transition", ff("")), /** The style property {@code webkitTransitionDelay}. */ - WEBKIT_TRANSITION_DELAY("webkitTransitionDelay", "webkit-transition-delay", ff52up("0s")), + WEBKIT_TRANSITION_DELAY("webkitTransitionDelay", "webkit-transition-delay", chrome("0s"), ff("0s")), /** The style property {@code WebkitTransitionDelay}. */ - WEBKIT_TRANSITION_DELAY_("WebkitTransitionDelay", "webkit-transition-delay", ff52up("0s")), + WEBKIT_TRANSITION_DELAY_("WebkitTransitionDelay", "webkit-transition-delay", ff("0s")), /** The style property {@code -webkit-transition-delay}. */ - WEBKIT_TRANSITION_DELAY__("-webkit-transition-delay", "webkit-transition-delay", ff52up("0s")), + WEBKIT_TRANSITION_DELAY__("-webkit-transition-delay", "webkit-transition-delay", ff("0s")), /** The style property {@code webkitTransitionDuration}. */ - WEBKIT_TRANSITION_DURATION("webkitTransitionDuration", "webkit-transition-duration", ff52up("0s")), + WEBKIT_TRANSITION_DURATION("webkitTransitionDuration", "webkit-transition-duration", chrome("0s"), ff("0s")), /** The style property {@code WebkitTransitionDuration}. */ - WEBKIT_TRANSITION_DURATION_("WebkitTransitionDuration", "webkit-transition-duration", ff52up("0s")), + WEBKIT_TRANSITION_DURATION_("WebkitTransitionDuration", "webkit-transition-duration", ff("0s")), /** The style property {@code -webkit-transition-duration}. */ - WEBKIT_TRANSITION_DURATION__("-webkit-transition-duration", "webkit-transition-duration", ff52up("0s")), + WEBKIT_TRANSITION_DURATION__("-webkit-transition-duration", "webkit-transition-duration", ff("0s")), /** The style property {@code webkitTransitionProperty}. */ - WEBKIT_TRANSITION_PROPERTY("webkitTransitionProperty", "webkit-transition-property", ff52up("all")), + WEBKIT_TRANSITION_PROPERTY("webkitTransitionProperty", "webkit-transition-property", chrome("all"), ff("all")), /** The style property {@code WebkitTransitionProperty}. */ - WEBKIT_TRANSITION_PROPERTY_("WebkitTransitionProperty", "webkit-transition-property", ff52up("all")), + WEBKIT_TRANSITION_PROPERTY_("WebkitTransitionProperty", "webkit-transition-property", ff("all")), /** The style property {@code -webkit-transition-property}. */ - WEBKIT_TRANSITION_PROPERTY__("-webkit-transition-property", "webkit-transition-property", ff52up("all")), + WEBKIT_TRANSITION_PROPERTY__("-webkit-transition-property", "webkit-transition-property", ff("all")), /** The style property {@code webkitTransitionTimingFunction}. */ WEBKIT_TRANSITION_TIMING_FUNCTION("webkitTransitionTimingFunction", "webkit-transition-timing-function", - ff52up("ease")), + chrome("ease"), ff("ease")), /** The style property {@code WebkitTransitionTimingFunction}. */ WEBKIT_TRANSITION_TIMING_FUNCTION_("WebkitTransitionTimingFunction", "webkit-transition-timing-function", - ff52up("ease")), + ff("ease")), /** The style property {@code -webkit-transition-timing-function}. */ WEBKIT_TRANSITION_TIMING_FUNCTION__("-webkit-transition-timing-function", "webkit-transition-timing-function", - ff52up("ease")), + ff("ease")), /** The style property {@code webkitUserDrag}. */ WEBKIT_USER_DRAG("webkitUserDrag", "webkit-user-drag", chrome("auto")), @@ -3722,13 +4310,13 @@ public enum Definition { WEBKIT_USER_MODIFY("webkitUserModify", "webkit-user-modify", chrome("read-only")), /** The style property {@code webkitUserSelect}. */ - WEBKIT_USER_SELECT("webkitUserSelect", "webkit-user-select", ff52up("auto")), + WEBKIT_USER_SELECT("webkitUserSelect", "webkit-user-select", chrome("auto"), ff("auto")), /** The style property {@code WebkitUserSelect}. */ - WEBKIT_USER_SELECT_("WebkitUserSelect", "webkit-user-select", ff52up("auto")), + WEBKIT_USER_SELECT_("WebkitUserSelect", "webkit-user-select", ff("auto")), /** The style property {@code -webkit-user-select}. */ - WEBKIT_USER_SELECT__("-webkit-user-select", "webkit-user-select", ff52up("auto")), + WEBKIT_USER_SELECT__("-webkit-user-select", "webkit-user-select", ff("auto")), /** The style property {@code webkitWritingMode}. */ WEBKIT_WRITING_MODE("webkitWritingMode", "webkit-writing-mode", chrome("horizontal-tb")), diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleMedia.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleMedia.java index e760a8bf6fa..36b4da58632 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleMedia.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleMedia.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +15,12 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; -import org.w3c.dom.stylesheets.MediaList; - +import com.gargoylesoftware.css.dom.MediaListImpl; import com.gargoylesoftware.css.parser.CSSErrorHandler; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; @@ -31,15 +28,15 @@ * A JavaScript object for {@code StyleMedia}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass(isJSObject = false, value = CHROME) -@JsxClass({IE, EDGE}) +@JsxClass(IE) public class StyleMedia extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor(EDGE) public StyleMedia() { } @@ -60,7 +57,7 @@ public String getType() { @JsxFunction public boolean matchMedium(final String media) { final CSSErrorHandler errorHandler = getWindow().getWebWindow().getWebClient().getCssErrorHandler(); - final MediaList mediaList = CSSStyleSheet.parseMedia(errorHandler, media); + final MediaListImpl mediaList = CSSStyleSheet.parseMedia(errorHandler, media); return CSSStyleSheet.isActive(this, mediaList); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheet.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheet.java index c71ab5a4f8f..118a868b8f3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class StyleSheet extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public StyleSheet() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java index 74a12d9bd94..ec5db8d7812 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/StyleSheetList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,11 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_STYLESHEETLIST_ACTIVE_ONLY; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.apache.commons.lang3.StringUtils; -import org.w3c.dom.stylesheets.MediaList; +import com.gargoylesoftware.css.dom.MediaListImpl; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.HtmlAttributeChangeEvent; @@ -103,7 +102,7 @@ public boolean isActiveStyleSheetLink(final DomNode domNode) { return true; } final WebClient webClient = getWindow().getWebWindow().getWebClient(); - final MediaList mediaList = CSSStyleSheet.parseMedia(webClient.getCssErrorHandler(), media); + final MediaListImpl mediaList = CSSStyleSheet.parseMedia(webClient.getCssErrorHandler(), media); return CSSStyleSheet.isActive(this, mediaList); } } @@ -113,7 +112,7 @@ public boolean isActiveStyleSheetLink(final DomNode domNode) { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public StyleSheetList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java index 3b6f0f241a5..44b71c81c9a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/WebKitCSSMatrix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,20 +15,20 @@ package com.gargoylesoftware.htmlunit.javascript.host.css; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.dom.DOMMatrix; /** * A JavaScript object for {@code WebKitCSSMatrix}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, EDGE, FF52}) -public class WebKitCSSMatrix extends SimpleScriptable { +@JsxClass({CHROME, FF}) +public class WebKitCSSMatrix extends DOMMatrix { /** * Creates an instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/package-info.java index dbbf720281e..c1821a6ab14 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/css/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java index 417e839ee66..43bdaad061d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/AbstractList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Attr.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Attr.java index d0e3cfdaf58..aeae85f6330 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Attr.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Attr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ATTR_FIRST_LAST_CHILD_RETURNS_NULL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -49,7 +48,7 @@ public class Attr extends Node { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Attr() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CDATASection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CDATASection.java index 8d222417ba9..ddb9a0cb10d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CDATASection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CDATASection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomCDataSection; @@ -33,7 +32,7 @@ public class CDATASection extends Text { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CDATASection() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CharacterData.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CharacterData.java index 1f31d0425c7..76b99c4ef19 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CharacterData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CharacterData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOM_CDATA_DELETE_THROWS_NEGATIVE_COUNT; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomCharacterData; @@ -45,7 +44,7 @@ public class CharacterData extends Node { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CharacterData() { } @@ -183,7 +182,7 @@ public Element getPreviousElementSibling() { * {@inheritDoc} */ @Override - @JsxFunction({CHROME, FF, EDGE}) + @JsxFunction({CHROME, FF}) public void remove() { super.remove(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Comment.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Comment.java index 4cc19d6d158..b0c1d2cc68b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Comment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Comment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -42,7 +41,7 @@ public class Comment extends CharacterData { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Comment() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CustomElementRegistry.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CustomElementRegistry.java index dbd2e54cf36..fcb59fe3773 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CustomElementRegistry.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/CustomElementRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code CustomElementRegistry}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF68}) public class CustomElementRegistry extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java index 54cfe3f0deb..ffcbfdd47ef 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMCursor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.dom; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -24,8 +24,9 @@ * A JavaScript object for {@code DOMCursor}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class DOMCursor extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMError.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMError.java index 0b384daec15..5b250e16732 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class DOMError extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DOMError() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMException.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMException.java index c6c0794e3c4..51ee0e9b19c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMException.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -128,7 +127,7 @@ public class DOMException extends SimpleScriptable { /** * Default constructor used to build the prototype. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DOMException() { code_ = -1; message_ = null; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementation.java index e355285fe81..74231378ea0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMImplementation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMIMPLEMENTATION_FEATURE_VIEWS_3; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMIMPLEMENTATION_FEATURE_XPATH; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.StringWebResponse; @@ -78,7 +77,7 @@ public class DOMImplementation extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DOMImplementation() { } @@ -262,7 +261,7 @@ public XMLDocument createDocument(final String namespaceURI, final String qualif */ @JsxFunction public HTMLDocument createHTMLDocument(final Object titleObj) { - if (titleObj == Undefined.instance + if (Undefined.isUndefined(titleObj) && getBrowserVersion().hasFeature(JS_DOMIMPLEMENTATION_CREATE_HTMLDOCOMENT_REQUIRES_TITLE)) { throw Context.reportRuntimeError("Title is required"); } @@ -284,7 +283,7 @@ && getBrowserVersion().hasFeature(JS_DOMIMPLEMENTATION_CREATE_HTMLDOCOMENT_REQUI final HTMLHeadElement head = (HTMLHeadElement) document.createElement("head"); html.appendChild(head); - if (titleObj != Undefined.instance) { + if (!Undefined.isUndefined(titleObj)) { final HTMLTitleElement title = (HTMLTitleElement) document.createElement("title"); head.appendChild(title); title.setTextContent(Context.toString(titleObj)); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrix.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrix.java index 13aa18b5a4b..0d06f12f72a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrix.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrixReadOnly.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrixReadOnly.java index b5f1fc675c6..8dbcb20fee2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrixReadOnly.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMMatrixReadOnly.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMParser.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMParser.java index af94cbda324..40d1cfc6791 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMParser.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument; +import com.gargoylesoftware.htmlunit.util.MimeType; import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.Undefined; @@ -55,11 +56,11 @@ public DOMParser() { */ @JsxFunction public XMLDocument parseFromString(final String str, final Object type) { - if (type == null || Undefined.instance == type) { + if (type == null || Undefined.isUndefined(type)) { throw Context.reportRuntimeError("Missing 'type' parameter"); } - if (!"text/html".equals(type) && !"text/xml".equals(type) && !"application/xml".equals(type) - && !"application/xhtml+xml".equals(type) && !"image/svg+xml".equals(type)) { + if (!MimeType.TEXT_HTML.equals(type) && !MimeType.TEXT_XML.equals(type) && !"application/xml".equals(type) + && !MimeType.APPLICATION_XHTML.equals(type) && !"image/svg+xml".equals(type)) { throw Context.reportRuntimeError("Invalid 'type' parameter: " + type); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPoint.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPoint.java index ac4e6778c9f..3861bcb4e96 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPoint.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPointReadOnly.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPointReadOnly.java index 4e041001116..e29de1013aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPointReadOnly.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMPointReadOnly.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRectReadOnly.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRectReadOnly.java index 4323805a64b..8a19da2dbd2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRectReadOnly.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRectReadOnly.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRequest.java index 5070c7e4095..c48e5a3a701 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java index 203319d777b..c00301c0a09 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMSettableTokenList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,22 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.dom; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code DOMSettableTokenList}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF45, IE, EDGE}) +@JsxClass(IE) public class DOMSettableTokenList extends DOMTokenList { /** * Creates an instance. */ - @JsxConstructor({FF, EDGE}) public DOMSettableTokenList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringList.java index 17c25219fbd..8da1582d2fd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class DOMStringList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DOMStringList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringMap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringMap.java index cef4a456da0..a4ea5da6b12 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMStringMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomElement; @@ -40,7 +39,7 @@ public final class DOMStringMap extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DOMStringMap() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenList.java index 3585e2d818a..3504b397d4c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DOMTokenList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,8 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMTOKENLIST_GET_NULL_IF_OUTSIDE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMTOKENLIST_LENGTH_IGNORES_DUPLICATES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_ADD; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_EDIT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_REMOVE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.HashSet; @@ -60,7 +58,7 @@ public class DOMTokenList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DOMTokenList() { } @@ -86,8 +84,8 @@ public int getLength() { final String[] parts = StringUtils.split(value, whitespaceChars()); if (getBrowserVersion().hasFeature(JS_DOMTOKENLIST_LENGTH_IGNORES_DUPLICATES)) { final HashSet elements = new HashSet<>(parts.length); - for (int i = 0; i < parts.length; i++) { - elements.add(parts[i]); + for (String part : parts) { + elements.add(part); } return elements.size(); } @@ -106,11 +104,7 @@ public String getDefaultValue(final Class hint) { if (node != null) { final DomAttr attr = (DomAttr) node.getAttributes().getNamedItem(attributeName_); if (attr != null) { - String value = attr.getValue(); - if (getBrowserVersion().hasFeature(JS_DOMTOKENLIST_REMOVE_WHITESPACE_CHARS_ON_EDIT)) { - value = String.join(" ", StringUtils.split(value, whitespaceChars())); - } - return value; + return String.join(" ", StringUtils.split(attr.getValue(), whitespaceChars())); } } return ""; @@ -179,7 +173,7 @@ public void remove(final String token) { if (from > 0) { result.append(value, 0, from); if (to < value.length()) { - result.append(" "); + result.append(' '); } } result.append(value, to, value.length()); @@ -270,9 +264,9 @@ private void updateAttribute(final String value) { DomAttr attr = (DomAttr) domNode.getAttributes().getNamedItem(attributeName_); if (null == attr) { attr = domNode.getPage().createAttribute(attributeName_); - domNode.setAttributeNode(attr); } attr.setValue(value); + domNode.setAttributeNode(attr); } private int position(final String value, final String token) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java index 8d487d7d54d..b99022a7607 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,27 +15,28 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONCLOSE_DOCUMENT_CREATE_NOT_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_BEFOREUNLOADEVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_HASHCHANGEEVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_KEY_EVENTS; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_MOUSEWHEELEVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_POINTEREVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_PROGRESSEVENT; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_TYPE_WHEELEVENT; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_APPLETS_NODELIST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_CHARSET_LOWERCASE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHORS_REQUIRES_NAME_OR_ID; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ELEMENT_STRICT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_DESIGN_MODE_INHERIT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_FORMS_FUNCTION_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SELECTION_RANGE_COUNT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SETTING_DOMAIN_THROWS_FOR_ABOUT_BLANK; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_SET_LOCATION_EXECUTED_IN_ANCHOR; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TREEWALKER_EXPAND_ENTITY_REFERENCES_FALSE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TREEWALKER_FILTER_FUNCTION_ONLY; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_GET_ELEMENT_BY_ID__ANY_ELEMENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.QUERYSELECTORALL_NOT_IN_QUIRKS; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import static com.gargoylesoftware.htmlunit.util.StringUtils.parseHttpDate; @@ -52,14 +53,17 @@ import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.xml.utils.PrefixResolver; +import org.w3c.dom.CDATASection; import org.w3c.dom.DOMException; import org.w3c.dom.DocumentType; +import org.w3c.dom.ProcessingInstruction; import com.gargoylesoftware.css.parser.CSSException; import com.gargoylesoftware.htmlunit.BrowserVersion; @@ -77,7 +81,7 @@ import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomText; import com.gargoylesoftware.htmlunit.html.FrameWindow; -import com.gargoylesoftware.htmlunit.html.HTMLParser; +import com.gargoylesoftware.htmlunit.html.Html; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlApplet; import com.gargoylesoftware.htmlunit.html.HtmlArea; @@ -96,8 +100,6 @@ import com.gargoylesoftware.htmlunit.html.UnknownElementFactory; import com.gargoylesoftware.htmlunit.html.impl.SimpleRange; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnly; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnlyStatus; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; @@ -111,23 +113,31 @@ import com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList; import com.gargoylesoftware.htmlunit.javascript.host.event.BeforeUnloadEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.CloseEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.CompositionEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.CustomEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.DragEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; +import com.gargoylesoftware.htmlunit.javascript.host.event.FocusEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.HashChangeEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.KeyboardEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.MessageEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.MouseEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.MouseWheelEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.MutationEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.PointerEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.PopStateEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.ProgressEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.SVGZoomEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.TextEvent; import com.gargoylesoftware.htmlunit.javascript.host.event.UIEvent; +import com.gargoylesoftware.htmlunit.javascript.host.event.WheelEvent; import com.gargoylesoftware.htmlunit.javascript.host.html.DocumentProxy; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLAnchorElement; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; import com.gargoylesoftware.htmlunit.util.EncodingSniffer; +import com.gargoylesoftware.htmlunit.xml.XmlPage; import net.sourceforge.htmlunit.corejs.javascript.Callable; import net.sourceforge.htmlunit.corejs.javascript.Context; @@ -204,6 +214,9 @@ public class Document extends Node { dom3EventMap.put("UIEvent", UIEvent.class); dom3EventMap.put("CustomEvent", CustomEvent.class); dom3EventMap.put("CloseEvent", CloseEvent.class); + dom3EventMap.put("CompositionEvent", CompositionEvent.class); + dom3EventMap.put("DragEvent", DragEvent.class); + dom3EventMap.put("TextEvent", TextEvent.class); SUPPORTED_DOM3_EVENT_TYPE_MAP = Collections.unmodifiableMap(dom3EventMap); final Map> additionalEventMap = new HashMap<>(); @@ -214,13 +227,17 @@ public class Document extends Node { additionalEventMap.put("PointerEvent", PointerEvent.class); additionalEventMap.put("PopStateEvent", PopStateEvent.class); additionalEventMap.put("ProgressEvent", ProgressEvent.class); + additionalEventMap.put("MouseWheelEvent", MouseWheelEvent.class); + additionalEventMap.put("FocusEvent", FocusEvent.class); + additionalEventMap.put("WheelEvent", WheelEvent.class); + additionalEventMap.put("SVGZoomEvent", SVGZoomEvent.class); SUPPORTED_VENDOR_EVENT_TYPE_MAP = Collections.unmodifiableMap(additionalEventMap); } /** * Static counter for {@link #uniqueID_}. */ - private static int UniqueID_Counter_ = 1; + private static AtomicInteger UniqueID_Counter_ = new AtomicInteger(1); private Window window_; private DOMImplementation implementation_; @@ -300,7 +317,7 @@ public class Document extends Node { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Document() { } @@ -335,20 +352,13 @@ public Location getLocation() { @JsxSetter public void setLocation(final String location) throws IOException { final Object event = getWindow().getEvent(); - boolean setLocation = true; if (event instanceof UIEvent) { final Object target = ((UIEvent) event).getTarget(); if (target instanceof HTMLAnchorElement) { final String href = ((HTMLAnchorElement) target).getHref(); - if (!href.isEmpty() - && !getBrowserVersion().hasFeature(JS_DOCUMENT_SET_LOCATION_EXECUTED_IN_ANCHOR)) { - setLocation = false; - } } } - if (setLocation) { - window_.setLocation(location); - } + window_.setLocation(location); } /** @@ -386,7 +396,7 @@ public Element getDocumentElement() { * Gets the JavaScript property {@code rootElement}. * @return the root node for the document */ - @JsxGetter({CHROME, FF52, IE}) + @JsxGetter public Element getRootElement() { return null; } @@ -651,20 +661,21 @@ else if (resolver instanceof PrefixResolver) { public Object createElement(String tagName) { Object result = NOT_FOUND; try { - final BrowserVersion browserVersion = getBrowserVersion(); - - if (browserVersion.hasFeature(JS_DOCUMENT_CREATE_ELEMENT_STRICT) - && (tagName.contains("<") || tagName.contains(">"))) { - LOG.info("createElement: Provided string '" - + tagName + "' contains an invalid character; '<' and '>' are not allowed"); + if (tagName.contains("<") || tagName.contains(">")) { + if (LOG.isInfoEnabled()) { + LOG.info("createElement: Provided string '" + + tagName + "' contains an invalid character; '<' and '>' are not allowed"); + } throw Context.reportRuntimeError("String contains an invalid character"); } - else if (tagName.startsWith("<") && tagName.endsWith(">")) { + else if (tagName.length() > 0 && tagName.charAt(0) == '<' && tagName.endsWith(">")) { tagName = tagName.substring(1, tagName.length() - 1); final Matcher matcher = TAG_NAME_PATTERN.matcher(tagName); if (!matcher.matches()) { - LOG.info("createElement: Provided string '" + tagName + "' contains an invalid character"); + if (LOG.isInfoEnabled()) { + LOG.info("createElement: Provided string '" + tagName + "' contains an invalid character"); + } throw Context.reportRuntimeError("String contains an invalid character"); } } @@ -730,8 +741,8 @@ public Object createElementNS(final String namespaceURI, final String qualifiedN throw Context.reportRuntimeError("XUL not available"); } - if (HTMLParser.XHTML_NAMESPACE.equals(namespaceURI) - || HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { + if (Html.XHTML_NAMESPACE.equals(namespaceURI) + || Html.SVG_NAMESPACE.equals(namespaceURI)) { element = getPage().createElementNS(namespaceURI, qualifiedName); } else { @@ -880,6 +891,14 @@ protected EffectOnCache getEffectOnCache(final HtmlAttributeChangeEvent event) { */ @JsxGetter({CHROME, IE}) public Object getApplets() { + if (getBrowserVersion().hasFeature(HTMLDOCUMENT_APPLETS_NODELIST)) { + return new NodeList(getDomNodeOrDie(), false) { + @Override + protected boolean isMatching(final DomNode node) { + return node instanceof HtmlApplet; + } + }; + } return new HTMLCollection(getDomNodeOrDie(), false) { @Override protected boolean isMatching(final DomNode node) { @@ -892,8 +911,7 @@ protected boolean isMatching(final DomNode node) { * Returns this document's {@code body} element. * @return this document's {@code body} element */ - @JsxGetter({CHROME, IE, EDGE}) - @CanSetReadOnly(CanSetReadOnlyStatus.EXCEPTION) + @JsxGetter({CHROME, IE}) public HTMLElement getBody() { final Page page = getPage(); if (page instanceof HtmlPage) { @@ -1076,7 +1094,9 @@ public boolean execCommand(final String cmd, final boolean userInterface, final if (!hasCommand(cmd, false)) { return false; } - LOG.warn("Nothing done for execCommand(" + cmd + ", ...) (feature not implemented)"); + if (LOG.isWarnEnabled()) { + LOG.warn("Nothing done for execCommand(" + cmd + ", ...) (feature not implemented)"); + } return true; } @@ -1088,7 +1108,7 @@ public boolean execCommand(final String cmd, final boolean userInterface, final @JsxGetter(IE) public String getUniqueID() { if (uniqueID_ == null) { - uniqueID_ = "ms__id" + UniqueID_Counter_++; + uniqueID_ = "ms__id" + Document.UniqueID_Counter_.getAndIncrement(); } return uniqueID_; } @@ -1099,10 +1119,6 @@ public String getUniqueID() { */ @JsxGetter(propertyName = "URL") public String getURL() { - if (!(getPage() instanceof HtmlPage)) { - // TODO: implement XmlPage.getUrl - return ""; - } return getPage().getUrl().toExternalForm(); } @@ -1190,15 +1206,25 @@ && getBrowserVersion().hasFeature(EVENT_ONCLOSE_DOCUMENT_CREATE_NOT_SUPPORTED)) && ("Events".equals(eventType) || "KeyEvents".equals(eventType) && getBrowserVersion().hasFeature(EVENT_TYPE_KEY_EVENTS) || "HashChangeEvent".equals(eventType) - && getBrowserVersion().hasFeature(EVENT_TYPE_HASHCHANGEEVENT) + && getBrowserVersion().hasFeature(EVENT_TYPE_HASHCHANGEEVENT) || "BeforeUnloadEvent".equals(eventType) - && getBrowserVersion().hasFeature(EVENT_TYPE_BEFOREUNLOADEVENT) + && getBrowserVersion().hasFeature(EVENT_TYPE_BEFOREUNLOADEVENT) + || "MouseWheelEvent".equals(eventType) + && getBrowserVersion().hasFeature(EVENT_TYPE_MOUSEWHEELEVENT) || "PointerEvent".equals(eventType) - && getBrowserVersion().hasFeature(EVENT_TYPE_POINTEREVENT) + && getBrowserVersion().hasFeature(EVENT_TYPE_POINTEREVENT) || "PopStateEvent".equals(eventType) || "ProgressEvent".equals(eventType) - && getBrowserVersion().hasFeature(EVENT_TYPE_PROGRESSEVENT))) { + && getBrowserVersion().hasFeature(EVENT_TYPE_PROGRESSEVENT) + || "FocusEvent".equals(eventType) + || "WheelEvent".equals(eventType) + && getBrowserVersion().hasFeature(EVENT_TYPE_WHEELEVENT))) { clazz = SUPPORTED_VENDOR_EVENT_TYPE_MAP.get(eventType); + + if (PopStateEvent.class == clazz + && getBrowserVersion().hasFeature(EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED)) { + clazz = null; + } } if (clazz == null) { Context.throwAsScriptRuntimeEx(new DOMException(DOMException.NOT_SUPPORTED_ERR, @@ -1968,7 +1994,7 @@ public void setTitle(final String title) { * {@inheritDoc} */ @Override - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public HTMLCollection getChildren() { return super.getChildren(); } @@ -2987,7 +3013,7 @@ public void setOnpointerleave(final Object onpointerleave) { * Returns the {@code onpointerlockchange} event handler for this element. * @return the {@code onpointerlockchange} event handler for this element */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnpointerlockchange() { return getEventHandler("pointerlockchange"); } @@ -2996,7 +3022,7 @@ public Function getOnpointerlockchange() { * Sets the {@code onpointerlockchange} event handler for this element. * @param onpointerlockchange the {@code onpointerlockchange} event handler for this element */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnpointerlockchange(final Object onpointerlockchange) { setEventHandler("pointerlockchange", onpointerlockchange); } @@ -3005,7 +3031,7 @@ public void setOnpointerlockchange(final Object onpointerlockchange) { * Returns the {@code onpointerlockerror} event handler for this element. * @return the {@code onpointerlockerror} event handler for this element */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOnpointerlockerror() { return getEventHandler("pointerlockerror"); } @@ -3014,7 +3040,7 @@ public Function getOnpointerlockerror() { * Sets the {@code onpointerlockerror} event handler for this element. * @param onpointerlockerror the {@code onpointerlockerror} event handler for this element */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOnpointerlockerror(final Object onpointerlockerror) { setEventHandler("pointerlockerror", onpointerlockerror); } @@ -3257,7 +3283,7 @@ public void setOnselect(final Object onselect) { * Returns the {@code onselectionchange} event handler for this element. * @return the {@code onselectionchange} event handler for this element */ - @JsxGetter({CHROME, IE, FF52}) + @JsxGetter({CHROME, IE}) public Function getOnselectionchange() { return getEventHandler("selectionchange"); } @@ -3266,7 +3292,7 @@ public Function getOnselectionchange() { * Sets the {@code onselectionchange} event handler for this element. * @param onselectionchange the {@code onselectionchange} event handler for this element */ - @JsxSetter({CHROME, IE, FF52}) + @JsxSetter({CHROME, IE}) public void setOnselectionchange(final Object onselectionchange) { setEventHandler("selectionchange", onselectionchange); } @@ -3275,7 +3301,7 @@ public void setOnselectionchange(final Object onselectionchange) { * Returns the {@code onselectstart} event handler for this element. * @return the {@code onselectstart} event handler for this element */ - @JsxGetter({CHROME, IE, FF52}) + @JsxGetter({CHROME, IE}) public Function getOnselectstart() { return getEventHandler("selectstart"); } @@ -3284,7 +3310,7 @@ public Function getOnselectstart() { * Sets the {@code onselectstart} event handler for this element. * @param onselectstart the {@code onselectstart} event handler for this element */ - @JsxSetter({CHROME, IE, FF52}) + @JsxSetter({CHROME, IE}) public void setOnselectstart(final Object onselectstart) { setEventHandler("selectstart", onselectstart); } @@ -3383,7 +3409,7 @@ public void setOntimeupdate(final Object ontimeupdate) { * Returns the {@code ontoggle} event handler for this element. * @return the {@code ontoggle} event handler for this element */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOntoggle() { return getEventHandler("toggle"); } @@ -3392,7 +3418,7 @@ public Function getOntoggle() { * Sets the {@code ontoggle} event handler for this element. * @param ontoggle the {@code ontoggle} event handler for this element */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOntoggle(final Object ontoggle) { setEventHandler("toggle", ontoggle); } @@ -3563,7 +3589,7 @@ public void setOnmozfullscreenerror(final Object onmozfullscreenerror) { * Returns the {@code onmozpointerlockchange} event handler for this element. * @return the {@code onmozpointerlockchange} event handler for this element */ - @JsxGetter(FF45) + @JsxGetter(FF60) public Function getOnmozpointerlockchange() { return getEventHandler("mozpointerlockchange"); } @@ -3572,7 +3598,7 @@ public Function getOnmozpointerlockchange() { * Sets the {@code onmozpointerlockchange} event handler for this element. * @param onmozpointerlockchange the {@code onmozpointerlockchange} event handler for this element */ - @JsxSetter(FF45) + @JsxSetter(FF60) public void setOnmozpointerlockchange(final Object onmozpointerlockchange) { setEventHandler("mozpointerlockchange", onmozpointerlockchange); } @@ -3581,7 +3607,7 @@ public void setOnmozpointerlockchange(final Object onmozpointerlockchange) { * Returns the {@code onmozpointerlockerror} event handler for this element. * @return the {@code onmozpointerlockerror} event handler for this element */ - @JsxGetter(FF45) + @JsxGetter(FF60) public Function getOnmozpointerlockerror() { return getEventHandler("mozpointerlockerror"); } @@ -3590,7 +3616,7 @@ public Function getOnmozpointerlockerror() { * Sets the {@code onmozpointerlockerror} event handler for this element. * @param onmozpointerlockerror the {@code onmozpointerlockerror} event handler for this element */ - @JsxSetter(FF45) + @JsxSetter(FF60) public void setOnmozpointerlockerror(final Object onmozpointerlockerror) { setEventHandler("mozpointerlockerror", onmozpointerlockerror); } @@ -4099,186 +4125,6 @@ public void setOndeactivate(final Object ondeactivate) { setEventHandler("deactivate", ondeactivate); } - /** - * Returns the {@code onanimationend} event handler. - * @return the {@code onanimationend} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationend() { - return getEventHandler("animationend"); - } - - /** - * Sets the {@code onanimationend} event handler. - * @param animationend the {@code onanimationend} event handler - */ - @JsxSetter(FF52) - public void setOnanimationend(final Object animationend) { - setEventHandler("animationend", animationend); - } - - /** - * Returns the {@code onanimationiteration} event handler. - * @return the {@code onanimationiteration} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationiteration() { - return getEventHandler("animationiteration"); - } - - /** - * Sets the {@code onanimationiteration} event handler. - * @param animationiteration the {@code onanimationiteration} event handler - */ - @JsxSetter(FF52) - public void setOnanimationiteration(final Object animationiteration) { - setEventHandler("animationiteration", animationiteration); - } - - /** - * Returns the {@code onanimationstart} event handler. - * @return the {@code onanimationstart} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationstart() { - return getEventHandler("animationstart"); - } - - /** - * Sets the {@code onanimationstart} event handler. - * @param animationstart the {@code onanimationstart} event handler - */ - @JsxSetter(FF52) - public void setOnanimationstart(final Object animationstart) { - setEventHandler("animationstart", animationstart); - } - - /** - * Returns the {@code ondragexit} event handler. - * @return the {@code ondragexit} event handler - */ - @JsxGetter(FF52) - public Function getOndragexit() { - return getEventHandler("dragexit"); - } - - /** - * Sets the {@code ondragexit} event handler. - * @param dragexit the {@code ondragexit} event handler - */ - @JsxSetter(FF52) - public void setOndragexit(final Object dragexit) { - setEventHandler("dragexit", dragexit); - } - - /** - * Returns the {@code onloadend} event handler. - * @return the {@code onloadend} event handler - */ - @JsxGetter(FF52) - public Function getOnloadend() { - return getEventHandler("loadend"); - } - - /** - * Sets the {@code onloadend} event handler. - * @param loadend the {@code onloadend} event handler - */ - @JsxSetter(FF52) - public void setOnloadend(final Object loadend) { - setEventHandler("loadend", loadend); - } - - /** - * Returns the {@code ontransitionend} event handler. - * @return the {@code ontransitionend} event handler - */ - @JsxGetter(FF52) - public Function getOntransitionend() { - return getEventHandler("transitionend"); - } - - /** - * Sets the {@code ontransitionend} event handler. - * @param transitionend the {@code ontransitionend} event handler - */ - @JsxSetter(FF52) - public void setOntransitionend(final Object transitionend) { - setEventHandler("transitionend", transitionend); - } - - /** - * Returns the {@code onwebkitanimationend} event handler. - * @return the {@code onwebkitanimationend} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationend() { - return getEventHandler("webkitanimationend"); - } - - /** - * Sets the {@code onwebkitanimationend} event handler. - * @param webkitanimationend the {@code onwebkitanimationend} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationend(final Object webkitanimationend) { - setEventHandler("webkitanimationend", webkitanimationend); - } - - /** - * Returns the {@code onwebkitanimationiteration} event handler. - * @return the {@code onwebkitanimationiteration} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationiteration() { - return getEventHandler("webkitanimationiteration"); - } - - /** - * Sets the {@code onwebkitanimationiteration} event handler. - * @param webkitanimationiteration the {@code onwebkitanimationiteration} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationiteration(final Object webkitanimationiteration) { - setEventHandler("webkitanimationiteration", webkitanimationiteration); - } - - /** - * Returns the {@code onwebkitanimationstart} event handler. - * @return the {@code onwebkitanimationstart} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationstart() { - return getEventHandler("webkitanimationstart"); - } - - /** - * Sets the {@code onwebkitanimationstart} event handler. - * @param webkitanimationstart the {@code onwebkitanimationstart} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationstart(final Object webkitanimationstart) { - setEventHandler("webkitanimationstart", webkitanimationstart); - } - - /** - * Returns the {@code onwebkittransitionend} event handler. - * @return the {@code onwebkittransitionend} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkittransitionend() { - return getEventHandler("webkittransitionend"); - } - - /** - * Sets the {@code onwebkittransitionend} event handler. - * @param webkittransitionend the {@code onwebkittransitionend} event handler - */ - @JsxSetter(FF52) - public void setOnwebkittransitionend(final Object webkittransitionend) { - setEventHandler("webkittransitionend", webkittransitionend); - } - /** * @return the {@code currentScript} */ @@ -4307,4 +4153,56 @@ public ScriptableObject getFonts() { } return fonts_; } + + @Override + protected boolean isReadOnlySettable(final String name, final Object value) { + if ("body".equals(name)) { + throw ScriptRuntime.typeError3("msg.set.prop.no.setter", name, getClassName(), Context.toString(value)); + } + return super.isReadOnlySettable(name, value); + } + + /** + * Returns the element with the specified ID, as long as it is an HTML element; {@code null} otherwise. + * @param id the ID to search for + * @return the element with the specified ID, as long as it is an HTML element; {@code null} otherwise + */ + @JsxFunction + public Object getElementById(final String id) { + final DomNode domNode = getDomNodeOrDie(); + final Object domElement = domNode.getFirstByXPath("//*[@id = \"" + id + "\"]"); + if (domElement != null) { + if (!(domNode instanceof XmlPage) || domElement instanceof HtmlElement + || getBrowserVersion().hasFeature(JS_XML_GET_ELEMENT_BY_ID__ANY_ELEMENT)) { + return ((DomElement) domElement).getScriptableObject(); + } + if (LOG.isDebugEnabled()) { + LOG.debug("getElementById(" + id + "): no HTML DOM node found with this ID"); + } + } + return null; + } + + /** + * Creates a new ProcessingInstruction. + * @param target the target + * @param data the data + * @return the new ProcessingInstruction + */ + @JsxFunction + public Object createProcessingInstruction(final String target, final String data) { + final ProcessingInstruction node = getPage().createProcessingInstruction(target, data); + return getScriptableFor(node); + } + + /** + * Creates a new createCDATASection. + * @param data the data + * @return the new CDATASection + */ + @JsxFunction + public Object createCDATASection(final String data) { + final CDATASection node = getPage().createCDATASection(data); + return getScriptableFor(node); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentFragment.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentFragment.java index 7100dfddbd0..00a36782a85 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentFragment.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,10 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import java.util.Iterator; + import com.gargoylesoftware.css.parser.CSSException; import com.gargoylesoftware.htmlunit.html.DomDocumentFragment; import com.gargoylesoftware.htmlunit.html.DomNode; @@ -29,6 +30,8 @@ import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCollection; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; +import net.sourceforge.htmlunit.corejs.javascript.Undefined; /** * A JavaScript object for {@code DocumentFragment}. @@ -45,7 +48,7 @@ public class DocumentFragment extends Node { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DocumentFragment() { } @@ -104,7 +107,13 @@ public Object getDefaultValue(final Class hint) { @Override @JsxGetter({CHROME, FF}) public int getChildElementCount() { - return super.getChildElementCount(); + int counter = 0; + final Iterator iterator = getDomNodeOrDie().getChildren().iterator(); + while (iterator.hasNext()) { + iterator.next(); + counter++; + } + return counter; } /** @@ -113,7 +122,10 @@ public int getChildElementCount() { @Override @JsxGetter({CHROME, FF}) public Element getFirstElementChild() { - return super.getFirstElementChild(); + for (DomNode child : getDomNodeOrDie().getChildren()) { + return (Element) child.getScriptableObject(); + } + return null; } /** @@ -122,16 +134,46 @@ public Element getFirstElementChild() { @Override @JsxGetter({CHROME, FF}) public Element getLastElementChild() { - return super.getLastElementChild(); + DomNode lastChild = null; + for (DomNode child : getDomNodeOrDie().getChildren()) { + lastChild = child; + } + + if (lastChild != null) { + return (Element) lastChild.getScriptableObject(); + } + return null; } /** * {@inheritDoc} */ @Override - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public HTMLCollection getChildren() { return super.getChildren(); } + /** + * Returns the element with the specified ID, or {@code null} if that element could not be found. + * @param id the ID to search for + * @return the element, or {@code null} if it could not be found + */ + @JsxFunction({CHROME, FF}) + public Object getElementById(final Object id) { + if (id == null || Undefined.isUndefined(id)) { + return null; + } + final String idString = ScriptRuntime.toString(id); + if (idString == null || idString.length() == 0) { + return null; + } + for (DomNode child : getDomNodeOrDie().getChildren()) { + final Element elem = (Element) child.getScriptableObject(); + if (idString.equals(elem.getId())) { + return elem; + } + } + return null; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentType.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentType.java index 0f985afb7f1..c6d0fe2b3d9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentType.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/DocumentType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCTYPE_ENTITIES_NULL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCTYPE_NOTATIONS_NULL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import org.apache.commons.lang3.StringUtils; @@ -50,7 +48,7 @@ public class DocumentType extends Node { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DocumentType() { } @@ -141,34 +139,7 @@ public Object getNotations() { * {@inheritDoc} */ @Override - @JsxGetter(FF45) - public Object getPrefix() { - return super.getPrefix(); - } - - /** - * {@inheritDoc} - */ - @Override - @JsxGetter(FF45) - public Object getLocalName() { - return super.getLocalName(); - } - - /** - * {@inheritDoc} - */ - @Override - @JsxGetter(FF45) - public Object getNamespaceURI() { - return super.getNamespaceURI(); - } - - /** - * {@inheritDoc} - */ - @Override - @JsxFunction({CHROME, FF, EDGE}) + @JsxFunction({CHROME, FF}) public void remove() { super.remove(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/IdleDeadline.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/IdleDeadline.java index c8124dc9c85..7751fbd9b22 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/IdleDeadline.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/IdleDeadline.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code IdleDeadline}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class IdleDeadline extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MediaList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MediaList.java index 81019b4747b..71dbc337020 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MediaList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MediaList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MEDIA_LIST_ALL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MEDIA_LIST_EMPTY_STRING; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.css.dom.MediaListImpl; @@ -40,12 +39,12 @@ @JsxClass public class MediaList extends SimpleScriptable { - private final org.w3c.dom.stylesheets.MediaList wrappedList_; + private final MediaListImpl wrappedList_; /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MediaList() { wrappedList_ = null; } @@ -55,7 +54,7 @@ public MediaList() { * @param parent the parent style * @param wrappedList the wrapped media list that this host object exposes */ - public MediaList(final CSSStyleSheet parent, final org.w3c.dom.stylesheets.MediaList wrappedList) { + public MediaList(final CSSStyleSheet parent, final MediaListImpl wrappedList) { wrappedList_ = wrappedList; setParentScope(parent); setPrototype(getPrototype(getClass())); @@ -71,7 +70,7 @@ public String item(final int index) { if (index < 0 || index >= getLength()) { return null; } - final MediaQuery mq = ((MediaListImpl) wrappedList_).mediaQuery(index); + final MediaQuery mq = wrappedList_.mediaQuery(index); return mq.toString(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationObserver.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationObserver.java index 9047fd5a448..57a2a4ca8d0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationObserver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationObserver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ public class MutationObserver extends SimpleScriptable implements HtmlAttributeC private Function function_; private Node node_; - private boolean childList_; private boolean attaributes_; private boolean attributeOldValue_; private NativeArray attributeFilter_; @@ -90,13 +89,14 @@ public void observe(final Node node, final NativeObject options) { node_ = node; attaributes_ = Boolean.TRUE.equals(options.get("attributes")); attributeOldValue_ = Boolean.TRUE.equals(options.get("attributeOldValue")); - childList_ = Boolean.TRUE.equals(options.get("childList")); characterData_ = Boolean.TRUE.equals(options.get("characterData")); characterDataOldValue_ = Boolean.TRUE.equals(options.get("characterDataOldValue")); subtree_ = Boolean.TRUE.equals(options.get("subtree")); attributeFilter_ = (NativeArray) options.get("attributeFilter"); - if (!attaributes_ && !childList_ && !characterData_) { + final boolean childList = Boolean.TRUE.equals(options.get("childList")); + + if (!attaributes_ && !childList && !characterData_) { throw Context.throwAsScriptRuntimeEx(new IllegalArgumentException( "One of childList, attributes, od characterData must be set")); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationRecord.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationRecord.java index 6334d837a96..e41039e879a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationRecord.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/MutationRecord.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -41,7 +40,7 @@ public class MutationRecord extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MutationRecord() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java index 987d2b6ce49..cdc663300f3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NODE_CONTAINS_RETURNS_FALSE_FOR_INVALID_ARG; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_NODE_INSERT_BEFORE_REF_OPTIONAL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.util.ArrayList; @@ -151,7 +148,7 @@ public class Node extends EventTarget { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Node() { // Empty. } @@ -333,7 +330,7 @@ protected Object insertBeforeImpl(final Object[] args) { // extract refChild final DomNode refChildNode; - if (refChildObject == Undefined.instance) { + if (Undefined.isUndefined(refChildObject)) { if (args.length == 2 || getBrowserVersion().hasFeature(JS_NODE_INSERT_BEFORE_REF_OPTIONAL)) { refChildNode = null; } @@ -479,7 +476,7 @@ public Object cloneNode(final boolean deep) { * * @return whether this node is the same node as the given one */ - @JsxFunction({CHROME, FF52, IE}) + @JsxFunction public boolean isSameNode(final Object other) { return other == this; } @@ -703,7 +700,7 @@ public boolean contains(final Object element) { * Returns the Base URI as a string. * @return the Base URI as a string */ - @JsxGetter({CHROME, FF, EDGE}) + @JsxGetter({CHROME, FF}) public String getBaseURI() { return getDomNodeOrDie().getBaseURI(); } @@ -721,7 +718,7 @@ public boolean hasAttributes() { * Returns the namespace prefix. * @return the namespace prefix */ - @JsxGetter({FF45, IE}) + @JsxGetter(IE) public Object getPrefix() { return getDomNodeOrDie().getPrefix(); } @@ -730,7 +727,7 @@ public Object getPrefix() { * Returns the local name of this attribute. * @return the local name of this attribute */ - @JsxGetter({FF45, IE}) + @JsxGetter(IE) public Object getLocalName() { return getDomNodeOrDie().getLocalName(); } @@ -739,7 +736,7 @@ public Object getLocalName() { * Returns the URI that identifies an XML namespace. * @return the URI that identifies an XML namespace */ - @JsxGetter({FF45, IE}) + @JsxGetter(IE) public Object getNamespaceURI() { return getDomNodeOrDie().getNamespaceURI(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeFilter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeFilter.java index 1bc6bfc20be..c89b33d335e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeFilter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -112,7 +111,7 @@ public class NodeFilter extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public NodeFilter() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeIterator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeIterator.java index f2889852d15..697a36f3559 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeIterator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.SgmlPage; @@ -40,7 +39,7 @@ public class NodeIterator extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public NodeIterator() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java index 1d26ebf898d..d0bc4816d8f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/NodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,23 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import java.util.ArrayList; import java.util.List; +import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.DomNode; +import com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory; import com.gargoylesoftware.htmlunit.javascript.HtmlUnitScriptable; +import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.host.Iterator; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; @@ -56,7 +58,7 @@ public class NodeList extends AbstractList { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public NodeList() { } @@ -109,7 +111,7 @@ public List getElements() { * Returns an {@link Iterator} allowing to go through all keys contained in this object. * @return an {@link Iterator} */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public Iterator keys() { final int length = getElements().size(); final List list = new ArrayList<>(); @@ -126,7 +128,7 @@ public Iterator keys() { * Returns an {@link Iterator} allowing to go through all keys contained in this object. * @return an {@link Iterator} */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public Iterator values() { final List list = getElements(); final Iterator object = new Iterator(ITERATOR_NAME, list.iterator()); @@ -139,7 +141,7 @@ public Iterator values() { * Returns an {@link Iterator} allowing to go through all key/value pairs contained in this object. * @return an {@link Iterator} */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public Iterator entries() { final List elements = getElements(); final Context context = Context.getCurrentContext(); @@ -167,20 +169,25 @@ private static void setIteratorPrototype(final Scriptable scriptable) { * Calls the {@code callback} given in parameter once for each value pair in the list, in insertion order. * @param callback function to execute for each element */ - @JsxFunction({CHROME, FF52}) + @JsxFunction({CHROME, FF}) public void forEach(final Object callback) { final List nodes = getElements(); - final Context context = Context.enter(); - try { - final Function function = (Function) callback; - final Scriptable scope = getParentScope(); - for (int i = 0; i < nodes.size(); i++) { - function.call(context, scope, this, new Object[] { - nodes.get(i).getScriptableObject(), i, this}); + + final WebClient client = getWindow().getWebWindow().getWebClient(); + final HtmlUnitContextFactory cf = ((JavaScriptEngine) client.getJavaScriptEngine()).getContextFactory(); + + final ContextAction contextAction = new ContextAction() { + @Override + public Object run(final Context cx) { + final Function function = (Function) callback; + final Scriptable scope = getParentScope(); + for (int i = 0; i < nodes.size(); i++) { + function.call(cx, scope, NodeList.this, new Object[] { + nodes.get(i).getScriptableObject(), i, NodeList.this}); + } + return null; } - } - finally { - Context.exit(); - } + }; + cf.call(contextAction); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ProcessingInstruction.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ProcessingInstruction.java index 988f68d99c7..3f7e8ac51df 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ProcessingInstruction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ProcessingInstruction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomProcessingInstruction; @@ -35,7 +34,7 @@ public class ProcessingInstruction extends CharacterData { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public ProcessingInstruction() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/RadioNodeList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/RadioNodeList.java index 70faf56b07e..bbb5f22878c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/RadioNodeList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/RadioNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Range.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Range.java index d78e452595a..f3ea96653ff 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Range.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Range.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.HashSet; @@ -25,7 +24,6 @@ import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.html.DomDocumentFragment; import com.gargoylesoftware.htmlunit.html.DomNode; -import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.impl.SimpleRange; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -72,13 +70,15 @@ public class Range extends SimpleScriptable { @JsxConstant public static final short END_TO_START = 3; - private Node startContainer_, endContainer_; - private int startOffset_, endOffset_; + private Node startContainer_; + private Node endContainer_; + private int startOffset_; + private int endOffset_; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Range() { } @@ -327,7 +327,8 @@ public Object createContextualFragment(final String valueAsString) { final SgmlPage page = startContainer_.getDomNodeOrDie().getPage(); final DomDocumentFragment fragment = new DomDocumentFragment(page); try { - HTMLParser.parseFragment(fragment, startContainer_.getDomNodeOrDie(), valueAsString); + page.getWebClient().getPageCreator().getHtmlParser() + .parseFragment(fragment, startContainer_.getDomNodeOrDie(), valueAsString); } catch (final Exception e) { LogFactory.getLog(Range.class).error("Unexpected exception occurred in createContextualFragment", e); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java index 9bba8a0bec1..601c56bad11 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Selection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.ArrayList; @@ -41,6 +40,7 @@ * @author Ahmed Ashour * @author Daniel Gredler * @author Frank Danek + * @author Ronald Brill */ @JsxClass public class Selection extends SimpleScriptable { @@ -53,7 +53,7 @@ public class Selection extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Selection() { } @@ -147,7 +147,7 @@ public int getRangeCount() { * Returns the type of selection (IE only). * @return the type of selection */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public String getType() { return type_; } @@ -260,7 +260,7 @@ public void collapseToStart() { /** * Cancels the current selection, sets the selection type to none. */ - @JsxFunction(CHROME) + @JsxFunction({CHROME, FF}) public void empty() { removeAllRanges(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ShadowRoot.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ShadowRoot.java index 70dd3b240d6..bff5afdb8de 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ShadowRoot.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/ShadowRoot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +24,9 @@ * A JavaScript object for {@code ShadowRoot}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF68}) public class ShadowRoot extends DocumentFragment { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Text.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Text.java index 603ed72bca4..35c5a512686 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Text.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Text.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -45,7 +44,7 @@ public class Text extends CharacterData { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Text() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TextRange.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TextRange.java index 3b4b377c0d2..a677186cf37 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TextRange.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TextRange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -185,11 +185,13 @@ public void select() { @JsxFunction public int moveStart(final String unit, final Object count) { if (!"character".equals(unit)) { - LOG.warn("moveStart('" + unit + "') is not yet supported"); + if (LOG.isWarnEnabled()) { + LOG.warn("moveStart('" + unit + "') is not yet supported"); + } return 0; } int c = 1; - if (count != Undefined.instance) { + if (!Undefined.isUndefined(count)) { c = (int) Context.toNumber(count); } if (range_.getStartContainer() == range_.getEndContainer() @@ -222,11 +224,13 @@ public int move(final String unit, final Object count) { @JsxFunction public int moveEnd(final String unit, final Object count) { if (!"character".equals(unit)) { - LOG.warn("moveEnd('" + unit + "') is not yet supported"); + if (LOG.isWarnEnabled()) { + LOG.warn("moveEnd('" + unit + "') is not yet supported"); + } return 0; } int c = 1; - if (count != Undefined.instance) { + if (!Undefined.isUndefined(count)) { c = (int) Context.toNumber(count); } if (range_.getStartContainer() == range_.getEndContainer() @@ -319,13 +323,13 @@ public void setEndPoint(final String type, final TextRange other) { * @param textLength the text length * @return the moveBy amount constrained to the text length */ - protected int constrainMoveBy(int moveBy, final int current, final int textLength) { + private static int constrainMoveBy(final int moveBy, final int current, final int textLength) { final int to = current + moveBy; if (to < 0) { - moveBy -= to; + return moveBy - to; } - else if (to >= textLength) { - moveBy -= to - textLength; + if (to >= textLength) { + return moveBy - (to - textLength); } return moveBy; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TreeWalker.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TreeWalker.java index 58b3af9716e..369dd146ba6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TreeWalker.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/TreeWalker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -50,7 +49,7 @@ public class TreeWalker extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TreeWalker() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/WebKitMutationObserver.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/WebKitMutationObserver.java index e90d2607b63..9602f25249b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/WebKitMutationObserver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/WebKitMutationObserver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathEvaluator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathEvaluator.java index 56a03119860..5fadbe2b1b6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathEvaluator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.apache.xml.utils.PrefixResolver; @@ -36,7 +35,7 @@ * @author Chuck Dumont * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class XPathEvaluator extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathNSResolver.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathNSResolver.java index 5a41db6c5f0..68919e72d5c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathNSResolver.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathNSResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,16 +15,15 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.apache.xml.utils.PrefixResolver; import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; -import com.gargoylesoftware.htmlunit.xml.XmlUtil; +import com.gargoylesoftware.htmlunit.util.XmlUtils; /** * A JavaScript object for {@code XPathNSResolver}. @@ -32,8 +31,7 @@ * @author Ahmed Ashour * @author Chuck Dumont */ -@JsxClass(EDGE) -@JsxClass(isJSObject = false, value = CHROME) +@JsxClass(isJSObject = false, value = {CHROME, FF}) public class XPathNSResolver extends SimpleScriptable implements PrefixResolver { private Node element_; @@ -41,7 +39,6 @@ public class XPathNSResolver extends SimpleScriptable implements PrefixResolver /** * Default constructor. */ - @JsxConstructor(EDGE) public XPathNSResolver() { } @@ -61,7 +58,7 @@ public void setElement(final Node element) { */ @JsxFunction public String lookupNamespaceURI(final String prefix) { - return XmlUtil.lookupNamespaceURI((DomElement) element_.getDomNodeOrDie(), prefix); + return XmlUtils.lookupNamespaceURI((DomElement) element_.getDomNodeOrDie(), prefix); } /** @@ -69,7 +66,7 @@ public String lookupNamespaceURI(final String prefix) { */ @Override public String getBaseIdentifier() { - return XmlUtil.lookupNamespaceURI((DomElement) element_.getDomNodeOrDie(), ""); + return XmlUtils.lookupNamespaceURI((DomElement) element_.getDomNodeOrDie(), ""); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathResult.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathResult.java index 7f22904d79e..f9b59a9656a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathResult.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/XPathResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.dom; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.List; @@ -38,7 +37,7 @@ * @author Chuck Dumont * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class XPathResult extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/package-info.java index 6b932d2c268..7a43f0a86ca 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ApplicationCacheErrorEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ApplicationCacheErrorEvent.java index 19a7fc3bd16..ad363164014 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ApplicationCacheErrorEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ApplicationCacheErrorEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AudioProcessingEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AudioProcessingEvent.java index 82775a4a719..5327ba2a668 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AudioProcessingEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/AudioProcessingEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioProcessingEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeInstallPromptEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeInstallPromptEvent.java index c50c73151c7..780aabc756b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeInstallPromptEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeInstallPromptEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java index 600694a67e6..4ca8a5a5349 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BeforeUnloadEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,12 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_BEFORE_UNLOAD_RETURN_VALUE_IS_HTML5_LIKE; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_HANDLER_NULL_RETURN_IS_MEANINGFUL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -34,22 +36,25 @@ * * @author Frank Danek * @author Ahmed Ashour + * @author Ronald Brill + * @author Atsushi Nakagawa */ @JsxClass public class BeforeUnloadEvent extends Event { + private Object returnValue_; /** * Creates a new event instance. */ public BeforeUnloadEvent() { - setEventType(""); - setReturnValue(""); + setType(""); + returnValue_ = ""; } /** * The JavaScript constructor. It seems it is not possible to do it from JavaScript code. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jConstructor() { Context.throwAsScriptRuntimeEx(new IllegalArgumentException("Illegal Constructor")); } @@ -64,26 +69,63 @@ public BeforeUnloadEvent(final DomNode domNode, final String type) { super(domNode, type); setBubbles(false); - setReturnValue(Undefined.instance); + setReturnValue(getReturnValueDefault(getBrowserVersion())); + } + + @Override + public void initEvent(final String type, final boolean bubbles, final boolean cancelable) { + super.initEvent(type, bubbles, cancelable); + setReturnValue(getReturnValueDefault(getBrowserVersion())); + } + + private static Object getReturnValueDefault(final BrowserVersion browserVersion) { + if (browserVersion.hasFeature(EVENT_BEFORE_UNLOAD_RETURN_VALUE_IS_HTML5_LIKE)) { + // Empty string default is specified by HTML5 + // https://www.w3.org/TR/html5/browsers.html#the-beforeunloadevent-interface + return ""; + } + return Undefined.instance; + } + + /** + * @return {@code true} if returnValue holds the beforeunload message + */ + public boolean isBeforeUnloadMessageSet() { + return !getReturnValueDefault(getBrowserVersion()).equals(getReturnValue()); } /** - * Returns the return value associated with the event. * @return the return value associated with the event */ - @Override @JsxGetter + @Override public Object getReturnValue() { - return super.getReturnValue(); + return returnValue_; } /** * Sets the return value associated with the event. * @param returnValue the return value associated with the event */ - @Override @JsxSetter + @Override public void setReturnValue(final Object returnValue) { - super.setReturnValue(returnValue); + returnValue_ = returnValue; + } + + @Override + void handlePropertyHandlerReturnValue(final Object returnValue) { + super.handlePropertyHandlerReturnValue(returnValue); + + final BrowserVersion browserVersion = getBrowserVersion(); + + // Most browsers ignore null return values of property handlers + if (returnValue != null || browserVersion.hasFeature(EVENT_HANDLER_NULL_RETURN_IS_MEANINGFUL)) { + // Chrome/Firefox only accept the return value if returnValue is equal to default + if (!browserVersion.hasFeature(EVENT_BEFORE_UNLOAD_RETURN_VALUE_IS_HTML5_LIKE) + || getReturnValueDefault(browserVersion).equals(getReturnValue())) { + setReturnValue(returnValue); + } + } } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BlobEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BlobEvent.java index a9484fa95ad..c5364d9bb64 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BlobEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/BlobEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ClipboardEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ClipboardEvent.java index 80d56f814bf..0d545ab9c35 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ClipboardEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ClipboardEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class ClipboardEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CloseEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CloseEvent.java index 68aabbfdb75..57a86e57a88 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CloseEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CloseEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONCLOSE_INIT_CLOSE_EVENT_THROWS; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -66,7 +65,7 @@ public void eventCreated() { * @param details the event details (optional) */ @Override - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor(final String type, final ScriptableObject details) { super.jsConstructor(type, details); @@ -74,7 +73,7 @@ public void jsConstructor(final String type, final ScriptableObject details) { String reason = ""; boolean wasClean = false; - if (details != null && details != Undefined.instance) { + if (details != null && !Undefined.isUndefined(details)) { final Double detailCode = (Double) details.get("code"); if (detailCode != null) { code = detailCode.intValue(); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CompositionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CompositionEvent.java index 9320c9124be..4946276af36 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CompositionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CompositionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class CompositionEvent extends UIEvent { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CompositionEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CustomEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CustomEvent.java index 4f36d4d649a..d686439fbc3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CustomEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/CustomEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -37,7 +36,7 @@ public class CustomEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public CustomEvent() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceLightEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceLightEvent.java index 3998e729763..e0846a6d97a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceLightEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceLightEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +23,9 @@ * A JavaScript object for {@code DeviceLightEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class DeviceLightEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceMotionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceMotionEvent.java index 276937d0900..86c6af2d096 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceMotionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceMotionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class DeviceMotionEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceOrientationEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceOrientationEvent.java index 488949ac0f6..b8e3757315a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceOrientationEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceOrientationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class DeviceOrientationEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceProximityEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceProximityEvent.java index 8d9944952ab..d35375d8a10 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceProximityEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DeviceProximityEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +23,9 @@ * A JavaScript object for {@code DeviceProximityEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class DeviceProximityEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DragEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DragEvent.java index e5d90bdbd78..7459262974a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DragEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/DragEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class DragEvent extends MouseEvent { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DragEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ErrorEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ErrorEvent.java index f9a30507385..e55408f9ff2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ErrorEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ErrorEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class ErrorEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public ErrorEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/Event.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/Event.java index b00cafd44ed..b462d43261b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/Event.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/Event.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,11 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_FOCUS_FOCUS_IN_BLUR_OUT; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONLOAD_CANCELABLE_FALSE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; -import java.lang.reflect.Method; import java.util.LinkedList; import com.gargoylesoftware.htmlunit.ScriptResult; @@ -35,6 +32,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; import net.sourceforge.htmlunit.corejs.javascript.Undefined; @@ -57,6 +55,7 @@ * @author Rob Di Marco * @author Ronald Brill * @author Frank Danek + * @author Atsushi Nakagawa */ @JsxClass public class Event extends SimpleScriptable { @@ -179,7 +178,6 @@ public class Event extends SimpleScriptable { private String propertyName_; private boolean stopPropagation_; private boolean stopImmediatePropagation_; - private Object returnValue_; private boolean preventDefault_; /** @@ -229,6 +227,7 @@ public Event(final EventTarget target, final String type) { target_ = target; currentTarget_ = target; type_ = type; + setParentScope(target); setPrototype(getPrototype(getClass())); @@ -237,9 +236,11 @@ public Event(final EventTarget target, final String type) { } else if (TYPE_LOAD.equals(type)) { bubbles_ = false; - if (getBrowserVersion().hasFeature(EVENT_ONLOAD_CANCELABLE_FALSE)) { - cancelable_ = false; - } + cancelable_ = false; + } + else if (TYPE_ERROR.equals(type)) { + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-error + bubbles_ = false; } } @@ -276,12 +277,12 @@ public void eventCreated() { * @param type the event type * @param details the event details (optional) */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor(final String type, final ScriptableObject details) { boolean bubbles = false; boolean cancelable = false; - if (details != null && details != Undefined.instance) { + if (details != null && !Undefined.isUndefined(details)) { final Boolean detailBubbles = (Boolean) details.get("bubbles"); if (detailBubbles != null) { bubbles = detailBubbles.booleanValue(); @@ -321,7 +322,7 @@ public void endFire() { * Returns the object that fired the event. * @return the object that fired the event */ - @JsxGetter({IE, CHROME, EDGE}) + @JsxGetter({IE, CHROME, FF68}) public Object getSrcElement() { return srcElement_; } @@ -526,7 +527,7 @@ protected void setCancelable(final boolean cancelable) { * called for this event. Otherwise this attribute must return {@code false}. * @return {@code true} if this event has been cancelled or not */ - @JsxGetter({FF, IE, EDGE}) + @JsxGetter public boolean isDefaultPrevented() { return cancelable_ && preventDefault_; } @@ -534,7 +535,7 @@ public boolean isDefaultPrevented() { /** * @return indicates if event propagation is stopped */ - @JsxGetter(IE) + @JsxGetter public boolean isCancelBubble() { return stopPropagation_; } @@ -542,7 +543,7 @@ public boolean isCancelBubble() { /** * @param newValue indicates if event propagation is stopped */ - @JsxSetter(IE) + @JsxSetter public void setCancelBubble(final boolean newValue) { stopPropagation_ = newValue; } @@ -581,19 +582,13 @@ public boolean isImmediatePropagationStopped() { } /** - * Returns the return value associated with the event. - * @return the return value associated with the event + * Handles the return values of property handlers. + * @param returnValue the return value returned by the property handler */ - public Object getReturnValue() { - return returnValue_; - } - - /** - * Sets the return value associated with the event. - * @param returnValue the return value associated with the event - */ - public void setReturnValue(final Object returnValue) { - returnValue_ = returnValue; + void handlePropertyHandlerReturnValue(final Object returnValue) { + if (Boolean.FALSE.equals(returnValue)) { + preventDefault(); + } } /** @@ -615,20 +610,6 @@ public void initEvent(final String type, final boolean bubbles, final boolean ca type_ = type; bubbles_ = bubbles; cancelable_ = cancelable; - if (TYPE_BEFORE_UNLOAD.equals(type) && getBrowserVersion().hasFeature(EVENT_FOCUS_FOCUS_IN_BLUR_OUT)) { - try { - final Class klass = getClass(); - final Method readMethod = klass.getMethod("getReturnValue"); - final Method writeMethod = klass.getMethod("setReturnValue", Object.class); - defineProperty("returnValue", null, readMethod, writeMethod, ScriptableObject.EMPTY); - if ("Event".equals(klass.getSimpleName())) { - setReturnValue(Boolean.TRUE); - } - } - catch (final Exception e) { - throw Context.throwAsScriptRuntimeEx(e); - } - } } /** @@ -638,7 +619,9 @@ public void initEvent(final String type, final boolean bubbles, final boolean ca */ @JsxFunction public void preventDefault() { - preventDefault_ = true; + if (isCancelable()) { + preventDefault_ = true; + } } /** @@ -658,12 +641,13 @@ public boolean isAborted(final ScriptResult result) { */ @Override public String toString() { - final StringBuilder builder = new StringBuilder("Event "); - builder.append(getType()); - builder.append(" ("); - builder.append("Current Target: "); - builder.append(currentTarget_); - builder.append(");"); + final StringBuilder builder = new StringBuilder(40); + builder.append("Event ") + .append(getType()) + .append(" (") + .append("Current Target: ") + .append(currentTarget_) + .append(");"); return builder.toString(); } @@ -677,4 +661,25 @@ public String toString() { public boolean processLabelAfterBubbling() { return false; } + + /** + * @return the return value property + */ + @JsxGetter({CHROME, FF68}) + public Object getReturnValue() { + return !preventDefault_; + } + + /** + * @param newValue the new return value + */ + @JsxSetter({CHROME, FF68}) + public void setReturnValue(final Object newValue) { + if (isCancelable()) { + final boolean bool = !ScriptRuntime.toBoolean(newValue); + if (bool) { + preventDefault_ = bool; + } + } + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventHandler.java index baaf0c80623..5c4ad59e0f1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,9 +47,7 @@ public EventHandler(final DomNode node, final String eventName, final String jsS jsSnippet_ = "function on" + eventName + "(event) {" + jsSnippet + "\n}"; - final ScriptableObject w = node.getPage().getEnclosingWindow().getScriptableObject(); - final Scriptable function = (Scriptable) w.get("Function", w); - setPrototype(function.getPrototype()); + setPrototype(ScriptableObject.getClassPrototype(node.getScriptableObject(), "Function")); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java index a121c8bab3a..2e6d55c2dee 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventListenersContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,22 +14,19 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_FALSE_RESULT; - import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Locale; -import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.gargoylesoftware.htmlunit.ScriptResult; import com.gargoylesoftware.htmlunit.html.DomNode; -import com.gargoylesoftware.htmlunit.html.HtmlBody; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.host.Window; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; @@ -49,40 +46,93 @@ * @author Ahmed Ashour * @author Frank Danek * @author Ronald Brill + * @author Atsushi Nakagawa */ public class EventListenersContainer implements Serializable { private static final Log LOG = LogFactory.getLog(EventListenersContainer.class); - static class TypeContainer implements Serializable { - private List capturingListeners_; - private List bubblingListeners_; - private Object handler_; + // Refactoring note: This seems ad-hoc.. Shouldn't synchronization be orchestrated between + // JS thread and main thread at a much higher layer? Anyways, to preserve behaviour of prior + // coding where 'synchronized' was used more explicitly, we're using a ConcurrentHashMap here + // and using ConcurrentMap.compute() to mutate below so that mutations are atomic. This for + // example avoids the case where two concurrent addListener()s can result in either being lost. + private final ConcurrentMap typeContainers_ = new ConcurrentHashMap<>(); + private final EventTarget jsNode_; + + private static class TypeContainer implements Serializable { + public static final TypeContainer EMPTY = new TypeContainer(); + + // This sentinel value could be some singleton instance but null + // isn't used for anything else so why not. + private static final Scriptable EVENT_HANDLER_PLACEHOLDER = null; + + private final List capturingListeners_; + private final List bubblingListeners_; + private final List atTargetListeners_; + private final Function handler_; TypeContainer() { - capturingListeners_ = Collections.unmodifiableList(new ArrayList()); - bubblingListeners_ = Collections.unmodifiableList(new ArrayList()); + capturingListeners_ = Collections.emptyList(); + bubblingListeners_ = Collections.emptyList(); + atTargetListeners_ = Collections.emptyList(); + handler_ = null; } private TypeContainer(final List capturingListeners, - final List bubblingListeners, final Object handler) { - capturingListeners_ = Collections.unmodifiableList(new ArrayList<>(capturingListeners)); - bubblingListeners_ = Collections.unmodifiableList(new ArrayList<>(bubblingListeners)); + final List bubblingListeners, final List atTargetListeners, + final Function handler) { + capturingListeners_ = capturingListeners; + bubblingListeners_ = bubblingListeners; + atTargetListeners_ = atTargetListeners; handler_ = handler; } - private List getListeners(final boolean useCapture) { - if (useCapture) { - return capturingListeners_; + private List getListeners(final int eventPhase) { + switch (eventPhase) { + case Event.CAPTURING_PHASE: + return capturingListeners_; + case Event.AT_TARGET: + return atTargetListeners_; + case Event.BUBBLING_PHASE: + return bubblingListeners_; + default: + throw new UnsupportedOperationException("eventPhase: " + eventPhase); } - return bubblingListeners_; } - private synchronized boolean addListener(final Scriptable listener, final boolean useCapture) { - final List listeners = getListeners(useCapture); + public TypeContainer setPropertyHandler(final Function propertyHandler) { + if (propertyHandler != null) { + // If we already have a handler then the position of the existing + // placeholder should not be changed so just change the handler + if (handler_ != null) { + if (propertyHandler == handler_) { + return this; + } + return withPropertyHandler(propertyHandler); + } + + // Insert the placeholder and set the handler + return withPropertyHandler(propertyHandler).addListener(EVENT_HANDLER_PLACEHOLDER, false); + } + if (handler_ == null) { + return this; + } + return removeListener(EVENT_HANDLER_PLACEHOLDER, false).withPropertyHandler(null); + } + + private TypeContainer withPropertyHandler(final Function propertyHandler) { + return new TypeContainer(capturingListeners_, bubblingListeners_, atTargetListeners_, propertyHandler); + } + + public TypeContainer addListener(final Scriptable listener, final boolean useCapture) { + + List capturingListeners = capturingListeners_; + List bubblingListeners = bubblingListeners_; + final List listeners = useCapture ? capturingListeners : bubblingListeners; if (listeners.contains(listener)) { - return false; + return this; } List newListeners = new ArrayList<>(listeners.size() + 1); @@ -91,21 +141,29 @@ private synchronized boolean addListener(final Scriptable listener, final boolea newListeners = Collections.unmodifiableList(newListeners); if (useCapture) { - capturingListeners_ = newListeners; + capturingListeners = newListeners; } else { - bubblingListeners_ = newListeners; + bubblingListeners = newListeners; } - return true; + List atTargetListeners = new ArrayList<>(atTargetListeners_.size() + 1); + atTargetListeners.addAll(atTargetListeners_); + atTargetListeners.add(listener); + atTargetListeners = Collections.unmodifiableList(atTargetListeners); + + return new TypeContainer(capturingListeners, bubblingListeners, atTargetListeners, handler_); } - private synchronized void removeListener(final Scriptable listener, final boolean useCapture) { - final List listeners = getListeners(useCapture); + public TypeContainer removeListener(final Scriptable listener, final boolean useCapture) { + + List capturingListeners = capturingListeners_; + List bubblingListeners = bubblingListeners_; + final List listeners = useCapture ? capturingListeners : bubblingListeners; final int idx = listeners.indexOf(listener); if (idx < 0) { - return; + return this; } List newListeners = new ArrayList<>(listeners); @@ -113,22 +171,26 @@ private synchronized void removeListener(final Scriptable listener, final boolea newListeners = Collections.unmodifiableList(newListeners); if (useCapture) { - capturingListeners_ = newListeners; + capturingListeners = newListeners; } else { - bubblingListeners_ = newListeners; + bubblingListeners = newListeners; } + + List atTargetListeners = new ArrayList<>(atTargetListeners_); + atTargetListeners.remove(listener); + atTargetListeners = Collections.unmodifiableList(atTargetListeners); + + return new TypeContainer(capturingListeners, bubblingListeners, atTargetListeners, handler_); } + // Refactoring note: This method doesn't appear to be used @Override protected TypeContainer clone() { - return new TypeContainer(capturingListeners_, bubblingListeners_, handler_); + return new TypeContainer(capturingListeners_, bubblingListeners_, atTargetListeners_, handler_); } } - private final Map typeContainers_ = new HashMap<>(); - private final EventTarget jsNode_; - /** * The constructor. * @@ -151,9 +213,17 @@ public boolean addEventListener(final String type, final Scriptable listener, fi return true; } - final TypeContainer container = getTypeContainer(type); - final boolean added = container.addListener(listener, useCapture); - if (!added) { + final boolean[] added = {false}; + typeContainers_.compute(type.toLowerCase(Locale.ROOT), (k, container) -> { + if (container == null) { + container = TypeContainer.EMPTY; + } + final TypeContainer newContainer = container.addListener(listener, useCapture); + added[0] = newContainer != container; + return newContainer; + }); + + if (!added[0]) { if (LOG.isDebugEnabled()) { LOG.debug(type + " listener already registered, skipping it (" + listener + ")"); } @@ -164,7 +234,7 @@ public boolean addEventListener(final String type, final Scriptable listener, fi private TypeContainer getTypeContainer(final String type) { final String typeLC = type.toLowerCase(Locale.ROOT); - return typeContainers_.computeIfAbsent(typeLC, k -> new TypeContainer()); + return typeContainers_.getOrDefault(typeLC, TypeContainer.EMPTY); } /** @@ -172,14 +242,10 @@ private TypeContainer getTypeContainer(final String type) { * * @param eventType the event type * @param useCapture whether to use capture of not - * @return the listeners list + * @return the listeners list (empty list when empty) */ public List getListeners(final String eventType, final boolean useCapture) { - final TypeContainer container = typeContainers_.get(eventType.toLowerCase(Locale.ROOT)); - if (container != null) { - return container.getListeners(useCapture); - } - return null; + return getTypeContainer(eventType).getListeners(useCapture ? Event.CAPTURING_PHASE : Event.BUBBLING_PHASE); } /** @@ -194,10 +260,8 @@ void removeEventListener(final String eventType, final Scriptable listener, fina return; } - final TypeContainer container = typeContainers_.get(eventType.toLowerCase(Locale.ROOT)); - if (container != null) { - container.removeListener(listener, useCapture); - } + typeContainers_.computeIfPresent(eventType.toLowerCase(Locale.ROOT), + (k, container) -> container.removeListener(listener, useCapture)); } /** @@ -206,25 +270,34 @@ void removeEventListener(final String eventType, final Scriptable listener, fina * @param value the new property */ public void setEventHandler(final String eventType, final Object value) { - Object handler = value; - if (handler == Undefined.instance) { + final Function handler; + + // Otherwise, ignore silently. + if (Undefined.isUndefined(value) || !(value instanceof Function)) { handler = null; } + else { + handler = (Function) value; + } - final TypeContainer container = getTypeContainer(eventType); - container.handler_ = handler; + typeContainers_.compute(eventType.toLowerCase(Locale.ROOT), (k, container) -> { + if (container == null) { + container = TypeContainer.EMPTY; + } + return container.setPropertyHandler(handler); + }); } - private ScriptResult executeEventListeners(final boolean useCapture, final Event event, final Object[] args) { + private void executeEventListeners(final int eventPhase, final Event event, final Object[] args) { final DomNode node = jsNode_.getDomNodeOrNull(); // some event don't apply on all kind of nodes, for instance "blur" if (node != null && !node.handles(event)) { - return null; + return; } - ScriptResult allResult = null; - final List listeners = getListeners(event.getType(), useCapture); - if (listeners != null && !listeners.isEmpty()) { + final TypeContainer container = getTypeContainer(event.getType()); + final List listeners = container.getListeners(eventPhase); + if (!listeners.isEmpty()) { event.setCurrentTarget(jsNode_); final HtmlPage page; @@ -245,7 +318,12 @@ else if (parentScope instanceof HTMLDocument) { } // no need for a copy, listeners are copy on write - for (final Scriptable listener : listeners) { + for (Scriptable listener : listeners) { + boolean isPropertyHandler = false; + if (listener == TypeContainer.EVENT_HANDLER_PLACEHOLDER) { + listener = container.handler_; + isPropertyHandler = true; + } Function function = null; Scriptable thisObject = null; if (listener instanceof Function) { @@ -262,86 +340,43 @@ else if (listener instanceof NativeObject) { if (function != null) { final ScriptResult result = page.executeJavaScriptFunction(function, thisObject, args, node); - if (event.isPropagationStopped()) { - allResult = result; - } - if (jsNode_.getBrowserVersion().hasFeature(EVENT_FALSE_RESULT)) { - if (ScriptResult.isFalse(result)) { - allResult = result; - } - else { - final Object eventReturnValue = event.getReturnValue(); - if (eventReturnValue instanceof Boolean && !((Boolean) eventReturnValue).booleanValue()) { - allResult = new ScriptResult(Boolean.FALSE, page); - } - } + // Return value is only honored for property handlers (Tested in Chrome/FF/IE11) + if (isPropertyHandler && !ScriptResult.isUndefined(result)) { + event.handlePropertyHandlerReturnValue(result.getJavaScriptResult()); } } if (event.isImmediatePropagationStopped()) { - return allResult; + return; } } } - return allResult; - } - - private ScriptResult executeEventHandler(final Event event, final Object[] propHandlerArgs) { - final DomNode node = jsNode_.getDomNodeOrNull(); - // some event don't apply on all kind of nodes, for instance "blur" - if (node != null && !node.handles(event)) { - return null; - } - final Function handler = getEventHandler(event.getType()); - if (handler != null) { - event.setCurrentTarget(jsNode_); - final HtmlPage page = (HtmlPage) (node != null - ? node.getPage() - : jsNode_.getWindow().getWebWindow().getEnclosedPage()); - if (LOG.isDebugEnabled()) { - LOG.debug("Executing " + event.getType() + " handler for " + node); - } - return page.executeJavaScriptFunction(handler, jsNode_, - propHandlerArgs, page); - } - return null; } /** * Executes bubbling listeners. * @param event the event * @param args arguments - * @param propHandlerArgs handler arguments - * @return the result */ - public ScriptResult executeBubblingListeners(final Event event, final Object[] args, - final Object[] propHandlerArgs) { - ScriptResult result = null; - - // the handler declared as property if any (not on body, as handler declared on body goes to the window) - final DomNode domNode = jsNode_.getDomNodeOrNull(); - if (!(domNode instanceof HtmlBody)) { - result = executeEventHandler(event, propHandlerArgs); - if (event.isPropagationStopped()) { - return result; - } - } - - // the registered listeners (if any) - final ScriptResult newResult = executeEventListeners(false, event, args); - if (newResult != null) { - result = newResult; - } - return result; + public void executeBubblingListeners(final Event event, final Object[] args) { + executeEventListeners(Event.BUBBLING_PHASE, event, args); } /** * Executes capturing listeners. * @param event the event * @param args the arguments - * @return the result */ - public ScriptResult executeCapturingListeners(final Event event, final Object[] args) { - return executeEventListeners(true, event, args); + public void executeCapturingListeners(final Event event, final Object[] args) { + executeEventListeners(Event.CAPTURING_PHASE, event, args); + } + + /** + * Executes listeners for events targeting the node. (non-propagation phase) + * @param event the event + * @param args the arguments + */ + public void executeAtTargetListeners(final Event event, final Object[] args) { + executeEventListeners(Event.AT_TARGET, event, args); } /** @@ -350,11 +385,7 @@ public ScriptResult executeCapturingListeners(final Event event, final Object[] * @return the handler function, {@code null} if the property is null or not a function */ public Function getEventHandler(final String eventType) { - final TypeContainer container = typeContainers_.get(eventType.toLowerCase(Locale.ROOT)); - if (container == null) { - return null; - } - return (Function) container.handler_; + return getTypeContainer(eventType).handler_; } /** @@ -363,47 +394,7 @@ public Function getEventHandler(final String eventType) { * @return {@code true} if there are any event listeners for the specified event, {@code false} otherwise */ boolean hasEventListeners(final String eventType) { - final TypeContainer container = typeContainers_.get(eventType); - return container != null - && (container.handler_ instanceof Function - || !container.bubblingListeners_.isEmpty() - || !container.capturingListeners_.isEmpty()); - } - - /** - * Executes listeners. - * - * @param event the event - * @param args the arguments - * @param propHandlerArgs handler arguments - * @return the result - */ - ScriptResult executeListeners(final Event event, final Object[] args, final Object[] propHandlerArgs) { - // the registered capturing listeners (if any) - event.setEventPhase(Event.CAPTURING_PHASE); - ScriptResult result = executeEventListeners(true, event, args); - if (event.isPropagationStopped()) { - return result; - } - - // the handler declared as property (if any) - event.setEventPhase(Event.AT_TARGET); - ScriptResult newResult = executeEventHandler(event, propHandlerArgs); - if (newResult != null) { - result = newResult; - } - if (event.isPropagationStopped()) { - return result; - } - - // the registered bubbling listeners (if any) - event.setEventPhase(Event.BUBBLING_PHASE); - newResult = executeEventListeners(false, event, args); - if (newResult != null) { - result = newResult; - } - - return result; + return !getTypeContainer(eventType).atTargetListeners_.isEmpty(); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventSource.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventSource.java index 808b7233961..5e8c7846e97 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventSource.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java index 38b1cc23780..f4bfc3dd9cf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CALL_RESULT_IS_LAST_RETURN_VALUE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_EVENT_WINDOW_EXECUTE_IF_DITACHED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -26,10 +23,8 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.w3c.dom.Document; import com.gargoylesoftware.htmlunit.ScriptResult; -import com.gargoylesoftware.htmlunit.html.DomDocumentFragment; import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.HtmlElement; @@ -39,8 +34,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.host.Window; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLabelElement; +import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.Function; @@ -50,8 +44,10 @@ * A JavaScript object for {@code EventTarget}. * * @author Ahmed Ashour + * @author Ronald Brill + * @author Atsushi Nakagawa */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) @JsxClass(isJSObject = false, value = IE) public class EventTarget extends SimpleScriptable { @@ -90,21 +86,18 @@ public final EventListenersContainer getEventListenersContainer() { /** * Executes the event on this object only (needed for instance for onload on (i)frame tags). * @param event the event - * @return the result * @see #fireEvent(Event) */ - public ScriptResult executeEventLocally(final Event event) { + public void executeEventLocally(final Event event) { final EventListenersContainer eventListenersContainer = getEventListenersContainer(); final Window window = getWindow(); final Object[] args = new Object[] {event}; - // handlers declared as property on a node don't receive the event as argument for IE - final Object[] propHandlerArgs = args; - final Event previousEvent = window.getCurrentEvent(); window.setCurrentEvent(event); try { - return eventListenersContainer.executeListeners(event, args, propHandlerArgs); + event.setEventPhase(Event.AT_TARGET); + eventListenersContainer.executeAtTargetListeners(event, args); } finally { window.setCurrentEvent(previousEvent); // reset event @@ -118,91 +111,95 @@ public ScriptResult executeEventLocally(final Event event) { */ public ScriptResult fireEvent(final Event event) { final Window window = getWindow(); - final Object[] args = new Object[] {event}; event.startFire(); - ScriptResult result = null; final Event previousEvent = window.getCurrentEvent(); window.setCurrentEvent(event); try { - // window's listeners - final EventListenersContainer windowsListeners = window.getEventListenersContainer(); + // These can be null if we aren't tied to a DOM node + final DomNode ourNode = getDomNodeOrNull(); + final DomNode ourParentNode = (ourNode != null) ? ourNode.getParentNode() : null; - // capturing phase - event.setEventPhase(Event.CAPTURING_PHASE); - final boolean windowEventIfDetached = getBrowserVersion().hasFeature(JS_EVENT_WINDOW_EXECUTE_IF_DITACHED); + // Determine the propagation path which is fixed here and not affected by + // DOM tree modification from intermediate listeners (tested in Chrome) + final List propagationPath = new ArrayList<>(); - boolean isAttached = false; - for (DomNode node = getDomNodeOrNull(); node != null; node = node.getParentNode()) { - if (node instanceof Document || node instanceof DomDocumentFragment) { - isAttached = true; - break; - } - } + // We're added to the propagation path first + propagationPath.add(this); - if (isAttached || windowEventIfDetached) { - result = windowsListeners.executeCapturingListeners(event, args); - if (event.isPropagationStopped()) { - return result; - } + // Then add all our parents if we have any (pure JS object such as XMLHttpRequest + // and MessagePort, etc. will not have any parents) + for (DomNode parent = ourParentNode; parent != null; parent = parent.getParentNode()) { + propagationPath.add(parent.getScriptableObject()); } - final List eventTargetList = new ArrayList<>(); - EventTarget eventTarget = this; - while (eventTarget != null) { - if (isAttached) { - eventTargetList.add(eventTarget); - } - final DomNode domNode = eventTarget.getDomNodeOrNull(); - eventTarget = null; - if (domNode != null && domNode.getParentNode() != null) { - eventTarget = domNode.getParentNode().getScriptableObject(); + + // The load event has some unnatural behavior that we need to handle specially + // The load event for other elements target that element and but path only + // up to Document and not Window, so do nothing here + // (see Note in https://www.w3.org/TR/DOM-Level-3-Events/#event-type-load) + if (!Event.TYPE_LOAD.equals(event.getType())) { + // Add Window if the the propagation path reached Document + if (propagationPath.get(propagationPath.size() - 1) instanceof Document) { + propagationPath.add(window); } } - final boolean ie = getBrowserVersion().hasFeature(JS_CALL_RESULT_IS_LAST_RETURN_VALUE); - for (int i = eventTargetList.size() - 1; i >= 0; i--) { - final EventTarget jsNode = eventTargetList.get(i); + // capturing phase + event.setEventPhase(Event.CAPTURING_PHASE); + + for (int i = propagationPath.size() - 1; i >= 1; i--) { + final EventTarget jsNode = propagationPath.get(i); final EventListenersContainer elc = jsNode.eventListenersContainer_; - if (elc != null && isAttached) { - final ScriptResult r = elc.executeCapturingListeners(event, args); - result = ScriptResult.combine(r, result, ie); + if (elc != null) { + elc.executeCapturingListeners(event, new Object[] {event}); if (event.isPropagationStopped()) { - return result; + return new ScriptResult(null); } } } - // handlers declared as property on a node don't receive the event as argument for IE - final Object[] propHandlerArgs = args; - - // bubbling phase + // at target phase event.setEventPhase(Event.AT_TARGET); - eventTarget = this; - HtmlLabel label = null; - final boolean processLabelAfterBubbling = event.processLabelAfterBubbling(); - while (eventTarget != null) { - final EventTarget jsNode = eventTarget; + if (!propagationPath.isEmpty()) { + // Note: This element is not always the same as event.getTarget(): + // e.g. the 'load' event targets Document but "at target" is on Window. + final EventTarget jsNode = propagationPath.get(0); final EventListenersContainer elc = jsNode.eventListenersContainer_; - if (elc != null && !(jsNode instanceof Window) && (isAttached || !(jsNode instanceof HTMLElement))) { - final ScriptResult r = elc.executeBubblingListeners(event, args, propHandlerArgs); - result = ScriptResult.combine(r, result, ie); + if (elc != null) { + elc.executeAtTargetListeners(event, new Object[] {event}); if (event.isPropagationStopped()) { - return result; + return new ScriptResult(null); } } - final DomNode domNode = eventTarget.getDomNodeOrNull(); - eventTarget = null; - if (domNode != null && domNode.getParentNode() != null) { - eventTarget = domNode.getParentNode().getScriptableObject(); - } + } + + // bubbling phase + if (event.isBubbles()) { + // This belongs here inside the block because events that don't bubble never set + // eventPhase = 3 (tested in Chrome) event.setEventPhase(Event.BUBBLING_PHASE); - if (eventTarget != null - && label == null - && processLabelAfterBubbling && eventTarget instanceof HTMLLabelElement) { - label = (HtmlLabel) eventTarget.getDomNodeOrNull(); + for (int i = 1, size = propagationPath.size(); i < size; i++) { + final EventTarget jsNode = propagationPath.get(i); + final EventListenersContainer elc = jsNode.eventListenersContainer_; + if (elc != null) { + elc.executeBubblingListeners(event, new Object[] {event}); + if (event.isPropagationStopped()) { + return new ScriptResult(null); + } + } + } + } + + HtmlLabel label = null; + if (event.processLabelAfterBubbling()) { + for (DomNode parent = ourParentNode; parent != null; parent = parent.getParentNode()) { + if (parent instanceof HtmlLabel) { + label = (HtmlLabel) parent; + break; + } } } @@ -218,17 +215,13 @@ public ScriptResult fireEvent(final Event event) { } } - if (isAttached || windowEventIfDetached) { - final ScriptResult r = windowsListeners.executeBubblingListeners(event, args, propHandlerArgs); - result = ScriptResult.combine(r, result, ie); - } } finally { event.endFire(); window.setCurrentEvent(previousEvent); // reset event } - return result; + return new ScriptResult(null); } /** @@ -268,7 +261,7 @@ public boolean dispatchEvent(final Event event) { ScriptResult result = null; if (event.getType().equals(MouseEvent.TYPE_CLICK)) { try { - element.click(event, true); + element.click(event, event.isShiftKey(), event.isCtrlKey(), event.isAltKey(), true); } catch (final IOException e) { throw Context.reportRuntimeError("Error calling click(): " + e.getMessage()); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/FocusEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/FocusEvent.java index ba06771c056..0ee19269e9b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/FocusEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/FocusEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class FocusEvent extends UIEvent { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public FocusEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/GamepadEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/GamepadEvent.java index a447662c74d..fb2abf8a329 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/GamepadEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/GamepadEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class GamepadEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/HashChangeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/HashChangeEvent.java index f934c5ad565..68e482473a5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/HashChangeEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/HashChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONHASHCHANGE_BUBBLES_FALSE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -36,7 +35,7 @@ * @author Marc Guillemot * @author Frank Danek */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class HashChangeEvent extends Event { private String oldURL_ = ""; @@ -73,13 +72,13 @@ public HashChangeEvent(final EventTarget target, final String type, * {@inheritDoc} */ @Override - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor(final String type, final ScriptableObject details) { super.jsConstructor(type, details); String oldURL = ""; String newURL = ""; - if (details != null && details != Undefined.instance) { + if (details != null && !Undefined.isUndefined(details)) { oldURL = (String) details.get("oldURL"); newURL = (String) details.get("newURL"); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/IDBVersionChangeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/IDBVersionChangeEvent.java index 73bb90f2bf5..7c97937fd4d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/IDBVersionChangeEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/IDBVersionChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class IDBVersionChangeEvent extends Event { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBVersionChangeEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/InputEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/InputEvent.java index 7b085496822..186c83e2a93 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/InputEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/InputEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/KeyboardEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/KeyboardEvent.java index 7c36cd6df70..eeae7bfac08 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/KeyboardEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/KeyboardEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_EVENT_DISTINGUISH_PRINTABLE_KEY; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -29,6 +28,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; +import com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser; /** * JavaScript object representing a Keyboard Event. @@ -38,6 +38,7 @@ * * @author Ahmed Ashour * @author Frank Danek + * @author Ronald Brill */ @JsxClass public class KeyboardEvent extends UIEvent { @@ -718,6 +719,10 @@ public class KeyboardEvent extends UIEvent { @JsxConstant(FF) public static final int DOM_VK_WIN_ICO_00 = 228; + /** Constant for {@code DOM_VK_PROCESSKEY}. */ + @JsxConstant(SupportedBrowser.FF68) + public static final int DOM_VK_PROCESSKEY = 229; + /** Constant for {@code DOM_VK_WIN_ICO_CLEAR}. */ @JsxConstant(FF) public static final int DOM_VK_WIN_ICO_CLEAR = 230; @@ -851,10 +856,13 @@ public class KeyboardEvent extends UIEvent { private int charCode_; private int which_; + /** Whether or not the "meta" key was pressed during the firing of the event. */ + private boolean metaKey_; + /** * Creates a new keyboard event instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public KeyboardEvent() { } @@ -1130,4 +1138,19 @@ public String getCode() { } } + /** + * Returns whether or not the "meta" key was pressed during the event firing. + * @return whether or not the "meta" key was pressed during the event firing + */ + @JsxGetter + public boolean getMetaKey() { + return metaKey_; + } + + /** + * @param metaKey whether Meta has been pressed during this event or not + */ + protected void setMetaKey(final boolean metaKey) { + metaKey_ = metaKey; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIConnectionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIConnectionEvent.java index d53f2674727..e40916ca471 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIConnectionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIConnectionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIMessageEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIMessageEvent.java index b1d52cf9244..2c284f51a71 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIMessageEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MIDIMessageEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MSGestureEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MSGestureEvent.java index dbec3966267..44c4621a833 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MSGestureEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MSGestureEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaEncryptedEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaEncryptedEvent.java index 0a7e5a2406f..1c538a16e5f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaEncryptedEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaEncryptedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaKeyMessageEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaKeyMessageEvent.java index c7ea0d8f7a9..910a6ec57b4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaKeyMessageEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaKeyMessageEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaQueryListEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaQueryListEvent.java index fe2b5979b91..71665654eb5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaQueryListEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaQueryListEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +24,9 @@ * A JavaScript object for {@code MediaQueryListEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class MediaQueryListEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamEvent.java index 53c8b17db21..8e1f5496ea6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamTrackEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamTrackEvent.java index b90c3617012..8c799bc7369 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamTrackEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamTrackEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEvent.java index 7087dd651d0..3e307c39776 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MessageEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONMESSAGE_DEFAULT_DATA_NULL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -29,6 +27,9 @@ import com.gargoylesoftware.htmlunit.javascript.host.WindowProxy; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.NativeArray; +import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; +import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; import net.sourceforge.htmlunit.corejs.javascript.Undefined; @@ -79,7 +80,7 @@ public MessageEvent(final Object data) { * @param details the event details (optional) */ @Override - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor(final String type, final ScriptableObject details) { super.jsConstructor(type, details); @@ -89,7 +90,7 @@ public void jsConstructor(final String type, final ScriptableObject details) { String origin = ""; String lastEventId = ""; - if (details != null && details != Undefined.instance) { + if (details != null && !Undefined.isUndefined(details)) { data_ = details.get("data"); final String detailOrigin = (String) details.get(HttpHeader.ORIGIN_LC); @@ -127,7 +128,7 @@ else if (detailSource instanceof WindowProxy) { * @param source the window object that contains the document that caused the event * @param ports the message ports */ - @JsxFunction({CHROME, IE, FF}) + @JsxFunction public void initMessageEvent( final String type, final boolean canBubble, @@ -142,7 +143,16 @@ public void initMessageEvent( origin_ = origin; lastEventId_ = lastEventId; source_ = source; - ports_ = ports; + + if (Undefined.isUndefined(ports) + || ports instanceof NativeArray + || (ports instanceof Scriptable && ScriptableObject.hasProperty((Scriptable) ports, "length"))) { + ports_ = ports; + } + else { + throw ScriptRuntime.typeError( + "Argument 8 of MessageEvent.initMessageEvent can't be converted to a sequence."); + } } /** @@ -193,7 +203,7 @@ public Window getSource() { * Returns the {@code ports} property. * @return the {@code ports} property */ - @JsxGetter({CHROME, IE, FF}) + @JsxGetter public Object getPorts() { return ports_; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseEvent.java index a15cf85bd31..0b89721dda0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.LinkedList; @@ -100,10 +99,12 @@ public class MouseEvent extends UIEvent { public static final int BUTTON_RIGHT = 2; /** The event's screen coordinates; initially {@code null} and lazily initialized for performance reasons. */ - private Integer screenX_, screenY_; + private Integer screenX_; + private Integer screenY_; /** The event's client coordinates; initially {@code null} and lazily initialized for performance reasons. */ - private Integer clientX_, clientY_; + private Integer clientX_; + private Integer clientY_; /** The button code according to W3C (0: left button, 1: middle button, 2: right button). */ private int button_; @@ -111,10 +112,13 @@ public class MouseEvent extends UIEvent { /** Switch to disable label handling if we already processing the event triggered from label processing */ private boolean processLabelAfterBubbling_ = true; + /** Whether or not the "meta" key was pressed during the firing of the event. */ + private boolean metaKey_; + /** * Used to build the prototype. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MouseEvent() { screenX_ = Integer.valueOf(0); screenY_ = Integer.valueOf(0); @@ -137,7 +141,6 @@ public MouseEvent(final DomNode domNode, final String type, final boolean shiftK setShiftKey(shiftKey); setCtrlKey(ctrlKey); setAltKey(altKey); - setMetaKey(false); if (button != BUTTON_LEFT && button != BUTTON_MIDDLE && button != BUTTON_RIGHT) { throw new IllegalArgumentException("Invalid button code: " + button); @@ -395,4 +398,20 @@ public boolean processLabelAfterBubbling() { public void disableProcessLabelAfterBubbling() { processLabelAfterBubbling_ = false; } + + /** + * Returns whether or not the "meta" key was pressed during the event firing. + * @return whether or not the "meta" key was pressed during the event firing + */ + @JsxGetter + public boolean getMetaKey() { + return metaKey_; + } + + /** + * @param metaKey whether Meta has been pressed during this event or not + */ + protected void setMetaKey(final boolean metaKey) { + metaKey_ = metaKey; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseScrollEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseScrollEvent.java index 212d26b034a..b8cb8dff813 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseScrollEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseScrollEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseWheelEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseWheelEvent.java index a1cfd5facfe..7defab679f8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseWheelEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MouseWheelEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MozContactChangeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MozContactChangeEvent.java deleted file mode 100644 index 40b3c9d3e1b..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MozContactChangeEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.event; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -/** - * A JavaScript object for {@code MozContactChangeEvent}. - * - * @author Ahmed Ashour - */ -@JsxClass(FF45) -public class MozContactChangeEvent extends Event { - - /** - * Creates an instance. - */ - @JsxConstructor - public MozContactChangeEvent() { - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MozSettingsEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MozSettingsEvent.java deleted file mode 100644 index 7baf0e470b3..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MozSettingsEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.event; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -/** - * A JavaScript object for {@code MozSettingsEvent}. - * - * @author Ahmed Ashour - */ -@JsxClass(FF45) -public class MozSettingsEvent extends Event { - - /** - * Creates an instance. - */ - @JsxConstructor - public MozSettingsEvent() { - } - -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MutationEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MutationEvent.java index 5267ecb9915..c8bd1a9a785 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MutationEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MutationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -48,7 +47,7 @@ public class MutationEvent extends Event { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MutationEvent() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/OfflineAudioCompletionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/OfflineAudioCompletionEvent.java index dbe4d787b60..be337365d73 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/OfflineAudioCompletionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/OfflineAudioCompletionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class OfflineAudioCompletionEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PageTransitionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PageTransitionEvent.java index 981cc33e8ef..06c2ecbc209 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PageTransitionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PageTransitionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class PageTransitionEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PageTransitionEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PointerEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PointerEvent.java index e89a82df64a..0db040db342 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PointerEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PointerEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.html.DomNode; @@ -37,8 +37,9 @@ * * @author Frank Danek * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, IE, EDGE}) +@JsxClass public class PointerEvent extends MouseEvent { private int pointerId_; @@ -64,7 +65,7 @@ public PointerEvent() { * @param inNewExpr Is new or not * @return the java object to allow JavaScript to access */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF}) public static Scriptable jsConstructor( final Context cx, final Object[] args, final Function ctorObj, final boolean inNewExpr) { @@ -167,7 +168,7 @@ public PointerEvent(final DomNode domNode, final String type, final boolean shif * @param hwTimestamp the initial value of hwTimestamp * @param isPrimary the initial value of isPrimary */ - @JsxFunction + @JsxFunction(IE) public void initPointerEvent(final String type, final boolean bubbles, final boolean cancelable, diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java index f46e08809f3..fa764ba9b82 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PopStateEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,19 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_POP_STATE_EVENT_CLONE_STATE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory; +import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.ContextAction; import net.sourceforge.htmlunit.corejs.javascript.NativeObject; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; @@ -52,11 +57,11 @@ public PopStateEvent() { * {@inheritDoc} */ @Override - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor(final String type, final ScriptableObject details) { super.jsConstructor(type, details); - if (details != null && details != Undefined.instance) { + if (details != null && !Undefined.isUndefined(details)) { state_ = details.get("state"); } } @@ -73,17 +78,22 @@ public PopStateEvent(final EventTarget target, final String type, final Object s if (state instanceof NativeObject && getBrowserVersion().hasFeature(JS_POP_STATE_EVENT_CLONE_STATE)) { final NativeObject old = (NativeObject) state; final NativeObject newState = new NativeObject(); - Context.enter(); - try { - for (final Object o : ScriptableObject.getPropertyIds(old)) { - final String property = Context.toString(o); - newState.defineProperty(property, ScriptableObject.getProperty(old, property), - ScriptableObject.EMPTY); + + final WebClient client = getWindow().getWebWindow().getWebClient(); + final HtmlUnitContextFactory cf = ((JavaScriptEngine) client.getJavaScriptEngine()).getContextFactory(); + + final ContextAction contextAction = new ContextAction() { + @Override + public Object run(final Context cx) { + for (final Object o : ScriptableObject.getPropertyIds(old)) { + final String property = Context.toString(o); + newState.defineProperty(property, ScriptableObject.getProperty(old, property), + ScriptableObject.EMPTY); + } + return null; } - } - finally { - Context.exit(); - } + }; + cf.call(contextAction); state_ = newState; } else { @@ -91,6 +101,20 @@ public PopStateEvent(final EventTarget target, final String type, final Object s } } + /** + * Initializes this event. + * @param type the event type + * @param bubbles whether or not the event should bubble + * @param cancelable whether or not the event the event should be cancelable + * @param state the state + */ + @JsxFunction(IE) + public void initPopStateEvent(final String type, final boolean bubbles, + final boolean cancelable, final Object state) { + initEvent(type, bubbles, cancelable); + state_ = state; + } + /** * Return the state object. * @return the state object diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionAvailableEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionAvailableEvent.java index 6fd6bf746eb..6c0353efca5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionAvailableEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionAvailableEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionCloseEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionCloseEvent.java index 187919ecd14..f5a8f8538a7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionCloseEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PresentationConnectionCloseEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ProgressEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ProgressEvent.java index 6ce78eaabc2..09e49c08ea6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ProgressEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/ProgressEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -48,11 +47,11 @@ public ProgressEvent() { * {@inheritDoc} */ @Override - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor(final String type, final ScriptableObject details) { super.jsConstructor(type, details); - if (details != null && details != Undefined.instance) { + if (details != null && !Undefined.isUndefined(details)) { final Object lengthComputable = details.get("lengthComputable"); if (lengthComputable instanceof Boolean) { lengthComputable_ = (Boolean) lengthComputable; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PromiseRejectionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PromiseRejectionEvent.java index 7948bb01c7c..e22d655186c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PromiseRejectionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/PromiseRejectionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCDataChannelEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCDataChannelEvent.java index 32fab8d2ae7..dd21245de20 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCDataChannelEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCDataChannelEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCPeerConnectionIceEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCPeerConnectionIceEvent.java index c1932a0392c..6f0c8376bf4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCPeerConnectionIceEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/RTCPeerConnectionIceEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SVGZoomEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SVGZoomEvent.java index 714a8416b6e..3081a5f1377 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SVGZoomEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SVGZoomEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGZoomEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGZoomEvent extends UIEvent { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGZoomEvent() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SecurityPolicyViolationEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SecurityPolicyViolationEvent.java index 2e77a8e5af6..15ebbab1f07 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SecurityPolicyViolationEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SecurityPolicyViolationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +24,9 @@ * A JavaScript object for {@code SecurityPolicyViolationEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF68}) public class SecurityPolicyViolationEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java index 7f2be4cf6a1..8de1f9fb43f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/SpeechSynthesisEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -24,8 +24,9 @@ * A JavaScript object for {@code SpeechSynthesisEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class SpeechSynthesisEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/StorageEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/StorageEvent.java index af25f0d0c07..efd0ea7fb1b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/StorageEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/StorageEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class StorageEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public StorageEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TextEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TextEvent.java index 44958b36279..2cf83729fb8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TextEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TextEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, IE, EDGE}) +@JsxClass({CHROME, IE}) public class TextEvent extends UIEvent { /** Constant for {@code DOM_INPUT_METHOD_UNKNOWN}. */ @@ -64,7 +63,7 @@ public class TextEvent extends UIEvent { /** * Default constructor. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor(CHROME) public TextEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TimeEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TimeEvent.java index 3c5b7fecec8..90620c35bbf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TimeEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TimeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TouchEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TouchEvent.java index 9ee0939417f..26d5c6e7dad 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TouchEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TouchEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TrackEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TrackEvent.java index 6eb33862db4..fae20ae04f6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TrackEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TrackEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class TrackEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TrackEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TransitionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TransitionEvent.java index c500697d8d0..da4e408795b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TransitionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/TransitionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class TransitionEvent extends Event { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TransitionEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UIEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UIEvent.java index de08d71e897..8f8553046ce 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UIEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UIEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -25,7 +24,6 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; /** * JavaScript object representing a UI event. For general information on which properties and functions should be @@ -34,6 +32,7 @@ * @author Daniel Gredler * @author Ahmed Ashour * @author Frank Danek + * @author Ronald Brill */ @JsxClass public class UIEvent extends Event { @@ -49,13 +48,10 @@ public class UIEvent extends Event { /** Specifies some detail information about the event. */ private long detail_; - /** Whether or not the "meta" key was pressed during the firing of the event. */ - private boolean metaKey_; - /** * Creates a new UI event instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public UIEvent() { } @@ -99,24 +95,6 @@ protected void setDetail(final long detail) { detail_ = detail; } - /** - * @return indicates if event propagation is stopped - */ - @Override - @JsxGetter - public boolean isCancelBubble() { - return super.isCancelBubble(); - } - - /** - * @param newValue indicates if event propagation is stopped - */ - @Override - @JsxSetter - public void setCancelBubble(final boolean newValue) { - super.setCancelBubble(newValue); - } - /** * Returns the view from which the event was generated. In browsers, this is the originating window. * @@ -147,21 +125,4 @@ public void initUIEvent( // Ignore the view parameter; we always use the window. setDetail(detail); } - - /** - * Returns whether or not the "meta" key was pressed during the event firing. - * @return whether or not the "meta" key was pressed during the event firing - */ - @JsxGetter - public boolean getMetaKey() { - return metaKey_; - } - - /** - * @param metaKey whether Meta has been pressed during this event or not - */ - protected void setMetaKey(final boolean metaKey) { - metaKey_ = metaKey; - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UserProximityEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UserProximityEvent.java index 7158ed485cc..185246cce17 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UserProximityEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/UserProximityEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.event; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +23,9 @@ * A JavaScript object for {@code UserProximityEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class UserProximityEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java index 0694a92eb21..78857a4d52f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebGLContextEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF52, IE, EDGE}) +@JsxClass({CHROME, FF, IE}) public class WebGLContextEvent extends Event { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebKitAnimationEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebKitAnimationEvent.java deleted file mode 100644 index 1b7a4ee2405..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebKitAnimationEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.event; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -/** - * A JavaScript object for {@code WebKitAnimationEvent}. - * - * @author Ahmed Ashour - */ -@JsxClass(CHROME) -public class WebKitAnimationEvent extends AnimationEvent { - - /** - * Default constructor. - */ - @JsxConstructor - public WebKitAnimationEvent() { - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebKitTransitionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebKitTransitionEvent.java deleted file mode 100644 index 6777229d47b..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebKitTransitionEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.event; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -/** - * A JavaScript object for {@code WebKitTransitionEvent}. - * - * @author Ahmed Ashour - */ -@JsxClass(CHROME) -public class WebKitTransitionEvent extends TransitionEvent { - - /** - * Creates an instance. - */ - @JsxConstructor - public WebKitTransitionEvent() { - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/webkitSpeechRecognitionError.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebkitSpeechRecognitionError.java similarity index 80% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/webkitSpeechRecognitionError.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebkitSpeechRecognitionError.java index 12ecf7f2626..a6500cceaf2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/webkitSpeechRecognitionError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebkitSpeechRecognitionError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,15 +23,16 @@ * A JavaScript object for {@code webkitSpeechRecognitionError}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitSpeechRecognitionError extends Event { +@JsxClass(value = CHROME, className = "webkitSpeechRecognitionError") +public class WebkitSpeechRecognitionError extends Event { /** * Creates a new instance. */ @JsxConstructor - public webkitSpeechRecognitionError() { + public WebkitSpeechRecognitionError() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/webkitSpeechRecognitionEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebkitSpeechRecognitionEvent.java similarity index 80% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/webkitSpeechRecognitionEvent.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebkitSpeechRecognitionEvent.java index 045ca395c41..681e07b4c70 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/webkitSpeechRecognitionEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WebkitSpeechRecognitionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +23,15 @@ * A JavaScript object for {@code webkitSpeechRecognitionEvent}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitSpeechRecognitionEvent extends Event { +@JsxClass(value = CHROME, className = "webkitSpeechRecognitionEvent") +public class WebkitSpeechRecognitionEvent extends Event { /** * Creates an instance. */ @JsxConstructor - public webkitSpeechRecognitionEvent() { + public WebkitSpeechRecognitionEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WheelEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WheelEvent.java index 3b6702f9605..1f8f3394421 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WheelEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/WheelEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -43,7 +42,7 @@ public class WheelEvent extends MouseEvent { /** * Default constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public WheelEvent() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/package-info.java index ad7f690b296..a304348961e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Headers.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Headers.java index c3cdc0d69f1..9e2142faaf5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Headers.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Headers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Request.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Request.java index b1e6d8c3890..d9f814795fc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Request.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Request.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Response.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Response.java index e465b63f716..698b423a24e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Response.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/Response.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/package-info.java index 939ac3fe49d..ea2294aa6cc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/fetch/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/Blob.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/Blob.java index 71210c0b920..5a413a6fc08 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/Blob.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/Blob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItem.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItem.java index e6f01f308bc..45109dda2a5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItem.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.file; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,8 +25,9 @@ * A JavaScript object for {@code DataTransferItem}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52, EDGE}) +@JsxClass({CHROME, FF}) public class DataTransferItem extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItemList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItemList.java index d3c8100bc3a..0d6851496a2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItemList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/DataTransferItemList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.file; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,8 +25,9 @@ * A JavaScript object for {@code DataTransferItemList}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52, EDGE}) +@JsxClass({CHROME, FF}) public class DataTransferItemList extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java index 093a0309aa1..130728a1878 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/File.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FILE_SHORT_DATE_FORMAT; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.util.Date; @@ -48,7 +46,7 @@ public class File extends Blob { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public File() { } @@ -98,7 +96,7 @@ public long getLastModified() { * Returns the {@code webkitRelativePath} property. * @return the {@code webkitRelativePath} property */ - @JsxGetter({CHROME, FF52}) + @JsxGetter({CHROME, FF}) public String getWebkitRelativePath() { return ""; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileList.java index 3b00e08bb53..643a7d57f8b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.file; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -40,7 +39,7 @@ public class FileList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public FileList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileReader.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileReader.java index b711bb964cb..aa7bae73b47 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileReader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,18 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.net.URLConnection; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; import java.nio.file.Files; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.Charsets; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -31,11 +39,15 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; -import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; +import com.gargoylesoftware.htmlunit.util.MimeType; +import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.Function; +import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; +import net.sourceforge.htmlunit.corejs.javascript.Undefined; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer; /** * A JavaScript object for {@code FileReader}. @@ -46,6 +58,8 @@ @JsxClass public class FileReader extends EventTarget { + private static final Log LOG = LogFactory.getLog(FileReader.class); + /** No data has been loaded yet. */ @JsxConstant public static final short EMPTY = 0; @@ -96,29 +110,46 @@ public Object getResult() { public void readAsDataURL(final Object object) throws IOException { readyState_ = LOADING; final java.io.File file = ((File) object).getFile(); - String contentType = Files.probeContentType(file.toPath()); + try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { FileUtils.copyFile(file, bos); final byte[] bytes = bos.toByteArray(); - final String value = new String(new Base64().encode(bytes)); + final String value = new String(new Base64().encode(bytes), StandardCharsets.US_ASCII); final BrowserVersion browserVersion = getBrowserVersion(); result_ = "data:"; - final boolean includeConentType = browserVersion.hasFeature(JS_FILEREADER_CONTENT_TYPE); - if (!value.isEmpty() || includeConentType) { - if (contentType == null) { - if (includeConentType) { - contentType = "application/octet-stream"; - } - else { - contentType = ""; + + String contentType; + if (value.isEmpty()) { + contentType = URLConnection.guessContentTypeFromName(file.getName()); + } + else { + contentType = Files.probeContentType(file.toPath()); + // this is a bit weak, on linux we get different results + // e.g. 'application/octet-stream' for a file with random bits + // instead of null on windows + } + + if (getBrowserVersion().hasFeature(JS_FILEREADER_EMPTY_NULL)) { + if (value.isEmpty()) { + result_ = "null"; + } + else { + if (contentType != null) { + result_ += contentType; } + result_ += ";base64," + value; } - result_ += contentType + ";base64," + value; } - if (value.isEmpty() && getBrowserVersion().hasFeature(JS_FILEREADER_EMPTY_NULL)) { - result_ = "null"; + else { + final boolean includeConentType = browserVersion.hasFeature(JS_FILEREADER_CONTENT_TYPE); + if (!value.isEmpty() || includeConentType) { + if (contentType == null) { + contentType = MimeType.APPLICATION_OCTET_STREAM; + } + result_ += contentType + ";base64," + value; + } } } readyState_ = DONE; @@ -141,9 +172,11 @@ public void readAsArrayBuffer(final Object object) throws IOException { final byte[] bytes = bos.toByteArray(); - final ArrayBuffer buffer = new ArrayBuffer(bytes); + final NativeArrayBuffer buffer = new NativeArrayBuffer(bytes.length); + System.arraycopy(bytes, 0, buffer.getBuffer(), 0, bytes.length); buffer.setParentScope(getParentScope()); - buffer.setPrototype(getPrototype(buffer.getClass())); + buffer.setPrototype(ScriptableObject.getClassPrototype(getWindow(), buffer.getClassName())); + result_ = buffer; } readyState_ = DONE; @@ -152,6 +185,47 @@ public void readAsArrayBuffer(final Object object) throws IOException { fireEvent(event); } + /** + * Reads the contents of the specified {@link Blob} or {@link File}. + * When the read operation is complete, the readyState is changed to DONE, + * the loaded event is triggered, and the result attribute contains the + * contents of the file as a text string. + * @param object the {@link Blob} or {@link File} from which to read + * @param encoding the encoding + * @throws IOException if an error occurs + */ + @JsxFunction + public void readAsText(final Object object, final Object encoding) throws IOException { + readyState_ = LOADING; + final java.io.File file = ((File) object).getFile(); + Charset charset = StandardCharsets.UTF_8; + if (encoding != null && !Undefined.isUndefined(encoding)) { + final String encAsString = Context.toString(encoding); + if (StringUtils.isNotBlank(encAsString)) { + try { + charset = Charsets.toCharset(encAsString.trim().toLowerCase()); + } + catch (final UnsupportedCharsetException e) { + if (LOG.isWarnEnabled()) { + LOG.warn("FileReader readAsText was called with an unsupported encoding '" + + encoding + "'. Using UTF-8 instead."); + } + } + } + } + + try { + result_ = FileUtils.readFileToString(file, charset); + } + catch (final IOException e) { + LOG.warn("FileReader readAsText can't read the file.", e); + } + readyState_ = DONE; + + final Event event = new Event(this, Event.TYPE_LOAD); + fireEvent(event); + } + /** * Returns the {@code onload} event handler for this {@link FileReader}. * @return the {@code onload} event handler for this {@link FileReader} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java index 777813e2acf..137fd7663c5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.file; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(FF52) +@JsxClass(FF) public class FileSystem extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java index 54300d483cc..f6fbf396f4f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,8 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.file; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,8 +24,8 @@ * * @author Ronald Brill */ -@JsxClass(FF52) -public class FileSystemDirectoryEntry extends SimpleScriptable { +@JsxClass(FF) +public class FileSystemDirectoryEntry extends FileSystemEntry { /** * Creates a new instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java index 3dfb6843d57..4b59b48a4c2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemDirectoryReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.file; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(FF52) +@JsxClass(FF) public class FileSystemDirectoryReader extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java index befe08a581f..cbd0d93f7ea 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.file; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(FF52) +@JsxClass(FF) public class FileSystemEntry extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java index 45cf2769307..3f1ee574e6d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/FileSystemFileEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,8 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.file; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,8 +24,8 @@ * * @author Ronald Brill */ -@JsxClass(FF52) -public class FileSystemFileEntry extends SimpleScriptable { +@JsxClass(FF) +public class FileSystemFileEntry extends FileSystemEntry { /** * Creates a new instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/package-info.java index f23e088ef31..5fc48f8598d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/file/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Coordinates.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Coordinates.java index d0469aecf89..9b93b89fcd4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Coordinates.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Coordinates.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,10 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.geo; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; /** @@ -27,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({IE, EDGE}) +@JsxClass(IE) public class Coordinates extends SimpleScriptable { private double latitude_; @@ -37,7 +35,6 @@ public class Coordinates extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor(EDGE) public Coordinates() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java index 03128502396..c44322acc4e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Geolocation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,13 @@ package com.gargoylesoftware.htmlunit.javascript.host.geo; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -52,8 +52,8 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass({IE, EDGE}) -@JsxClass(isJSObject = false, value = {CHROME, FF}) +@JsxClass({CHROME, IE}) +@JsxClass(isJSObject = false, value = FF) public class Geolocation extends SimpleScriptable { private static final Log LOG = LogFactory.getLog(Geolocation.class); @@ -68,7 +68,7 @@ public class Geolocation extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor(EDGE) + @JsxConstructor(CHROME) public Geolocation() { } @@ -147,7 +147,7 @@ private void doGetPosition() { LOG.info("Invoking URL: " + url); } - try (WebClient webClient = new WebClient(BrowserVersion.FIREFOX_45)) { + try (WebClient webClient = new WebClient(BrowserVersion.FIREFOX_60)) { final Page page = webClient.getPage(url); final String content = page.getWebResponse().getContentAsString(); if (LOG.isDebugEnabled()) { @@ -174,7 +174,9 @@ private void doGetPosition() { } } else { - LOG.error("Operating System not supported: " + os); + if (LOG.isErrorEnabled()) { + LOG.error("Operating System not supported: " + os); + } } } @@ -191,7 +193,7 @@ private static String getJSONValue(final String content, final String key) { return builder.toString().trim(); } - String getWifiStringWindows() { + static String getWifiStringWindows() { final StringBuilder builder = new StringBuilder(); try { final List lines = runCommand("netsh wlan show networks mode=bssid"); @@ -245,7 +247,8 @@ String getWifiStringWindows() { private static List runCommand(final String command) throws IOException { final List list = new ArrayList<>(); final Process p = Runtime.getRuntime().exec(command); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()))) { + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(p.getInputStream(), Charset.defaultCharset()))) { String line; while ((line = reader.readLine()) != null) { list.add(line); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Position.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Position.java index d89fc659197..291d06961f4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Position.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/Position.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,10 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.geo; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; /** @@ -27,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({IE, EDGE}) +@JsxClass(IE) public class Position extends SimpleScriptable { private Coordinates coordinates_; @@ -35,7 +33,6 @@ public class Position extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor(EDGE) public Position() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/PositionError.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/PositionError.java index 8566755ec2c..a8b33f0049b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/PositionError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/PositionError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,20 +14,18 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.geo; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code PositionError}. * * @author Ahmed Ashour */ -@JsxClass({IE, EDGE}) +@JsxClass(IE) public class PositionError extends SimpleScriptable { /** The constant for {@code PERMISSION_DENIED}. */ @@ -43,7 +41,6 @@ public class PositionError extends SimpleScriptable { /** * Default constructor. */ - @JsxConstructor(EDGE) public PositionError() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/package-info.java index d065028df41..90936b74d4e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/geo/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Audio.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Audio.java index 1030343dcde..8aaf64bb2cd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Audio.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Audio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DataTransfer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DataTransfer.java index b4a5f789436..98445ed194b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DataTransfer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DataTransfer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class DataTransfer extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public DataTransfer() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DocumentProxy.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DocumentProxy.java index ec4b734306f..fdc90914c34 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DocumentProxy.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/DocumentProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Enumerator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Enumerator.java index ada47e813c0..c398128b78c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Enumerator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Enumerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public Enumerator() { */ @JsxConstructor public void jsConstructor(final Object o) { - if (Undefined.instance == o) { + if (Undefined.isUndefined(o)) { collection_ = HTMLCollection.emptyCollection(getWindow().getDomNodeOrDie()); } else if (getBrowserVersion().hasFeature(JS_ENUMERATOR_CONSTRUCTOR_THROWS)) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/FormField.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/FormField.java deleted file mode 100644 index 14fff25262d..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/FormField.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.html; - -import com.gargoylesoftware.htmlunit.html.DomNode; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; - -import net.sourceforge.htmlunit.corejs.javascript.Context; - -/** - * Base class for all JavaScript object corresponding to form fields. - * - * @author Mike Bowler - * @author Christian Sell - * @author Marc Guillemot - * @author Chris Erskine - * @author Ahmed Ashour - */ -@JsxClass(isJSObject = false) -public class FormField extends HTMLElement { - - /** - * Sets the associated DOM node and sets the enclosing form as parent scope of the current element. - * @see com.gargoylesoftware.htmlunit.javascript.SimpleScriptable#setDomNode(DomNode) - * @param domNode the DOM node - */ - @Override - public void setDomNode(final DomNode domNode) { - super.setDomNode(domNode); - - final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); - if (form != null) { - setParentScope(getScriptableFor(form)); - } - } - - /** - * Returns the value of the JavaScript attribute {@code value}. - * - * @return the value of this attribute - */ - @JsxGetter - public String getValue() { - return getDomNodeOrDie().getAttributeDirect("value"); - } - - /** - * Sets the value of the JavaScript attribute {@code value}. - * - * @param newValue the new value - */ - @JsxSetter - public void setValue(final Object newValue) { - getDomNodeOrDie().setAttribute("value", Context.toString(newValue)); - } - - /** - * Returns the value of the JavaScript attribute {@code name}. - * - * @return the value of this attribute - */ - @JsxGetter - public String getName() { - return getDomNodeOrDie().getAttributeDirect("name"); - } - - /** - * Sets the value of the JavaScript attribute {@code name}. - * - * @param newName the new name - */ - @JsxSetter - public void setName(final String newName) { - getDomNodeOrDie().setAttribute("name", newName); - } - - /** - * {@inheritDoc} Overridden to modify browser configurations. - */ - @Override - @JsxGetter - public boolean isDisabled() { - return super.isDisabled(); - } - - /** - * {@inheritDoc} Overridden to modify browser configurations. - */ - @Override - @JsxSetter - public void setDisabled(final boolean disabled) { - super.setDisabled(disabled); - } - - /** - * Returns the value of the JavaScript {@code form} attribute. - * - * @return the value of the JavaScript {@code form} attribute - */ - @JsxGetter - public HTMLFormElement getForm() { - final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); - if (form == null) { - return null; - } - return (HTMLFormElement) getScriptableFor(form); - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAllCollection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAllCollection.java index 83ac0140ceb..eb10451a8b2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAllCollection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAllCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLALLCOLLECTION_NULL_IF_NAMED_ITEM_NOT_FOUND; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLCOLLECTION_ITEM_FUNCT_SUPPORTS_DOUBLE_INDEX_ALSO; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.ArrayList; @@ -50,7 +49,7 @@ public class HTMLAllCollection extends HTMLCollection { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLAllCollection() { } @@ -76,7 +75,7 @@ public Object item(final Object index) { if (index instanceof String) { final String name = (String) index; final Object result = namedItem(name); - if (null != result && Undefined.instance != result) { + if (null != result && !Undefined.isUndefined(result)) { return result; } numb = Double.NaN; @@ -190,7 +189,7 @@ public Object call(final Context cx, final Scriptable scope, final Scriptable th } final Object value = super.call(cx, scope, thisObj, args); - if (nullIfNotFound && value == Undefined.instance) { + if (nullIfNotFound && Undefined.isUndefined(value)) { return null; } return value; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement.java index 93c99ec4628..e8713c0c590 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAnchorElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,9 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHOR_PATHNAME_PREFIX_WIN_DRIVES_URL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHOR_PROTOCOL_COLON_FOR_BROKEN_URL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHOR_PROTOCOL_COLON_UPPER_CASE_DRIVE_LETTERS; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ANCHOR_PROTOCOL_HTTP_FOR_BROKEN_URL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.net.MalformedURLException; @@ -34,6 +33,7 @@ import org.apache.commons.lang3.StringUtils; +import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.html.DomElement; @@ -71,7 +71,7 @@ public class HTMLAnchorElement extends HTMLElement { /** * The constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLAnchorElement() { } @@ -212,7 +212,7 @@ public void setRev(final String rel) { * Returns the value of the rev property. * @return the referrerPolicy property */ - @JsxGetter({CHROME, FF52}) + @JsxGetter({CHROME, FF}) public String getReferrerPolicy() { String attrib = ((HtmlAnchor) getDomNodeOrDie()).getAttribute("referrerPolicy"); if (StringUtils.isEmpty(attrib)) { @@ -229,7 +229,7 @@ public String getReferrerPolicy() { * Sets the rev property. * @param referrerPolicy referrerPolicy attribute value */ - @JsxSetter({CHROME, FF52}) + @JsxSetter({CHROME, FF}) public void setReferrerPolicy(final String referrerPolicy) { getDomNodeOrDie().setAttribute("referrerPolicy", referrerPolicy); } @@ -464,8 +464,9 @@ public void setPort(final String port) throws Exception { */ @JsxGetter public String getProtocol() { + final BrowserVersion browser = getBrowserVersion(); try { - if (getBrowserVersion().hasFeature(JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL)) { + if (browser.hasFeature(JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL)) { final HtmlAnchor anchor = (HtmlAnchor) getDomNodeOrDie(); final String href = anchor.getHrefAttribute().toLowerCase(Locale.ROOT); if (href.length() > 1 && Character.isLetter(href.charAt(0)) && ':' == href.charAt(1)) { @@ -477,9 +478,13 @@ public String getProtocol() { } catch (final MalformedURLException e) { final HtmlAnchor anchor = (HtmlAnchor) getDomNodeOrDie(); - if (anchor.getHrefAttribute().startsWith("http") - && getBrowserVersion().hasFeature(JS_ANCHOR_PROTOCOL_COLON_FOR_BROKEN_URL)) { - return ":"; + if (anchor.getHrefAttribute().startsWith("http")) { + if (browser.hasFeature(JS_ANCHOR_PROTOCOL_COLON_FOR_BROKEN_URL)) { + return ":"; + } + if (browser.hasFeature(JS_ANCHOR_PROTOCOL_HTTP_FOR_BROKEN_URL)) { + return "http:"; + } } return StringUtils.substringBefore(anchor.getHrefAttribute(), "/"); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement.java index 63009d02b19..9fe5a59f2a4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAppletElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.applet.Applet; @@ -24,7 +22,6 @@ import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.HtmlApplet; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; @@ -41,16 +38,9 @@ * @author Marc Guillemot * @author Daniel Gredler */ -@JsxClass(domClass = HtmlApplet.class, value = {FF, IE, EDGE}) +@JsxClass(domClass = HtmlApplet.class, value = IE) public class HTMLAppletElement extends HTMLElement { - /** - * The constructor. - */ - @JsxConstructor({FF, EDGE}) - public HTMLAppletElement() { - } - /** * {@inheritDoc} */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java index b83cd45414c..67eaeb08811 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAreaElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomElement; @@ -41,7 +40,7 @@ public class HTMLAreaElement extends HTMLElement { /** * The constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLAreaElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAudioElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAudioElement.java index abcd22a49ca..a151b7166a6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAudioElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLAudioElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,14 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlAudio; +import com.gargoylesoftware.htmlunit.html.HtmlMedia; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; +import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; /** * The JavaScript object {@code HTMLAudioElement}. @@ -35,8 +37,30 @@ public class HTMLAudioElement extends HTMLMediaElement { /** * The constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLAudioElement() { } + /** + * Gets the JavaScript property {@code nodeType} for the current node. + * @return the node type + */ + @JsxGetter + @Override + public short getNodeType() { + return Node.ELEMENT_NODE; + } + + /** + * {@inheritDoc} + */ + @JsxGetter + @Override + public String getNodeName() { + final HtmlMedia element = (HtmlMedia) getDomNodeOrNull(); + if (element == null) { + return "AUDIO"; + } + return element.getNodeName(); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBGSoundElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBGSoundElement.java index 238874f024a..4962b0ed6c8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBGSoundElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBGSoundElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBRElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBRElement.java index e4c7ebf8579..23c21923087 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBRElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBRElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CLEAR_RESTRICT; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.apache.commons.lang3.ArrayUtils; @@ -44,7 +43,7 @@ public class HTMLBRElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLBRElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseElement.java index c6bfb888099..49482810942 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLBASE_HREF_DEFAULT_EMPTY; import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlBase; @@ -38,7 +37,7 @@ public class HTMLBaseElement extends HTMLElement { /** * The constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLBaseElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseFontElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseFontElement.java index 797e14f0869..cc94e87328d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseFontElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBaseFontElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,10 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLBASEFONT_END_TAG_FORBIDDEN; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.html.HtmlBaseFont; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; @@ -31,13 +29,12 @@ * * @author Ahmed Ashour */ -@JsxClass(domClass = HtmlBaseFont.class, value = {IE, EDGE}) +@JsxClass(domClass = HtmlBaseFont.class, value = IE) public class HTMLBaseFontElement extends HTMLElement { /** * Default constructor. */ - @JsxConstructor(EDGE) public HTMLBaseFontElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBlockElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBlockElement.java index 3b84bddac8a..2fab527d7b6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBlockElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBlockElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,10 +97,7 @@ public void setDateTime(final String dateTime) { */ @Override protected boolean isEndTagForbidden() { - if ("KEYGEN".equals(getNodeName()) && getBrowserVersion().hasFeature(HTMLKEYGEN_END_TAG_FORBIDDEN)) { - return true; - } - return false; + return getBrowserVersion().hasFeature(HTMLKEYGEN_END_TAG_FORBIDDEN) && "KEYGEN".equals(getNodeName()); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBodyElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBodyElement.java index d203350bf06..8f52ba78694 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBodyElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLBodyElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_BODY_MARGINS_8; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -48,7 +47,7 @@ public class HTMLBodyElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLBodyElement() { } @@ -511,7 +510,7 @@ public void setOnbeforeprint(final Object onbeforeprint) { * Returns the {@code onmessageerror} event handler for this element. * @return the {@code onmessageerror} event handler for this element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public Function getOnmessageerror() { return getEventHandler("onmessageerror"); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java index 2a945b72e3f..b8ff2661668 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLButtonElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,7 +39,7 @@ * @author Frank Danek */ @JsxClass(domClass = HtmlButton.class) -public class HTMLButtonElement extends FormField { +public class HTMLButtonElement extends HTMLElement { /** "Live" labels collection; has to be a member to have equality (==) working. */ private AbstractList labels_; @@ -48,7 +47,7 @@ public class HTMLButtonElement extends FormField { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLButtonElement() { } @@ -89,7 +88,7 @@ public String getType() { * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); @@ -115,4 +114,63 @@ public boolean checkValidity() { return getDomNodeOrDie().isValid(); } + /** + * {@inheritDoc} + */ + @JsxGetter + public String getName() { + return super.getName(); + } + + /** + * {@inheritDoc} + */ + @JsxSetter + public void setName(final String newName) { + super.setName(newName); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxGetter({CHROME, FF}) + public boolean isDisabled() { + return super.isDisabled(); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxSetter({CHROME, FF}) + public void setDisabled(final boolean disabled) { + super.setDisabled(disabled); + } + + /** + * {@inheritDoc} + */ + @JsxGetter + public HTMLFormElement getForm() { + return super.getForm(); + } + + /** + * {@inheritDoc} + */ + @JsxGetter + @Override + public Object getValue() { + return super.getValue(); + } + + /** + * {@inheritDoc} + */ + @JsxSetter + @Override + public void setValue(final Object newValue) { + super.setValue(newValue); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCanvasElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCanvasElement.java index 985ad0b3fa1..161116c9614 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCanvasElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCanvasElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CANVAS_DATA_URL_CHROME_PNG; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_CANVAS_DATA_URL_IE_PNG; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlCanvas; @@ -28,6 +27,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasRenderingContext2D; +import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.Undefined; /** @@ -45,7 +45,7 @@ public class HTMLCanvasElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLCanvasElement() { } @@ -137,10 +137,13 @@ public Object getContext(final String contextId) { @JsxFunction public String toDataURL(final Object type) { if (context2d_ != null) { - String typeInUse = type.toString(); - if (type == Undefined.instance) { + final String typeInUse; + if (Undefined.isUndefined(type)) { typeInUse = null; } + else { + typeInUse = Context.toString(type); + } return context2d_.toDataURL(typeInUse); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java index 20d951b96b3..759eeabbf94 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLCOLLECTION_NAMED_ITEM_ID_FIRST; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLCOLLECTION_SUPPORTS_PARANTHESES; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -66,7 +65,7 @@ public class HTMLCollection extends AbstractList { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLCollection() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLContentElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLContentElement.java index 0912ecec008..8b6ad12e138 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLContentElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLContentElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; import com.gargoylesoftware.htmlunit.html.HtmlContent; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,8 +24,9 @@ * The JavaScript object {@code HTMLContentElement}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(domClass = HtmlContent.class, value = {CHROME, FF45}) +@JsxClass(domClass = HtmlContent.class, value = CHROME) public class HTMLContentElement extends HTMLElement { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDDElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDDElement.java index 860b199705c..4cd91af621e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDDElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDDElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDListElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDListElement.java index 1799770df86..ce57580111d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDListElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDListElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionList; @@ -33,7 +32,7 @@ public class HTMLDListElement extends HTMLListElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLDListElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDTElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDTElement.java index 1586661f666..db74575a51e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDTElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDTElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataElement.java index 4d44aefba42..7e3e67a25d8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataListElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataListElement.java index 3446492a547..3ba59533d6f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataListElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDataListElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomNode; @@ -39,7 +38,7 @@ public class HTMLDataListElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLDataListElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDetailsElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDetailsElement.java index f9af81868d4..a3a70ae9da2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDetailsElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDetailsElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlDetails; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,8 +26,9 @@ * The JavaScript object {@code HTMLDetailsElement}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(domClass = HtmlDetails.class, value = {CHROME, FF52}) +@JsxClass(domClass = HtmlDetails.class, value = {CHROME, FF}) public class HTMLDetailsElement extends HTMLElement { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDialogElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDialogElement.java index 3d17db2b566..3171d983fa7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDialogElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDialogElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDirectoryElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDirectoryElement.java index db007956bcd..6ae4b54d2c5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDirectoryElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDirectoryElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlDirectory; @@ -35,7 +34,7 @@ public class HTMLDirectoryElement extends HTMLListElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLDirectoryElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDivElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDivElement.java index e54357ae872..20920719292 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDivElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDivElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,7 +39,7 @@ public class HTMLDivElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLDivElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java index a4fd1d90b18..980f83f5e82 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_COLOR; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_FUNCTION_DETACHED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_GET_ALSO_FRAMES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLDOCUMENT_GET_FOR_ID_AND_OR_NAME; @@ -22,7 +23,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_COLOR_EXPAND_ZERO; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOCUMENT_CREATE_ATTRUBUTE_LOWER_CASE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -56,8 +56,6 @@ import com.gargoylesoftware.htmlunit.httpclient.HtmlUnitBrowserCompatCookieSpec; import com.gargoylesoftware.htmlunit.javascript.PostponedAction; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnly; -import com.gargoylesoftware.htmlunit.javascript.configuration.CanSetReadOnlyStatus; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; @@ -112,11 +110,12 @@ private enum ParsingStatus { OUTSIDE, START, IN_NAME, INSIDE, IN_STRING } private boolean writeInCurrentDocument_ = true; private boolean closePostponedAction_; + private boolean executionExternalPostponed_; /** * The constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLDocument() { } @@ -263,8 +262,6 @@ private static HTMLDocument getDocument(final Scriptable thisObj) { throw Context.reportRuntimeError("Function can't be used detached from document"); } - private boolean executionExternalPostponed_; - /** * This a hack!!! A cleaner way is welcome. * Handle a case where document.write is simply ignored. @@ -447,7 +444,7 @@ else if (currentChar == '\\') { message.append(StringUtils.abbreviateMiddle(content, ".", 100)); message.append("' (scriptTagCount: " + scriptTagCount); message.append(" tagState: " + tagState); - message.append(")"); + message.append(')'); LOG.debug(message.toString()); } return false; @@ -493,7 +490,7 @@ public String getCookie() { } if (!HtmlUnitBrowserCompatCookieSpec.EMPTY_COOKIE_NAME.equals(cookie.getName())) { builder.append(cookie.getName()); - builder.append("="); + builder.append('='); } builder.append(cookie.getValue()); } @@ -616,6 +613,7 @@ public void close() throws IOException { * {@inheritDoc} */ @JsxGetter + @Override public Element getDocumentElement() { implicitCloseIfNecessary(); return super.getDocumentElement(); @@ -726,17 +724,17 @@ public HTMLCollection getElementsByClassName(final String className) { @JsxFunction(FF) public HTMLCollection getElementsByName(final String elementName) { implicitCloseIfNecessary(); - if ("null".equals(elementName)) { + if ("null".equals(elementName) + || (elementName.isEmpty() + && getBrowserVersion().hasFeature(HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY))) { return HTMLCollection.emptyCollection(getWindow().getDomNodeOrDie()); } - // Null must me changed to '' for proper collection initialization. - final String expElementName = "null".equals(elementName) ? "" : elementName; final HtmlPage page = getPage(); return new HTMLCollection(page, true) { @Override protected List computeElements() { - return new ArrayList<>(page.getElementsByName(expElementName)); + return new ArrayList<>(page.getElementsByName(elementName)); } @Override @@ -818,7 +816,7 @@ protected SimpleScriptable getScriptableFor(final Object object) { }; } - private List getItComputeElements(final HtmlPage page, final String name, + private static List getItComputeElements(final HtmlPage page, final String name, final boolean forIDAndOrName, final boolean alsoFrames) { final List elements; if (forIDAndOrName) { @@ -855,7 +853,6 @@ public HTMLElement getHead() { */ @Override @JsxGetter(FF) - @CanSetReadOnly(CanSetReadOnlyStatus.EXCEPTION) public HTMLElement getBody() { return super.getBody(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java index eabb02a6d08..7741b602b08 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,12 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_ACCEPTS_ARBITRARY_VALUES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INNER_TEXT_VALUE_NULL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_OFFSET_PARENT_NULL_IF_FIXED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_VALIGN_CONVERTS_TO_LOWERCASE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_WIDTH_HEIGHT_ACCEPTS_ARBITRARY_VALUES; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.IOException; @@ -39,6 +39,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; import org.apache.commons.lang3.ArrayUtils; @@ -73,15 +74,14 @@ import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlEmphasis; -import com.gargoylesoftware.htmlunit.html.HtmlExample; import com.gargoylesoftware.htmlunit.html.HtmlFigure; import com.gargoylesoftware.htmlunit.html.HtmlFigureCaption; import com.gargoylesoftware.htmlunit.html.HtmlFooter; +import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlHeader; import com.gargoylesoftware.htmlunit.html.HtmlItalic; import com.gargoylesoftware.htmlunit.html.HtmlKeyboard; import com.gargoylesoftware.htmlunit.html.HtmlLayer; -import com.gargoylesoftware.htmlunit.html.HtmlListing; import com.gargoylesoftware.htmlunit.html.HtmlMain; import com.gargoylesoftware.htmlunit.html.HtmlMark; import com.gargoylesoftware.htmlunit.html.HtmlNav; @@ -161,11 +161,11 @@ @JsxClass(domClass = HtmlArticle.class) @JsxClass(domClass = HtmlAside.class) @JsxClass(domClass = HtmlBaseFont.class, value = {CHROME, FF}) -@JsxClass(domClass = HtmlBidirectionalIsolation.class, value = CHROME) +@JsxClass(domClass = HtmlBidirectionalIsolation.class, value = {CHROME, FF68}) @JsxClass(domClass = HtmlBidirectionalOverride.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlBig.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlBold.class, value = {CHROME, FF}) -@JsxClass(domClass = HtmlCenter.class, value = {CHROME, FF, EDGE}) +@JsxClass(domClass = HtmlCenter.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlCitation.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlCode.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlDefinition.class, value = {CHROME, FF}) @@ -173,7 +173,6 @@ @JsxClass(domClass = HtmlDefinitionTerm.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlElement.class, value = {FF, IE}) @JsxClass(domClass = HtmlEmphasis.class, value = {CHROME, FF}) -@JsxClass(domClass = HtmlExample.class, value = FF45) @JsxClass(domClass = HtmlFigure.class) @JsxClass(domClass = HtmlFigureCaption.class) @JsxClass(domClass = HtmlFooter.class) @@ -181,7 +180,6 @@ @JsxClass(domClass = HtmlItalic.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlKeyboard.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlLayer.class, value = CHROME) -@JsxClass(domClass = HtmlListing.class, value = FF45) @JsxClass(domClass = HtmlMark.class) @JsxClass(domClass = HtmlNav.class) @JsxClass(domClass = HtmlNoBreak.class, value = {CHROME, FF}) @@ -200,7 +198,7 @@ @JsxClass(domClass = HtmlStrike.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlStrong.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlSubscript.class, value = {CHROME, FF}) -@JsxClass(domClass = HtmlSummary.class, value = {CHROME, FF52}) +@JsxClass(domClass = HtmlSummary.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlSuperscript.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlTeletype.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlUnderlined.class, value = {CHROME, FF}) @@ -231,7 +229,7 @@ public class HTMLElement extends Element { /** * Static counter for {@link #uniqueID_}. */ - private static int UniqueID_Counter_ = 1; + private static AtomicInteger UniqueID_Counter_ = new AtomicInteger(1); private final Set behaviors_ = new HashSet<>(); private String uniqueID_; @@ -343,7 +341,7 @@ public class HTMLElement extends Element { COLORS_MAP_IE.put("Olive", "#808000"); COLORS_MAP_IE.put("OliveDrab", "#6B8E23"); COLORS_MAP_IE.put("Orange", "#FFA500"); - COLORS_MAP_IE.put("OrangeRed", "#FF4500"); + COLORS_MAP_IE.put("OrangeRed", "#FF6000"); COLORS_MAP_IE.put("Orchid", "#DA70D6"); COLORS_MAP_IE.put("PaleGoldenrod", "#EEE8AA"); COLORS_MAP_IE.put("PaleGreen", "#98FB98"); @@ -391,7 +389,7 @@ public class HTMLElement extends Element { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLElement() { } @@ -410,6 +408,29 @@ public void setDomNode(final DomNode domNode) { || "track".equalsIgnoreCase(name)) { endTagForbidden_ = true; } + + if ("input".equalsIgnoreCase(name) + || "button".equalsIgnoreCase(name) + || "textarea".equalsIgnoreCase(name) + || "select".equalsIgnoreCase(name)) { + final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); + if (form != null) { + setParentScope(getScriptableFor(form)); + } + } + } + + /** + * Returns the value of the JavaScript {@code form} attribute. + * + * @return the value of the JavaScript {@code form} attribute + */ + public HTMLFormElement getForm() { + final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); + if (form == null) { + return null; + } + return (HTMLFormElement) getScriptableFor(form); } /** @@ -848,7 +869,9 @@ else if (BEHAVIOR_DOWNLOAD.equalsIgnoreCase(behavior)) { return BEHAVIOR_ID_DOWNLOAD; } else { - LOG.warn("Unimplemented behavior: " + behavior); + if (LOG.isWarnEnabled()) { + LOG.warn("Unimplemented behavior: " + behavior); + } return BEHAVIOR_ID_UNKNOWN; } } @@ -892,7 +915,9 @@ public void removeBehavior(final int id) { behaviors_.remove(BEHAVIOR_DOWNLOAD); break; default: - LOG.warn("Unexpected behavior id: " + id + ". Ignoring."); + if (LOG.isWarnEnabled()) { + LOG.warn("Unexpected behavior id: " + id + ". Ignoring."); + } } } @@ -1253,7 +1278,9 @@ public HTMLElement getParentHTMLElement() { */ @Override @JsxFunction(IE) - public void scrollIntoView() { /* do nothing at the moment */ } + public void scrollIntoView() { + /* do nothing at the moment */ + } /** * Retrieves an auto-generated, unique identifier for the object. @@ -1263,7 +1290,7 @@ public void scrollIntoView() { /* do nothing at the moment */ } @JsxGetter(IE) public String getUniqueID() { if (uniqueID_ == null) { - uniqueID_ = "ms__id" + UniqueID_Counter_++; + uniqueID_ = "ms__id" + HTMLElement.UniqueID_Counter_.incrementAndGet(); } return uniqueID_; } @@ -1634,7 +1661,11 @@ protected void setAlign(final String align, final boolean ignoreIfNoError) { */ protected String getVAlign(final String[] valid, final String defaultValue) { final String valign = getDomNodeOrDie().getAttributeDirect("valign"); - if (valid == null || ArrayUtils.contains(valid, valign)) { + final String valignLC = valign.toLowerCase(Locale.ROOT); + if (valid == null || ArrayUtils.contains(valid, valignLC)) { + if (getBrowserVersion().hasFeature(JS_VALIGN_CONVERTS_TO_LOWERCASE)) { + return valignLC; + } return valign; } return defaultValue; @@ -1646,9 +1677,15 @@ protected String getVAlign(final String[] valid, final String defaultValue) { * @param valid the valid values; if {@code null}, any value is valid */ protected void setVAlign(final Object vAlign, final String[] valid) { - final String s = Context.toString(vAlign).toLowerCase(Locale.ROOT); - if (valid == null || ArrayUtils.contains(valid, s)) { - getDomNodeOrDie().setAttribute("valign", s); + final String valign = Context.toString(vAlign); + final String valignLC = valign.toLowerCase(Locale.ROOT); + if (valid == null || ArrayUtils.contains(valid, valignLC)) { + if (getBrowserVersion().hasFeature(JS_VALIGN_CONVERTS_TO_LOWERCASE)) { + getDomNodeOrDie().setAttribute("valign", valignLC); + } + else { + getDomNodeOrDie().setAttribute("valign", valign); + } } else { throw Context.reportRuntimeError("Cannot set the vAlign property to invalid value: " + vAlign); @@ -2043,23 +2080,45 @@ public void setOnsubmit(final Object onsubmit) { setEventHandler(Event.TYPE_SUBMIT, onsubmit); } + /** + * Returns the {@code onwheel} event handler for this element. + * @return the {@code onwheel} event handler for this element + */ + @JsxGetter({CHROME, FF60}) + @Override + public Function getOnwheel() { + return super.getOnwheel(); + } + + /** + * Sets the {@code onwheel} event handler for this element. + * @param onwheel the {@code onwheel} event handler for this element + */ + @JsxSetter({CHROME, FF60}) + @Override + public void setOnwheel(final Object onwheel) { + super.setOnwheel(onwheel); + } + /** * Mock for the moment. * @param retargetToElement if true, all events are targeted directly to this element; * if false, events can also fire at descendants of this element */ - @JsxFunction({FF, IE}) + @JsxFunction(IE) + @Override public void setCapture(final boolean retargetToElement) { - // empty + super.setCapture(retargetToElement); } /** * Mock for the moment. * @return true for success */ - @JsxFunction({FF, IE}) + @JsxFunction(IE) + @Override public boolean releaseCapture() { - return true; + return super.releaseCapture(); } /** @@ -2097,7 +2156,8 @@ public boolean isIsContentEditable() { if ("true".equals(attribute)) { return true; } - else if ("inherit".equals(attribute)) { + + if ("inherit".equals(attribute)) { final DomNode parent = getDomNodeOrDie().getParentNode(); if (parent != null) { final Object parentScriptable = parent.getScriptableObject(); @@ -2487,7 +2547,7 @@ public boolean contains(final Object element) { */ @JsxGetter public boolean isHidden() { - return getDomNodeOrDie().hasAttribute("hidden"); + return getDomNodeOrDie().isHidden(); } /** @@ -3428,7 +3488,7 @@ public void setOntimeupdate(final Object ontimeupdate) { * Returns the {@code ontoggle} event handler for this element. * @return the {@code ontoggle} event handler for this element */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOntoggle() { return getEventHandler("toggle"); } @@ -3437,7 +3497,7 @@ public Function getOntoggle() { * Sets the {@code ontoggle} event handler for this element. * @param ontoggle the {@code ontoggle} event handler for this element */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOntoggle(final Object ontoggle) { setEventHandler("toggle", ontoggle); } @@ -3574,42 +3634,6 @@ public void setOnmozfullscreenerror(final Object onmozfullscreenerror) { setEventHandler("mozfullscreenerror", onmozfullscreenerror); } - /** - * Returns the {@code onmozpointerlockchange} event handler for this element. - * @return the {@code onmozpointerlockchange} event handler for this element - */ - @JsxGetter(FF45) - public Function getOnmozpointerlockchange() { - return getEventHandler("mozpointerlockchange"); - } - - /** - * Sets the {@code onmozpointerlockchange} event handler for this element. - * @param onmozpointerlockchange the {@code onmozpointerlockchange} event handler for this element - */ - @JsxSetter(FF45) - public void setOnmozpointerlockchange(final Object onmozpointerlockchange) { - setEventHandler("mozpointerlockchange", onmozpointerlockchange); - } - - /** - * Returns the {@code onmozpointerlockerror} event handler for this element. - * @return the {@code onmozpointerlockerror} event handler for this element - */ - @JsxGetter(FF45) - public Function getOnmozpointerlockerror() { - return getEventHandler("mozpointerlockerror"); - } - - /** - * Sets the {@code onmozpointerlockerror} event handler for this element. - * @param onmozpointerlockerror the {@code onmozpointerlockerror} event handler for this element - */ - @JsxSetter(FF45) - public void setOnmozpointerlockerror(final Object onmozpointerlockerror) { - setEventHandler("mozpointerlockerror", onmozpointerlockerror); - } - /** * Returns the {@code onactivate} event handler for this element. * @return the {@code onactivate} event handler for this element @@ -3801,7 +3825,7 @@ public void setOnmsmanipulationstatechanged(final Object onmsmanipulationstatech * @return the {@code onselectstart} event handler for this element */ @Override - @JsxGetter({IE, FF52}) + @JsxGetter(IE) public Function getOnselectstart() { return getEventHandler("selectstart"); } @@ -3811,189 +3835,44 @@ public Function getOnselectstart() { * @param onselectstart the {@code onselectstart} event handler for this element */ @Override - @JsxSetter({IE, FF52}) + @JsxSetter(IE) public void setOnselectstart(final Object onselectstart) { setEventHandler("selectstart", onselectstart); } /** - * Returns the {@code onanimationend} event handler. - * @return the {@code onanimationend} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationend() { - return getEventHandler("animationend"); - } - - /** - * Sets the {@code onanimationend} event handler. - * @param animationend the {@code onanimationend} event handler - */ - @JsxSetter(FF52) - public void setOnanimationend(final Object animationend) { - setEventHandler("animationend", animationend); - } - - /** - * Returns the {@code onanimationiteration} event handler. - * @return the {@code onanimationiteration} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationiteration() { - return getEventHandler("animationiteration"); - } - - /** - * Sets the {@code onanimationiteration} event handler. - * @param animationiteration the {@code onanimationiteration} event handler - */ - @JsxSetter(FF52) - public void setOnanimationiteration(final Object animationiteration) { - setEventHandler("animationiteration", animationiteration); - } - - /** - * Returns the {@code onanimationstart} event handler. - * @return the {@code onanimationstart} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationstart() { - return getEventHandler("animationstart"); - } - - /** - * Sets the {@code onanimationstart} event handler. - * @param animationstart the {@code onanimationstart} event handler - */ - @JsxSetter(FF52) - public void setOnanimationstart(final Object animationstart) { - setEventHandler("animationstart", animationstart); - } - - /** - * Returns the {@code ondragexit} event handler. - * @return the {@code ondragexit} event handler - */ - @JsxGetter(FF52) - public Function getOndragexit() { - return getEventHandler("dragexit"); - } - - /** - * Sets the {@code ondragexit} event handler. - * @param dragexit the {@code ondragexit} event handler - */ - @JsxSetter(FF52) - public void setOndragexit(final Object dragexit) { - setEventHandler("dragexit", dragexit); - } - - /** - * Returns the {@code onloadend} event handler. - * @return the {@code onloadend} event handler - */ - @JsxGetter(FF52) - public Function getOnloadend() { - return getEventHandler("loadend"); - } - - /** - * Sets the {@code onloadend} event handler. - * @param loadend the {@code onloadend} event handler - */ - @JsxSetter(FF52) - public void setOnloadend(final Object loadend) { - setEventHandler("loadend", loadend); - } - - /** - * Returns the {@code ontransitionend} event handler. - * @return the {@code ontransitionend} event handler - */ - @JsxGetter(FF52) - public Function getOntransitionend() { - return getEventHandler("transitionend"); - } - - /** - * Sets the {@code ontransitionend} event handler. - * @param transitionend the {@code ontransitionend} event handler - */ - @JsxSetter(FF52) - public void setOntransitionend(final Object transitionend) { - setEventHandler("transitionend", transitionend); - } - - /** - * Returns the {@code onwebkitanimationend} event handler. - * @return the {@code onwebkitanimationend} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationend() { - return getEventHandler("webkitanimationend"); - } - - /** - * Sets the {@code onwebkitanimationend} event handler. - * @param webkitanimationend the {@code onwebkitanimationend} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationend(final Object webkitanimationend) { - setEventHandler("webkitanimationend", webkitanimationend); - } - - /** - * Returns the {@code onwebkitanimationiteration} event handler. - * @return the {@code onwebkitanimationiteration} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationiteration() { - return getEventHandler("webkitanimationiteration"); - } - - /** - * Sets the {@code onwebkitanimationiteration} event handler. - * @param webkitanimationiteration the {@code onwebkitanimationiteration} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationiteration(final Object webkitanimationiteration) { - setEventHandler("webkitanimationiteration", webkitanimationiteration); - } - - /** - * Returns the {@code onwebkitanimationstart} event handler. - * @return the {@code onwebkitanimationstart} event handler + * Returns the value of the JavaScript attribute {@code name}. + * + * @return the value of this attribute */ - @JsxGetter(FF52) - public Function getOnwebkitanimationstart() { - return getEventHandler("webkitanimationstart"); + public String getName() { + return getDomNodeOrDie().getAttributeDirect("name"); } /** - * Sets the {@code onwebkitanimationstart} event handler. - * @param webkitanimationstart the {@code onwebkitanimationstart} event handler + * Sets the value of the JavaScript attribute {@code name}. + * + * @param newName the new name */ - @JsxSetter(FF52) - public void setOnwebkitanimationstart(final Object webkitanimationstart) { - setEventHandler("webkitanimationstart", webkitanimationstart); + public void setName(final String newName) { + getDomNodeOrDie().setAttribute("name", newName); } /** - * Returns the {@code onwebkittransitionend} event handler. - * @return the {@code onwebkittransitionend} event handler + * Returns the value of the JavaScript attribute {@code value}. + * + * @return the value of this attribute */ - @JsxGetter(FF52) - public Function getOnwebkittransitionend() { - return getEventHandler("webkittransitionend"); + public Object getValue() { + return getDomNodeOrDie().getAttributeDirect("value"); } /** - * Sets the {@code onwebkittransitionend} event handler. - * @param webkittransitionend the {@code onwebkittransitionend} event handler + * Sets the value of the JavaScript attribute {@code value}. + * + * @param newValue the new value */ - @JsxSetter(FF52) - public void setOnwebkittransitionend(final Object webkittransitionend) { - setEventHandler("webkittransitionend", webkittransitionend); + public void setValue(final Object newValue) { + getDomNodeOrDie().setAttribute("value", Context.toString(newValue)); } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLEmbedElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLEmbedElement.java index 08f07e2bea6..6eb1cc6f2c7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLEmbedElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLEmbedElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlEmbed; @@ -36,7 +35,7 @@ public class HTMLEmbedElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLEmbedElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java index 9b28421ffe6..8f3e7e76897 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFieldSetElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -38,7 +37,7 @@ public class HTMLFieldSetElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLFieldSetElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFontElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFontElement.java index 4965d616232..4745cf4c64c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFontElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFontElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlFont; @@ -38,7 +37,7 @@ public class HTMLFontElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLFontElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormControlsCollection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormControlsCollection.java index ee5f20d5eab..55ab2abb12f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormControlsCollection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormControlsCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java index 5e7768502bb..9a01893cef5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFormElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,13 +17,12 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.FORMFIELD_REACHABLE_BY_NEW_NAMES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.FORMFIELD_REACHABLE_BY_ORIGINAL_NAME; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.FORM_SUBMISSION_DOWNLOWDS_ALSO_IF_ONLY_HASH_CHANGED; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_ACTION_EXPANDURL_IGNORE_EMPTY; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_ACTION_EXPANDURL_NOT_DEFINED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_DISPATCHEVENT_SUBMITS; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_REJECT_INVALID_ENCODING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_SUBMIT_FORCES_DOWNLOAD; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_USABLE_AS_FUNCTION; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -34,7 +33,6 @@ import org.apache.commons.lang3.StringUtils; -import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.FormEncodingType; import com.gargoylesoftware.htmlunit.WebAssert; import com.gargoylesoftware.htmlunit.WebClient; @@ -59,6 +57,7 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.protocol.javascript.JavaScriptURLConnection; +import com.gargoylesoftware.htmlunit.util.MimeType; import net.sourceforge.htmlunit.corejs.javascript.Context; import net.sourceforge.htmlunit.corejs.javascript.Function; @@ -87,7 +86,7 @@ public class HTMLFormElement extends HTMLElement implements Function { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLFormElement() { } @@ -192,19 +191,18 @@ public int getLength() { */ @JsxGetter public String getAction() { - String action = getHtmlForm().getActionAttribute(); - final BrowserVersion browser = getBrowserVersion(); - if (action != DomElement.ATTRIBUTE_NOT_DEFINED) { - if (action.length() == 0 && browser.hasFeature(JS_FORM_ACTION_EXPANDURL_IGNORE_EMPTY)) { - return action; - } + final String action = getHtmlForm().getActionAttribute(); - try { - action = ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); - } - catch (final MalformedURLException e) { - // nothing, return action attribute - } + if (action == DomElement.ATTRIBUTE_NOT_DEFINED + && !getBrowserVersion().hasFeature(JS_FORM_ACTION_EXPANDURL_NOT_DEFINED)) { + return action; + } + + try { + return ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); + } + catch (final MalformedURLException e) { + // nothing, return action attribute } return action; } @@ -266,7 +264,7 @@ public String getEnctype() { final String encoding = getHtmlForm().getEnctypeAttribute(); if (!FormEncodingType.URL_ENCODED.getName().equals(encoding) && !FormEncodingType.MULTIPART.getName().equals(encoding) - && !"text/plain".equals(encoding)) { + && !MimeType.TEXT_PLAIN.equals(encoding)) { return FormEncodingType.URL_ENCODED.getName(); } return encoding; @@ -403,9 +401,9 @@ private List findElements(final String name) { addElements(name, getHtmlForm().getHtmlElementDescendants(), elements); addElements(name, getHtmlForm().getLostChildren(), elements); - // If no form fields are found, IE and Firefox are able to find img elements by ID or name. + // If no form fields are found, browsers are able to find img elements by ID or name. if (elements.isEmpty()) { - for (final DomNode node : getHtmlForm().getChildren()) { + for (final DomNode node : getHtmlForm().getHtmlElementDescendants()) { if (node instanceof HtmlImage) { final HtmlImage img = (HtmlImage) node; if (name.equals(img.getId()) || name.equals(img.getNameAttribute())) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameElement.java index c0fe76df05e..9ee59e04173 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -42,7 +41,7 @@ public class HTMLFrameElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLFrameElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java index 232334bd0ef..6ccb8e54127 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLFrameSetElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -42,7 +41,7 @@ public class HTMLFrameSetElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLFrameSetElement() { } @@ -208,7 +207,7 @@ public void setOnmessage(final Object message) { * Returns the {@code onmessageerror} event handler for this element. * @return the {@code onmessageerror} event handler for this element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public Function getOnmessageerror() { return getEventHandler("onmessageerror"); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHRElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHRElement.java index 537618ac92a..5c92d64c5f8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHRElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHRElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlHorizontalRule; @@ -35,7 +34,7 @@ public class HTMLHRElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLHRElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadElement.java index 01d1b04019a..d6d978ac9a1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlHead; @@ -34,7 +33,7 @@ public class HTMLHeadElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLHeadElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadingElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadingElement.java index 6f633a21fe0..af22fed83dc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadingElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHeadingElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -54,7 +53,7 @@ public class HTMLHeadingElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLHeadingElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHtmlElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHtmlElement.java index 565c20f3ca4..a06f765fd51 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHtmlElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLHtmlElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlHtml; @@ -39,7 +38,7 @@ public class HTMLHtmlElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLHtmlElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElement.java index 811e924cf9b..8da6a2c6648 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIFrameElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,9 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IFRAME_ALWAYS_EXECUTE_ONLOAD; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; -import com.gargoylesoftware.htmlunit.ScriptResult; import com.gargoylesoftware.htmlunit.html.BaseFrameElement; import com.gargoylesoftware.htmlunit.html.HtmlInlineFrame; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -48,7 +46,7 @@ public class HTMLIFrameElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLIFrameElement() { } @@ -200,12 +198,11 @@ public void setHeight(final String height) { * {@inheritDoc} */ @Override - public ScriptResult executeEventLocally(final Event event) { + public void executeEventLocally(final Event event) { if (Event.TYPE_LOAD != event.getType() || !isAttachedToPageDuringOnload_ || getBrowserVersion().hasFeature(JS_IFRAME_ALWAYS_EXECUTE_ONLOAD)) { - return super.executeEventLocally(event); + super.executeEventLocally(event); } - return null; } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java index aa79a30dae1..96b2171c761 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,11 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_ACCEPTS_ARBITRARY_VALUES; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_24x24_0x0; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.io.IOException; @@ -29,13 +29,11 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.xml.sax.helpers.AttributesImpl; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; -import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlImage; import com.gargoylesoftware.htmlunit.html.HtmlPage; @@ -78,11 +76,13 @@ public class HTMLImageElement extends HTMLElement { /** * JavaScript constructor. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public void jsConstructor() { final SgmlPage page = (SgmlPage) getWindow().getWebWindow().getEnclosedPage(); final DomElement fake = - HTMLParser.getFactory(HtmlImage.TAG_NAME).createElement(page, HtmlImage.TAG_NAME, new AttributesImpl()); + page.getWebClient().getPageCreator().getHtmlParser() + .getFactory(HtmlImage.TAG_NAME) + .createElement(page, HtmlImage.TAG_NAME, null); setDomNode(fake); } @@ -104,7 +104,7 @@ public void setDomNode(final DomNode domNode) { @JsxSetter public void setSrc(final String src) { final HtmlElement img = getDomNodeOrDie(); - img.setAttribute("src", src); + img.setAttribute(DomElement.SRC_ATTRIBUTE, src); } /** @@ -253,6 +253,9 @@ public int getWidth() { } final BrowserVersion browserVersion = getBrowserVersion(); + if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0) && StringUtils.isEmpty(src)) { + return 0; + } if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0) && StringUtils.isBlank(src)) { return 0; } @@ -313,6 +316,9 @@ public int getHeight() { } final BrowserVersion browserVersion = getBrowserVersion(); + if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_EMPTY_SOURCE_RETURNS_0x0) && StringUtils.isEmpty(src)) { + return 0; + } if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0) && StringUtils.isBlank(src)) { return 0; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInlineQuotationElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInlineQuotationElement.java index 71c6d354a18..c96e8358d4a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInlineQuotationElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInlineQuotationElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java index e353fc6c54c..06bfbbd7307 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +17,16 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.EVENT_ONCLICK_USES_POINTEREVENT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILES_UNDEFINED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILE_SELECTION_START_END_NULL; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_FILE_VALUE_FAKEPATH; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_COLOR_NOT_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_DATETIME_SUPPORTED; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_ALIGN_FOR_INPUT_IGNORES_VALUES; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_NUMBER_SELECTION_START_END_NULL; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_TYPE_LOWERCASE; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_INPUT_SET_VALUE_DATE_SUPPORTED; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_FILE_THROWS; import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.io.File; @@ -39,13 +38,13 @@ import org.xml.sax.helpers.AttributesImpl; import com.gargoylesoftware.htmlunit.BrowserVersion; +import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput; import com.gargoylesoftware.htmlunit.html.HtmlFileInput; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlRadioButtonInput; import com.gargoylesoftware.htmlunit.html.HtmlTextInput; -import com.gargoylesoftware.htmlunit.html.InputElementFactory; import com.gargoylesoftware.htmlunit.html.impl.SelectableTextInput; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -75,7 +74,7 @@ * @author Frank Danek */ @JsxClass(domClass = HtmlInput.class) -public class HTMLInputElement extends FormField { +public class HTMLInputElement extends HTMLElement { /** "Live" labels collection; has to be a member to have equality (==) working. */ private AbstractList labels_; @@ -83,7 +82,7 @@ public class HTMLInputElement extends FormField { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLInputElement() { } @@ -96,10 +95,10 @@ public String getType() { String type = getDomNodeOrDie().getTypeAttribute(); final BrowserVersion browserVersion = getBrowserVersion(); type = type.toLowerCase(Locale.ROOT); - if (!InputElementFactory.isSupported(type)) { + if (!isSupported(type)) { type = "text"; } - else if (!browserVersion.hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { + else if (!browserVersion.hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED)) { switch (type) { case "date": case "time": @@ -112,12 +111,62 @@ else if (!browserVersion.hasFeature(JS_INPUT_SET_VALUE_DATE_SUPPORTED)) { default: } } - if ("color".equals(type) && browserVersion.hasFeature(HTMLINPUT_FILES_UNDEFINED)) { + else if (browserVersion.hasFeature(HTMLINPUT_TYPE_MONTH_NOT_SUPPORTED)) { + switch (type) { + case "datetime-local": + case "month": + case "week": + type = "text"; + break; + + default: + } + } + if (browserVersion.hasFeature(HTMLINPUT_TYPE_COLOR_NOT_SUPPORTED) + && "color".equals(type)) { type = "text"; } return type; } + /** + * Returns whether the specified type is supported or not. + * @param type the type + * @return whether the specified type is supported or not + */ + private static boolean isSupported(final String type) { + boolean supported = false; + switch (type) { + case "text": + case "submit": + case "checkbox": + case "radio": + case "hidden": + case "password": + case "image": + case "reset": + case "button": + case "file": + case "color": + case "date": + case "datetime-local": + case "email": + case "month": + case "number": + case "range": + case "search": + case "tel": + case "time": + case "url": + case "week": + supported = true; + break; + + default: + } + return supported; + } + /** * Sets the value of the attribute {@code type}. * Note: this replace the DOM node with a new one. @@ -129,10 +178,26 @@ public void setType(String newType) { final String currentType = input.getAttributeDirect("type"); + final BrowserVersion browser = getBrowserVersion(); if (!currentType.equalsIgnoreCase(newType)) { - if (newType != null && getBrowserVersion().hasFeature(JS_INPUT_SET_TYPE_LOWERCASE)) { + if (newType != null && browser.hasFeature(JS_INPUT_SET_TYPE_LOWERCASE)) { newType = newType.toLowerCase(Locale.ROOT); } + + if (!browser.hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) + && ("week".equals(newType) + || "month".equals(newType) + || "date".equals(newType) + || "datetime-local".equals(newType) + || "time".equals(newType))) { + throw Context.reportRuntimeError("Invalid argument '" + newType + "' for setting property type."); + } + + if (browser.hasFeature(HTMLINPUT_TYPE_COLOR_NOT_SUPPORTED) + && "color".equals(newType)) { + throw Context.reportRuntimeError("Invalid argument '" + newType + "' for setting property type."); + } + final AttributesImpl attributes = readAttributes(input); final int index = attributes.getIndex("type"); if (index > -1) { @@ -144,8 +209,10 @@ public void setType(String newType) { // create a new one only if we have a new type if (ATTRIBUTE_NOT_DEFINED != currentType || !"text".equalsIgnoreCase(newType)) { - final HtmlInput newInput = (HtmlInput) InputElementFactory.instance - .createElement(input.getPage(), "input", attributes); + final SgmlPage page = input.getPage(); + final HtmlInput newInput = (HtmlInput) page.getWebClient().getPageCreator().getHtmlParser() + .getFactory(HtmlInput.TAG_NAME) + .createElement(page, HtmlInput.TAG_NAME, attributes); if (input.wasCreatedByJavascript()) { newInput.markAsCreatedByJavascript(); @@ -175,6 +242,7 @@ public void setType(String newType) { * * @param newValue the new value */ + @JsxSetter @Override public void setValue(final Object newValue) { if (null == newValue) { @@ -424,7 +492,7 @@ public void setMaxLength(final int length) { * Gets the {@code minLength}. * @return the {@code minLength} */ - @JsxGetter({CHROME, FF52}) + @JsxGetter({CHROME, FF}) public int getMinLength() { final String attrValue = getDomNodeOrDie().getAttribute("minLength"); return NumberUtils.toInt(attrValue, -1); @@ -434,7 +502,7 @@ public int getMinLength() { * Sets the value of {@code minLength} attribute. * @param length the new value */ - @JsxSetter({CHROME, FF52}) + @JsxSetter({CHROME, FF}) public void setMinLength(final int length) { getDomNodeOrDie().setMinLength(length); } @@ -475,6 +543,24 @@ public void setMax(final String max) { getDomNodeOrDie().setAttribute("max", max); } + /** + * Gets the {@code step} property. + * @return the {@code step} property + */ + @JsxGetter + public String getStep() { + return getDomNodeOrDie().getAttributeDirect("step"); + } + + /** + * Sets the {@code step} property. + * @param step the {@code step} property + */ + @JsxSetter + public void setStep(final String step) { + getDomNodeOrDie().setAttribute("step", step); + } + /** * Gets the value of {@code readOnly} attribute. * @return the readOnly attribute @@ -572,13 +658,16 @@ public String getSrc() { } /** - * {@inheritDoc} + * Returns the value of the JavaScript attribute {@code value}. + * + * @return the value of this attribute */ + @JsxGetter @Override public String getValue() { final HtmlInput htmlInput = getDomNodeOrDie(); if (htmlInput instanceof HtmlFileInput) { - final File[] files = ((HtmlFileInput) getDomNodeOrDie()).getFiles(); + final File[] files = ((HtmlFileInput) htmlInput).getFiles(); if (files == null || files.length == 0) { return ATTRIBUTE_NOT_DEFINED; } @@ -587,12 +676,9 @@ public String getValue() { if (name.isEmpty()) { return name; } - if (getBrowserVersion().hasFeature(HTMLINPUT_FILE_VALUE_FAKEPATH)) { - return "C:\\fakepath\\" + name; - } - return name; + return "C:\\fakepath\\" + name; } - return super.getValue(); + return htmlInput.getAttributeDirect("value"); } /** @@ -627,7 +713,7 @@ public void click() throws IOException { else { event = new MouseEvent(domNode, MouseEvent.TYPE_CLICK, false, false, false, MouseEvent.BUTTON_LEFT); } - domNode.click(event, true); + domNode.click(event, event.isShiftKey(), event.isCtrlKey(), event.isAltKey(), true); final boolean newState = domNode.isChecked(); @@ -806,7 +892,7 @@ public void setHeight(final int height) { * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); @@ -831,4 +917,46 @@ public boolean checkValidity() { public TextRange createTextRange() { return super.createTextRange(); } + + /** + * {@inheritDoc} + */ + @JsxGetter + public String getName() { + return super.getName(); + } + + /** + * {@inheritDoc} + */ + @JsxSetter + public void setName(final String newName) { + super.setName(newName); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxGetter({CHROME, FF}) + public boolean isDisabled() { + return super.isDisabled(); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxSetter({CHROME, FF}) + public void setDisabled(final boolean disabled) { + super.setDisabled(disabled); + } + + /** + * {@inheritDoc} + */ + @JsxGetter + public HTMLFormElement getForm() { + return super.getForm(); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIsIndexElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIsIndexElement.java index 3f3d22704c9..ff7f4397f61 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIsIndexElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLIsIndexElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLIElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLIElement.java index 971524294f8..4a92d55237d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLIElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLIElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlListItem; @@ -34,7 +33,7 @@ public class HTMLLIElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLLIElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLabelElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLabelElement.java index e6177d47f42..44f3db671c9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLabelElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLabelElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_LABEL_FORM_NULL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.apache.commons.lang3.StringUtils; @@ -42,7 +41,7 @@ public class HTMLLabelElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLLabelElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLegendElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLegendElement.java index c23eb41572e..7734373537f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLegendElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLegendElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlForm; @@ -37,7 +36,7 @@ public class HTMLLegendElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLLegendElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLinkElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLinkElement.java index 88d66758a8e..7ddf5caaa86 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLinkElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLLinkElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.net.MalformedURLException; @@ -48,7 +47,7 @@ public class HTMLLinkElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLLinkElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLListElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLListElement.java index e2cc92b9fbd..33f9fc1cb8f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLListElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLListElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMapElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMapElement.java index 7ed0695f069..8797fa4bf78 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMapElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMapElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.ArrayList; @@ -43,7 +42,7 @@ public class HTMLMapElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLMapElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMarqueeElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMarqueeElement.java index c45fb5c6c68..114b99b1ae7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMarqueeElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMarqueeElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.html.HtmlMarquee; @@ -30,13 +30,13 @@ * @author Ronald Brill * @author Ahmed Ashour */ -@JsxClass(domClass = HtmlMarquee.class, value = {CHROME, IE, EDGE}) +@JsxClass(domClass = HtmlMarquee.class, value = {CHROME, FF68, IE}) public class HTMLMarqueeElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, EDGE}) + @JsxConstructor({CHROME, FF68}) public HTMLMarqueeElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMediaElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMediaElement.java index c39ef82a76e..c93432435c0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMediaElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMediaElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlMedia; @@ -85,7 +84,7 @@ public class HTMLMediaElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLMediaElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java index 8ff9ac3c721..6ba770422ee 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MENU_TYPE_EMPTY; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_MENU_TYPE_PASS; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -45,7 +45,7 @@ public class HTMLMenuElement extends HTMLListElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLMenuElement() { label_ = ""; } @@ -62,12 +62,17 @@ public String getType() { } final String type = getDomNodeOrDie().getAttributeDirect("type"); + if (getBrowserVersion().hasFeature(JS_MENU_TYPE_PASS)) { + return type; + } + if ("context".equalsIgnoreCase(type)) { return "context"; } if ("toolbar".equalsIgnoreCase(type)) { return "toolbar"; } + return "list"; } @@ -85,6 +90,11 @@ public void setType(final String type) { throw Context.reportRuntimeError("Cannot set the type property to invalid value: '" + type + "'"); } + if (getBrowserVersion().hasFeature(JS_MENU_TYPE_PASS)) { + getDomNodeOrDie().setAttribute("type", type); + return; + } + if ("context".equalsIgnoreCase(type)) { getDomNodeOrDie().setAttribute("type", "context"); return; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuItemElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuItemElement.java index 49961f1e9c7..6a6dfb4ca23 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuItemElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMenuItemElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMetaElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMetaElement.java index 5148b29a743..d473b19ecc8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMetaElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMetaElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -36,7 +35,7 @@ public class HTMLMetaElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLMetaElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMeterElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMeterElement.java index 00a2f692395..9f634c01617 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMeterElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLMeterElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public HTMLMeterElement() { * @return the value */ @JsxGetter - public double getValue() { + public Double getValue() { return getAttributeAsDouble("value", 0); } @@ -122,7 +122,7 @@ private double getAttributeAsDouble(final String attributeName, final double def * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLModElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLModElement.java index f1f83020f87..8e9fe75c390 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLModElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLModElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlDeletedText; @@ -38,7 +37,7 @@ public class HTMLModElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLModElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLNextIdElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLNextIdElement.java index ba30f959a99..626f307eb16 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLNextIdElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLNextIdElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOListElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOListElement.java index 9ef8e0b5ee7..5951a5384d1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOListElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOListElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlOrderedList; @@ -36,7 +35,7 @@ public class HTMLOListElement extends HTMLListElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLOListElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java index 431b42bd502..b299c188ede 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLObjectElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTML_OBJECT_CLASSID; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -59,7 +58,7 @@ public class HTMLObjectElement extends HTMLElement implements Wrapper { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLObjectElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptGroupElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptGroupElement.java index 542f9a3337b..afc77f8d929 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptGroupElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptGroupElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomElement; @@ -37,7 +36,7 @@ public class HTMLOptGroupElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLOptGroupElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionElement.java index 38b1968dda2..5bc9d634eac 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLOPTION_REMOVE_SELECTED_ATTRIB_DESELECTS; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.xml.sax.helpers.AttributesImpl; @@ -24,7 +23,6 @@ import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomText; -import com.gargoylesoftware.htmlunit.html.HTMLParser; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlOption; import com.gargoylesoftware.htmlunit.html.HtmlOptionGroup; @@ -35,6 +33,9 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; +import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.Undefined; + /** * The JavaScript object that represents an option. * @@ -56,8 +57,8 @@ public class HTMLOptionElement extends HTMLElement { * @param defaultSelected Whether the option is initially selected * @param selected the current selection state of the option */ - @JsxConstructor({CHROME, FF, EDGE}) - public void jsConstructor(final String newText, final String newValue, + @JsxConstructor({CHROME, FF}) + public void jsConstructor(final Object newText, final String newValue, final boolean defaultSelected, final boolean selected) { final HtmlPage page = (HtmlPage) getWindow().getWebWindow().getEnclosedPage(); AttributesImpl attributes = null; @@ -66,14 +67,16 @@ public void jsConstructor(final String newText, final String newValue, attributes.addAttribute(null, "selected", "selected", null, "selected"); } - final HtmlOption htmlOption = (HtmlOption) HTMLParser.getFactory(HtmlOption.TAG_NAME).createElement( - page, HtmlOption.TAG_NAME, attributes); + final HtmlOption htmlOption = (HtmlOption) page.getWebClient().getPageCreator().getHtmlParser() + .getFactory(HtmlOption.TAG_NAME) + .createElement(page, HtmlOption.TAG_NAME, attributes); htmlOption.setSelected(selected); setDomNode(htmlOption); - if (!"undefined".equals(newText)) { - htmlOption.appendChild(new DomText(page, newText)); - htmlOption.setLabelAttribute(newText); + if (!Undefined.isUndefined(newText)) { + final String newTextString = Context.toString(newText); + htmlOption.appendChild(new DomText(page, newTextString)); + htmlOption.setLabelAttribute(newTextString); } if (!"undefined".equals(newValue)) { htmlOption.setValueAttribute(newValue); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java index c419592d185..b75840c2022 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOptionsCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_OPTIONS_DONT_ADD_EMPTY_TEXT_CHILD_WHEN_EXPANDING; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_OPTIONS_ADD_EMPTY_TEXT_CHILD_WHEN_EXPANDING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_OPTIONS_HAS_SELECT_CLASS_NAME; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_OPTIONS_IGNORE_NEGATIVE_LENGTH; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_OPTIONS_IN_ALWAYS_TRUE; @@ -30,10 +30,11 @@ import java.util.List; import com.gargoylesoftware.htmlunit.BrowserVersion; +import com.gargoylesoftware.htmlunit.SgmlPage; import com.gargoylesoftware.htmlunit.WebAssert; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomText; -import com.gargoylesoftware.htmlunit.html.HTMLParser; +import com.gargoylesoftware.htmlunit.html.ElementFactory; import com.gargoylesoftware.htmlunit.html.HtmlOption; import com.gargoylesoftware.htmlunit.html.HtmlSelect; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -223,11 +224,13 @@ public void setLength(final int newLength) { htmlSelect_.setOptionSize(newLength); } else { + final SgmlPage page = htmlSelect_.getPage(); + final ElementFactory factory = page.getWebClient().getPageCreator() + .getHtmlParser().getFactory(HtmlOption.TAG_NAME); for (int i = currentLength; i < newLength; i++) { - final HtmlOption option = (HtmlOption) HTMLParser.getFactory(HtmlOption.TAG_NAME).createElement( - htmlSelect_.getPage(), HtmlOption.TAG_NAME, null); + final HtmlOption option = (HtmlOption) factory.createElement(page, HtmlOption.TAG_NAME, null); htmlSelect_.appendOption(option); - if (!getBrowserVersion().hasFeature(JS_SELECT_OPTIONS_DONT_ADD_EMPTY_TEXT_CHILD_WHEN_EXPANDING)) { + if (getBrowserVersion().hasFeature(JS_SELECT_OPTIONS_ADD_EMPTY_TEXT_CHILD_WHEN_EXPANDING)) { option.appendChild(new DomText(option.getPage(), "")); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java index 909d4af27fa..6e98bc50ea4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLOutputElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ public void setName(final String name) { * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParagraphElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParagraphElement.java index 5ae3e589643..313c74737d0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParagraphElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParagraphElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -45,7 +44,7 @@ public class HTMLParagraphElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLParagraphElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParamElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParamElement.java index d0ed83cb6bd..2654ce3ebdf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParamElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLParamElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlParameter; @@ -35,7 +34,7 @@ public class HTMLParamElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLParamElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPhraseElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPhraseElement.java index 5d804a8b65c..c29b26c7a34 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPhraseElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPhraseElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPictureElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPictureElement.java index 0440c8e77aa..c11080af4ce 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPictureElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPictureElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPreElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPreElement.java index 1d3815edae5..080bd375b63 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPreElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLPreElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PRE_WIDTH_STRING; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import org.apache.commons.lang3.ArrayUtils; @@ -39,10 +37,9 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass(domClass = HtmlExample.class, value = CHROME) +@JsxClass(domClass = HtmlExample.class, value = {CHROME, FF}) @JsxClass(domClass = HtmlPreformattedText.class) -@JsxClass(domClass = HtmlListing.class, value = {CHROME, FF52}) -@JsxClass(domClass = HtmlExample.class, value = FF52) +@JsxClass(domClass = HtmlListing.class, value = {CHROME, FF}) public class HTMLPreElement extends HTMLElement { /** Valid values for the {@link #getClear() clear} property. */ @@ -51,7 +48,7 @@ public class HTMLPreElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLPreElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLProgressElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLProgressElement.java index 0c1c80b995a..a9419a6eb60 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLProgressElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLProgressElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlProgress; @@ -41,7 +40,7 @@ public class HTMLProgressElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLProgressElement() { } @@ -50,7 +49,7 @@ public HTMLProgressElement() { * @return the value */ @JsxGetter - public double getValue() { + public Double getValue() { return getAttributeAsDouble("value", 0); } @@ -76,7 +75,7 @@ private double getAttributeAsDouble(final String attributeName, final double def * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLQuoteElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLQuoteElement.java index 04ddf27bc09..da89003096f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLQuoteElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLQuoteElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlBlockQuote; @@ -32,14 +31,14 @@ * @author Ronald Brill * @author Carsten Steul */ -@JsxClass(domClass = HtmlInlineQuotation.class, value = {FF, CHROME, EDGE}) -@JsxClass(domClass = HtmlBlockQuote.class, value = {FF, CHROME, EDGE}) +@JsxClass(domClass = HtmlInlineQuotation.class, value = {FF, CHROME}) +@JsxClass(domClass = HtmlBlockQuote.class, value = {FF, CHROME}) public class HTMLQuoteElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLQuoteElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLScriptElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLScriptElement.java index 39cd84af71f..2a103274e56 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLScriptElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLScriptElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,13 @@ import static com.gargoylesoftware.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import java.net.MalformedURLException; import java.net.URL; +import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomText; import com.gargoylesoftware.htmlunit.html.HtmlElement; @@ -51,7 +51,7 @@ public class HTMLScriptElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLScriptElement() { } @@ -82,7 +82,7 @@ public String getSrc() { */ @JsxSetter public void setSrc(final String src) { - getDomNodeOrDie().setAttribute("src", src); + getDomNodeOrDie().setAttribute(DomElement.SRC_ATTRIBUTE, src); } /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java index 688d47bfbf6..ebceaffd775 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSelectElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_SELECT_REMOVE_IGNORE_IF_INDEX_OUTSIDE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.List; @@ -47,7 +46,7 @@ * @author Carsten Steul */ @JsxClass(domClass = HtmlSelect.class) -public class HTMLSelectElement extends FormField { +public class HTMLSelectElement extends HTMLElement { private HTMLOptionsCollection optionsArray_; @@ -57,7 +56,7 @@ public class HTMLSelectElement extends FormField { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLSelectElement() { } @@ -130,7 +129,7 @@ public Object insertBeforeImpl(final Object[] args) { @JsxFunction public Object item(final int index) { final Object option = getOptions().item(index); - if (option == Undefined.instance) { + if (Undefined.isUndefined(option)) { return null; } return option; @@ -187,6 +186,7 @@ public void setSelectedIndex(final int index) { * @return the value */ @Override + @JsxGetter public String getValue() { final HtmlSelect htmlSelect = getHtmlSelect(); final List selectedOptions = htmlSelect.getSelectedOptions(); @@ -252,6 +252,7 @@ private HtmlSelect getHtmlSelect() { * @param newValue the value of the option to select */ @Override + @JsxSetter public void setValue(final Object newValue) { final String val = Context.toString(newValue); getHtmlSelect().setSelectedAttribute(val, true, false); @@ -312,7 +313,7 @@ public void setMultiple(final boolean multiple) { * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); @@ -347,4 +348,45 @@ public void setRequired(final boolean required) { getDomNodeOrDie().setRequired(required); } + /** + * {@inheritDoc} + */ + @JsxGetter + public String getName() { + return super.getName(); + } + + /** + * {@inheritDoc} + */ + @JsxSetter + public void setName(final String newName) { + super.setName(newName); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxGetter({CHROME, FF}) + public boolean isDisabled() { + return super.isDisabled(); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxSetter({CHROME, FF}) + public void setDisabled(final boolean disabled) { + super.setDisabled(disabled); + } + + /** + * {@inheritDoc} + */ + @JsxGetter + public HTMLFormElement getForm() { + return super.getForm(); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLShadowElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLShadowElement.java index e62af63232c..6ac4a466518 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLShadowElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLShadowElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -24,8 +23,9 @@ * A JavaScript object for {@code HTMLShadowElement}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF45}) +@JsxClass(CHROME) public class HTMLShadowElement extends HTMLElement { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSlotElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSlotElement.java index 796ea442a14..a5f3313d812 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSlotElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSlotElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF68; import com.gargoylesoftware.htmlunit.html.HtmlSlot; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code HTMLSlotElement}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(domClass = HtmlSlot.class, value = CHROME) +@JsxClass(domClass = HtmlSlot.class, value = {CHROME, FF68}) public class HTMLSlotElement extends HTMLElement { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSourceElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSourceElement.java index 1ac258e0382..9aa278e00c1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSourceElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSourceElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlSource; @@ -35,7 +34,7 @@ public class HTMLSourceElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLSourceElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSpanElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSpanElement.java index 5e2fafe62eb..0351a8eafb4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSpanElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLSpanElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLBASEFONT_END_TAG_FORBIDDEN; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.util.Locale; @@ -42,7 +41,7 @@ public class HTMLSpanElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLSpanElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLStyleElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLStyleElement.java index ca43c27474e..d441978b28b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLStyleElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLStyleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,9 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import java.io.StringReader; - -import com.gargoylesoftware.css.parser.InputSource; +import com.gargoylesoftware.css.dom.CSSStyleSheetImpl; import com.gargoylesoftware.htmlunit.Cache; import com.gargoylesoftware.htmlunit.html.HtmlStyle; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -45,7 +42,7 @@ public class HTMLStyleElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLStyleElement() { } @@ -64,15 +61,14 @@ public CSSStyleSheet getSheet() { final String css = style.getTextContent(); final Cache cache = getWindow().getWebWindow().getWebClient().getCache(); - final org.w3c.dom.css.CSSStyleSheet cached = cache.getCachedStyleSheet(css); + final CSSStyleSheetImpl cached = cache.getCachedStyleSheet(css); final String uri = getDomNodeOrDie().getPage().getWebResponse().getWebRequest() .getUrl().toExternalForm(); if (cached != null) { sheet_ = new CSSStyleSheet(this, cached, uri); } else { - final InputSource source = new InputSource(new StringReader(css)); - sheet_ = new CSSStyleSheet(this, source, uri); + sheet_ = new CSSStyleSheet(this, css, uri); cache.cache(css, sheet_.getWrappedSheet()); } @@ -119,16 +115,6 @@ public void setMedia(final String media) { style.setAttribute("media", media); } - /** - * Returns the scoped of this style. - * @return the scoped - */ - @JsxGetter(FF) - public boolean isScoped() { - final HtmlStyle style = (HtmlStyle) getDomNodeOrDie(); - return style.hasAttribute("scoped"); - } - /** * Sets the scoped of this style. * @param scoped the new scoped diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCaptionElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCaptionElement.java index 1f6ba898555..9e6c529dc00 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCaptionElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCaptionElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLELEMENT_ALIGN_INVALID; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -46,7 +45,7 @@ public class HTMLTableCaptionElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTableCaptionElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java index 3942ab83fe7..fae94aeb697 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableCellElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_SPAN_SET_ZERO_IF_INVALID; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_SPAN_THROWS_EXCEPTION_IF_INVALID; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -56,7 +55,7 @@ public class HTMLTableCellElement extends HTMLTableComponent { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTableCellElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableColElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableColElement.java index eb99a8d0143..f2260a1bbba 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableColElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableColElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_COLUMN_WIDTH_NULL_STRING; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_SPAN_THROWS_EXCEPTION_IF_INVALID; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlTableColumn; @@ -43,7 +42,7 @@ public class HTMLTableColElement extends HTMLTableComponent { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTableColElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableComponent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableComponent.java index 9925658f7f7..9263f9d034b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableComponent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableDataCellElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableDataCellElement.java index 07e2f372b54..c5ad57106dd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableDataCellElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableDataCellElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,25 +14,22 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.html.HtmlTableDataCell; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * The JavaScript object representing a TD. * * @author Frank Danek */ -@JsxClass(domClass = HtmlTableDataCell.class, value = {IE, EDGE}) +@JsxClass(domClass = HtmlTableDataCell.class, value = IE) public class HTMLTableDataCellElement extends HTMLTableCellElement { /** * Default constructor. */ - @JsxConstructor(EDGE) public HTMLTableDataCellElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java index 6052cc6e00f..e6514934f55 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_VALIGN_SUPPORTS_IE_VALUES; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -57,7 +56,7 @@ public class HTMLTableElement extends RowContainer { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTableElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableHeaderCellElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableHeaderCellElement.java index bbf931d5410..7ea3f127608 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableHeaderCellElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableHeaderCellElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,25 +14,22 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.html; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.html.HtmlTableHeaderCell; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * The JavaScript object {@code HTMLTableHeaderCellElement}. * * @author Frank Danek */ -@JsxClass(domClass = HtmlTableHeaderCell.class, value = {IE, EDGE}) +@JsxClass(domClass = HtmlTableHeaderCell.class, value = IE) public class HTMLTableHeaderCellElement extends HTMLTableCellElement { /** * Default constructor. */ - @JsxConstructor(EDGE) public HTMLTableHeaderCellElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java index c09e1360d51..6341e04b29e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableRowElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_ROW_DELETE_CELL_REQUIRES_INDEX; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -52,7 +51,7 @@ public class HTMLTableRowElement extends HTMLTableComponent { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTableRowElement() { } @@ -142,7 +141,7 @@ public void setBgColor(final String bgColor) { @JsxFunction public Object insertCell(final Object index) { int position = -1; - if (index != Undefined.instance) { + if (!Undefined.isUndefined(index)) { position = (int) Context.toNumber(index); } final HtmlTableRow htmlRow = (HtmlTableRow) getDomNodeOrDie(); @@ -171,7 +170,7 @@ public Object insertCell(final Object index) { @JsxFunction public void deleteCell(final Object index) { int position = -1; - if (index != Undefined.instance) { + if (!Undefined.isUndefined(index)) { position = (int) Context.toNumber(index); } else if (getBrowserVersion().hasFeature(JS_TABLE_ROW_DELETE_CELL_REQUIRES_INDEX)) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java index 74967e3ecbb..0c8456fede1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTableSectionElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TABLE_VALIGN_SUPPORTS_IE_VALUES; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -52,7 +51,7 @@ public class HTMLTableSectionElement extends RowContainer { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTableSectionElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTemplateElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTemplateElement.java index 17975cf763e..4c0474dd7f6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTemplateElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTemplateElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java index c92d289dd25..ba7e03a0aef 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTextAreaElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TEXT_AREA_SET_ROWS_THROWS_EXCEPTION; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_TEXT_AREA_SET_VALUE_NULL; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -50,7 +49,7 @@ * @author Carsten Steul */ @JsxClass(domClass = HtmlTextArea.class) -public class HTMLTextAreaElement extends FormField { +public class HTMLTextAreaElement extends HTMLElement { /** "Live" labels collection; has to be a member to have equality (==) working. */ private AbstractList labels_; @@ -58,7 +57,7 @@ public class HTMLTextAreaElement extends FormField { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTextAreaElement() { } @@ -75,6 +74,7 @@ public String getType() { * Returns the value of the {@code value} attribute. * @return the value of the {@code value} attribute */ + @JsxGetter @Override public String getValue() { return ((HtmlTextArea) getDomNodeOrDie()).getText(); @@ -84,6 +84,7 @@ public String getValue() { * Sets the value of the {@code value} attribute. * @param value the new value */ + @JsxSetter @Override public void setValue(final Object value) { if (null == value && getBrowserVersion().hasFeature(JS_TEXT_AREA_SET_VALUE_NULL)) { @@ -374,7 +375,7 @@ public void setPlaceholder(final String placeholder) { * Returns the labels associated with the element. * @return the labels associated with the element */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public AbstractList getLabels() { if (labels_ == null) { labels_ = new LabelsHelper(getDomNodeOrDie()); @@ -418,4 +419,45 @@ public void setRequired(final boolean required) { getDomNodeOrDie().setRequired(required); } + /** + * {@inheritDoc} + */ + @JsxGetter + public String getName() { + return super.getName(); + } + + /** + * {@inheritDoc} + */ + @JsxSetter + public void setName(final String newName) { + super.setName(newName); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxGetter({CHROME, FF}) + public boolean isDisabled() { + return super.isDisabled(); + } + + /** + * {@inheritDoc} Overridden to modify browser configurations. + */ + @Override + @JsxSetter({CHROME, FF}) + public void setDisabled(final boolean disabled) { + super.setDisabled(disabled); + } + + /** + * {@inheritDoc} + */ + @JsxGetter + public HTMLFormElement getForm() { + return super.getForm(); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTimeElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTimeElement.java index b5aa0c3ef6b..ee849db73f5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTimeElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTimeElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTitleElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTitleElement.java index 333cac34076..bfdec7cf1d8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTitleElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTitleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.DomNode; @@ -39,7 +38,7 @@ public class HTMLTitleElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTitleElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTrackElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTrackElement.java index 7ff5d660597..e1774965622 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTrackElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTrackElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.HTMLTRACK_END_TAG_FORBIDDEN; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlTrack; @@ -51,7 +50,7 @@ public class HTMLTrackElement extends HTMLElement { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLTrackElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUListElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUListElement.java index a2e7b1e853c..966f7c07d8c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUListElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUListElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlUnorderedList; @@ -36,7 +35,7 @@ public class HTMLUListElement extends HTMLListElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLUListElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUnknownElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUnknownElement.java index d8715d4e204..2d0a3bba49c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUnknownElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLUnknownElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_HTML_HYPHEN_ELEMENT_CLASS_NAME; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_HTML_RUBY_ELEMENT_CLASS_NAME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.Page; @@ -42,7 +41,7 @@ public class HTMLUnknownElement extends HTMLElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLUnknownElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLVideoElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLVideoElement.java index 5d92b35e3b1..846100ab738 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLVideoElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLVideoElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlVideo; @@ -37,7 +36,7 @@ public class HTMLVideoElement extends HTMLMediaElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public HTMLVideoElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Image.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Image.java index 739b2b54983..db38557a127 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Image.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Image.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/LabelsHelper.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/LabelsHelper.java index b22f88930f2..466b96751fa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/LabelsHelper.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/LabelsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Option.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Option.java index 820335654e2..1f92fd4d385 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Option.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/Option.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ public class Option extends HTMLOptionElement { */ @Override @JsxConstructor - public void jsConstructor(final String newText, final String newValue, + public void jsConstructor(final Object newText, final String newValue, final boolean defaultSelected, final boolean selected) { super.jsConstructor(newText, newValue, defaultSelected, selected); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/RowContainer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/RowContainer.java index 5a469a4c766..de7a7b377a4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/RowContainer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/RowContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,7 +103,7 @@ public void deleteRow(int rowIndex) { @JsxFunction public Object insertRow(final Object index) { int rowIndex = -1; - if (index != Undefined.instance) { + if (!Undefined.isUndefined(index)) { rowIndex = (int) Context.toNumber(index); } final HTMLCollection rows = (HTMLCollection) getRows(); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java index bd804f50d8f..6a0cfbd9c48 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/ValidityState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.html; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -34,7 +33,7 @@ public class ValidityState extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public ValidityState() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/package-info.java index 3c0030921af..fd2e281cff3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursor.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursor.java index 5da7e7c90b3..dd08310e97b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class IDBCursor extends SimpleScriptable { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBCursor() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursorWithValue.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursorWithValue.java index 7ab7d7521cb..57be770758a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursorWithValue.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBCursorWithValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class IDBCursorWithValue extends IDBCursor { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBCursorWithValue() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBDatabase.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBDatabase.java index 989fa716d5d..add1f57b333 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBDatabase.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBDatabase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class IDBDatabase extends EventTarget { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBDatabase() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBFactory.java index 5bf565fc1cd..f80b6dd7125 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class IDBFactory extends SimpleScriptable { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBFactory() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBIndex.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBIndex.java index 8e7795d096d..c9af8b30882 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBIndex.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBIndex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class IDBIndex extends SimpleScriptable { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBIndex() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBKeyRange.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBKeyRange.java index f8017ca422b..dbed87b2019 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBKeyRange.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBKeyRange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class IDBKeyRange extends SimpleScriptable { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBKeyRange() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBMutableFile.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBMutableFile.java index b85ebf06db2..67c9c1e4b17 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBMutableFile.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBMutableFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBObjectStore.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBObjectStore.java index 43aa6bd58a6..3de363bdd67 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBObjectStore.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBObjectStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class IDBObjectStore extends SimpleScriptable { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBObjectStore() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBOpenDBRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBOpenDBRequest.java index 99689e69868..019a8a9861c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBOpenDBRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBOpenDBRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class IDBOpenDBRequest extends IDBRequest { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBOpenDBRequest() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBRequest.java index 2071daa2edf..8920d813810 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class IDBRequest extends EventTarget { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBRequest() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBTransaction.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBTransaction.java index 5827e714f49..938d145ae80 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBTransaction.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/IDBTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.idb; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class IDBTransaction extends EventTarget { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public IDBTransaction() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/package-info.java index 2978d83f6cc..61dfe1fd0ba 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/idb/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Collator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Collator.java index 8c32a6d8cc7..80fc46d48e8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Collator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Collator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java index 369eea0da47..9c98943e977 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,8 @@ @JsxClass public class DateTimeFormat extends SimpleScriptable { - private static Map FF_45_FORMATS_ = new HashMap<>(); - private static Map FF_52_FORMATS_ = new HashMap<>(); + private static Map FF_68_FORMATS_ = new HashMap<>(); + private static Map FF_60_FORMATS_ = new HashMap<>(); private static Map CHROME_FORMATS_ = new HashMap<>(); private static Map IE_FORMATS_ = new HashMap<>(); @@ -72,110 +72,108 @@ public class DateTimeFormat extends SimpleScriptable { final String yyyyDotDot = "\u200EYYYY\u200E.\u200EMM\u200E.\u200Edd\u200E."; final String rightToLeft = "\u200Fdd\u200F/\u200FMM\u200F/\u200FYYYY"; - FF_45_FORMATS_.put("", mmSlash); - FF_45_FORMATS_.put("ar", "dd\u200F/MM\u200F/YYYY"); - FF_45_FORMATS_.put("ar-SA", "d\u200F/M\u200F/YYYY هـ"); - FF_45_FORMATS_.put("ban", ddDot); - FF_45_FORMATS_.put("be", ddDot); - FF_45_FORMATS_.put("bg", ddDot + "\u200E \u0433."); - FF_45_FORMATS_.put("ca", ddSlash); - FF_45_FORMATS_.put("cs", ddDotBlank); - FF_45_FORMATS_.put("da", ddSlash); - FF_45_FORMATS_.put("de", ddDot); - FF_45_FORMATS_.put("el", ddSlash); - FF_45_FORMATS_.put("en-NZ", ddSlash); - FF_45_FORMATS_.put("en-PA", ddSlash); - FF_45_FORMATS_.put("en-PR", ddSlash); - FF_45_FORMATS_.put("en-AU", ddSlash); - FF_45_FORMATS_.put("en-GB", ddSlash); - FF_45_FORMATS_.put("en-IE", ddSlash); - FF_45_FORMATS_.put("en-IN", ddSlash); - FF_45_FORMATS_.put("en-MT", ddSlash); - FF_45_FORMATS_.put("en-SG", ddSlash); - FF_45_FORMATS_.put("en-ZA", yyyySlash); - FF_45_FORMATS_.put("es", ddSlash); - FF_45_FORMATS_.put("es-CL", ddDash); - FF_45_FORMATS_.put("es-PA", mmSlash); - FF_45_FORMATS_.put("es-PR", mmSlash); - FF_45_FORMATS_.put("es-US", mmSlash); - FF_45_FORMATS_.put("et", ddDot); - FF_45_FORMATS_.put("fi", ddDot); - FF_45_FORMATS_.put("fr", ddSlash); - FF_45_FORMATS_.put("fr-CA", yyyyDash); - FF_45_FORMATS_.put("ga", yyyyDash); - FF_45_FORMATS_.put("hi", ddSlash); - FF_45_FORMATS_.put("hr", ddDotBlankDot); - FF_45_FORMATS_.put("hu", yyyyDotBlankDot); - FF_45_FORMATS_.put("id", ddSlash); - FF_45_FORMATS_.put("in", ddSlash); - FF_45_FORMATS_.put("is", ddDot); - FF_45_FORMATS_.put("it", ddSlash); - FF_45_FORMATS_.put("iw", ddDot); - FF_45_FORMATS_.put("ja", yyyySlash); - FF_45_FORMATS_.put("ko", yyyyDotBlankDot); - FF_45_FORMATS_.put("lt", yyyyDash); - FF_45_FORMATS_.put("lv", ddDotDot); - FF_45_FORMATS_.put("mk", ddDot); - FF_45_FORMATS_.put("ms", ddSlash); - FF_45_FORMATS_.put("mt", yyyyDash); - FF_45_FORMATS_.put("nl", ddDash); - FF_45_FORMATS_.put("pl", ddDot); - FF_45_FORMATS_.put("pt", ddSlash); - FF_45_FORMATS_.put("ro", ddDot); - FF_45_FORMATS_.put("ru", ddDot); - FF_45_FORMATS_.put("sk", ddDot); - FF_45_FORMATS_.put("sl", ddDotBlank); - FF_45_FORMATS_.put("sq", ddSlash); - FF_45_FORMATS_.put("sr", ddDotBlankDot); - FF_45_FORMATS_.put("sv", yyyyDash); - FF_45_FORMATS_.put("th", ddSlash); - FF_45_FORMATS_.put("tr", ddDot); - FF_45_FORMATS_.put("uk", ddDot); - FF_45_FORMATS_.put("vi", ddSlash); - FF_45_FORMATS_.put("zh", yyyySlash); - FF_45_FORMATS_.put("zh-HK", ddSlash); - FF_45_FORMATS_.put("zh-SG", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); - - CHROME_FORMATS_.putAll(FF_45_FORMATS_); - IE_FORMATS_.putAll(FF_45_FORMATS_); - - FF_45_FORMATS_.put("en-CA", yyyyDash); - FF_45_FORMATS_.put("en-PH", ddSlash); - FF_45_FORMATS_.put("es-US", ddSlash); - FF_45_FORMATS_.put("ga", ddSlash); - FF_45_FORMATS_.put("hr", ddDotDot); - FF_45_FORMATS_.put("ja-JP-u-ca-japanese", "yy/MM/dd"); - FF_45_FORMATS_.put("sk", ddDotBlank); - FF_45_FORMATS_.put("sr", ddDotDot); - FF_45_FORMATS_.put("sq", ddDot); - - FF_52_FORMATS_.putAll(FF_45_FORMATS_); - FF_52_FORMATS_.put("fr", ddSlash); - FF_52_FORMATS_.put("hr", ddDotBlankDot); - FF_52_FORMATS_.put("fr-CH", ddDot); - FF_52_FORMATS_.put("lv", yyyyDotDot); - FF_52_FORMATS_.put("mt", ddSlash); - FF_52_FORMATS_.put("nl-BE", ddSlash); - - CHROME_FORMATS_.put("be", yyyyDash); + final Map commonFormats = new HashMap<>(); + commonFormats.put("", mmSlash); + commonFormats.put("ar", "dd\u200F/MM\u200F/YYYY"); + commonFormats.put("ar-SA", "d\u200F/M\u200F/YYYY هـ"); + commonFormats.put("ban", mmSlash); + commonFormats.put("be", ddDot); + commonFormats.put("bg", ddDot + "\u200E \u0433."); + commonFormats.put("ca", ddSlash); + commonFormats.put("cs", ddDotBlank); + commonFormats.put("da", ddSlash); + commonFormats.put("de", ddDot); + commonFormats.put("el", ddSlash); + commonFormats.put("en-NZ", ddSlash); + commonFormats.put("en-PA", ddSlash); + commonFormats.put("en-PR", ddSlash); + commonFormats.put("en-AU", ddSlash); + commonFormats.put("en-GB", ddSlash); + commonFormats.put("en-IE", ddSlash); + commonFormats.put("en-IN", ddSlash); + commonFormats.put("en-MT", ddSlash); + commonFormats.put("en-SG", ddSlash); + commonFormats.put("en-ZA", yyyySlash); + commonFormats.put("es", ddSlash); + commonFormats.put("es-CL", ddDash); + commonFormats.put("es-PA", mmSlash); + commonFormats.put("es-PR", mmSlash); + commonFormats.put("es-US", mmSlash); + commonFormats.put("et", ddDot); + commonFormats.put("fi", ddDot); + commonFormats.put("fr", ddSlash); + commonFormats.put("fr-CA", yyyyDash); + commonFormats.put("ga", yyyyDash); + commonFormats.put("hi", ddSlash); + commonFormats.put("hr", ddDotBlankDot); + commonFormats.put("hu", yyyyDotBlankDot); + commonFormats.put("id", ddSlash); + commonFormats.put("in", ddSlash); + commonFormats.put("is", ddDot); + commonFormats.put("it", ddSlash); + commonFormats.put("iw", ddDot); + commonFormats.put("ja", yyyySlash); + commonFormats.put("ja-JP-u-ca-japanese", "yy/MM/dd"); + commonFormats.put("ko", yyyyDotBlankDot); + commonFormats.put("lt", yyyyDash); + commonFormats.put("lv", yyyyDotDot); + commonFormats.put("mk", ddDot); + commonFormats.put("ms", ddSlash); + commonFormats.put("mt", mmSlash); + commonFormats.put("nl", ddDash); + commonFormats.put("pl", ddDot); + commonFormats.put("pt", ddSlash); + commonFormats.put("ro", ddDot); + commonFormats.put("ru", ddDot); + commonFormats.put("sk", ddDot); + commonFormats.put("sl", ddDotBlank); + commonFormats.put("sq", ddSlash); + commonFormats.put("sr", ddDotBlankDot); + commonFormats.put("sv", yyyyDash); + commonFormats.put("th", ddSlash); + commonFormats.put("tr", ddDot); + commonFormats.put("uk", ddDot); + commonFormats.put("vi", ddSlash); + commonFormats.put("zh", yyyySlash); + commonFormats.put("zh-HK", ddSlash); + commonFormats.put("zh-SG", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); + + CHROME_FORMATS_.putAll(commonFormats); + IE_FORMATS_.putAll(commonFormats); + + commonFormats.put("en-CA", yyyyDash); + commonFormats.put("en-PH", ddSlash); + commonFormats.put("es-US", ddSlash); + commonFormats.put("ga", ddSlash); + commonFormats.put("fr-CH", ddDot); + commonFormats.put("nl-BE", ddSlash); + commonFormats.put("sk", ddDotBlank); + commonFormats.put("sr", ddDotDot); + commonFormats.put("sq", ddDot); + + FF_68_FORMATS_.putAll(commonFormats); + FF_68_FORMATS_.put("da", ddDot); + + FF_60_FORMATS_.putAll(commonFormats); + FF_60_FORMATS_.put("mt", ddSlash); + + CHROME_FORMATS_.put("be", mmSlash); + CHROME_FORMATS_.put("da", ddDot); CHROME_FORMATS_.put("en-CA", yyyyDash); CHROME_FORMATS_.put("en-IE", ddSlash); CHROME_FORMATS_.put("en-MT", ddSlash); CHROME_FORMATS_.put("en-PH", ddSlash); CHROME_FORMATS_.put("es-US", ddSlash); - CHROME_FORMATS_.put("fr", ddSlash); CHROME_FORMATS_.put("fr-CH", ddDot); + CHROME_FORMATS_.put("ga", mmSlash); CHROME_FORMATS_.put("hr", ddDotBlankDot); - CHROME_FORMATS_.put("in", ddDot); CHROME_FORMATS_.put("in-ID", ddSlash); - CHROME_FORMATS_.put("is", yyyyDash); + CHROME_FORMATS_.put("is", mmSlash); CHROME_FORMATS_.put("iw", ddDot); - CHROME_FORMATS_.put("ja-JP-u-ca-japanese", "平成yy/MM/dd"); - CHROME_FORMATS_.put("lv", yyyyDotDot); - CHROME_FORMATS_.put("mk", yyyyDash); + CHROME_FORMATS_.put("mk", mmSlash); CHROME_FORMATS_.put("nl-BE", ddSlash); CHROME_FORMATS_.put("sk", ddDotBlank); - CHROME_FORMATS_.put("sq", yyyyDash); + CHROME_FORMATS_.put("sq", mmSlash); CHROME_FORMATS_.put("sr", ddDotDot); IE_FORMATS_.put("ar", rightToLeft); @@ -196,7 +194,7 @@ public class DateTimeFormat extends SimpleScriptable { IE_FORMATS_.put("ar-SD", rightToLeft); IE_FORMATS_.put("ar-SY", rightToLeft); IE_FORMATS_.put("ar-YE", rightToLeft); - IE_FORMATS_.put("ban", mmSlash); + IE_FORMATS_.put("ban", ddDot); IE_FORMATS_.put("cs", ddDot); IE_FORMATS_.put("da", ddDash); IE_FORMATS_.put("en-IN", ddDash); @@ -212,10 +210,10 @@ public class DateTimeFormat extends SimpleScriptable { IE_FORMATS_.put("iw", ddSlash); IE_FORMATS_.put("it-CH", ddDot); IE_FORMATS_.put("ja", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); - IE_FORMATS_.put("ja-JP-u-ca-japanese", "\u200E平成\u200E \u200Eyy\u200E年\u200EMM\u200E月\u200Edd\u200E日"); + IE_FORMATS_.put("ja-JP-u-ca-japanese", + "\u200E\u5E73\u6210\u200E \u200Eyy\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); IE_FORMATS_.put("ko", "\u200EYYYY\u200E\uB144 \u200EMM\u200E\uC6D4 \u200Edd\u200E\uC77C"); IE_FORMATS_.put("lt", yyyyDot); - IE_FORMATS_.put("lv", yyyyDotDot); IE_FORMATS_.put("mt", ddSlash); IE_FORMATS_.put("nl-BE", ddSlash); IE_FORMATS_.put("no", ddDot); @@ -225,10 +223,6 @@ public class DateTimeFormat extends SimpleScriptable { IE_FORMATS_.put("sl", ddDot); IE_FORMATS_.put("sq", yyyyDash); IE_FORMATS_.put("sr", ddDot); - IE_FORMATS_.put("sr-BA", mmSlash); - IE_FORMATS_.put("sr-CS", mmSlash); - IE_FORMATS_.put("sr-ME", mmSlash); - IE_FORMATS_.put("sr-RS", mmSlash); IE_FORMATS_.put("zh", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); IE_FORMATS_.put("zh-HK", "\u200EYYYY\u200E\u5E74\u200EMM\u200E\u6708\u200Edd\u200E\u65E5"); } @@ -247,11 +241,11 @@ private DateTimeFormat(final String[] locales, final BrowserVersion browserVersi else if (browserVersion.isIE()) { formats = IE_FORMATS_; } - else if (!browserVersion.isFirefox52()) { - formats = FF_45_FORMATS_; + else if (browserVersion.isFirefox60()) { + formats = FF_60_FORMATS_; } else { - formats = FF_52_FORMATS_; + formats = FF_68_FORMATS_; } String locale = ""; @@ -330,6 +324,16 @@ public String format(final Object object) { return formatter_.format(date); } + /** + * @return A new object with properties reflecting the locale and date and time formatting options + * computed during the initialization of the given {@code DateTimeFormat} object. + */ + @JsxFunction + public Scriptable resolvedOptions() { + final Scriptable object = Context.getCurrentContext().newObject(getParentScope()); + return object; + } + /** * Helper. */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Intl.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Intl.java index 496f2a0a098..71a2eee60c9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Intl.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/Intl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/NumberFormat.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/NumberFormat.java index 931971d4870..21d0acc7a1d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/NumberFormat.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/NumberFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/V8BreakIterator.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/V8BreakIterator.java index e86c57cb53c..1e121f5b995 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/V8BreakIterator.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/V8BreakIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ public V8BreakIterator(final Object locales, final Object types) { else if (locales instanceof String) { locale = new Locale(locales.toString()); } - else if (locales != Undefined.instance) { + else if (!Undefined.isUndefined(locales)) { throw Context.throwAsScriptRuntimeEx(new Exception("Unknown type " + locales.getClass().getName())); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/package-info.java index 373652d39dc..94ac8eb4fe7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AnalyserNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AnalyserNode.java index 9a8f8f3fc29..cb7d7cbd2d5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AnalyserNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AnalyserNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AnalyserNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBuffer.java index 0d01d3f6579..b97a6a68ba9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBuffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioBuffer extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java index 83ed25b3f71..48bd9fe9980 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioBufferSourceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,20 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.AudioScheduledSourceNode; /** * A JavaScript object for {@code AudioBufferSourceNode}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) -public class AudioBufferSourceNode extends AudioNode { +@JsxClass({CHROME, FF}) +public class AudioBufferSourceNode extends AudioScheduledSourceNode { /** * Creates an instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioContext.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioContext.java index 68169211d27..47e3a20f6ac 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioContext.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,28 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; +import com.gargoylesoftware.htmlunit.javascript.PostponedAction; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; +import com.gargoylesoftware.htmlunit.javascript.host.Promise; +import com.gargoylesoftware.htmlunit.javascript.host.Window; + +import net.sourceforge.htmlunit.corejs.javascript.Context; +import net.sourceforge.htmlunit.corejs.javascript.Function; +import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer; /** * A JavaScript object for {@code AudioContext}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioContext extends BaseAudioContext { /** @@ -35,4 +45,53 @@ public class AudioContext extends BaseAudioContext { @JsxConstructor public AudioContext() { } + + /** + * @return a new AudioBufferSourceNode, which can be used to + * play audio data contained within an AudioBuffer object. + */ + @JsxFunction + public AudioBufferSourceNode createBufferSource() { + final AudioBufferSourceNode node = new AudioBufferSourceNode(); + node.setParentScope(getParentScope()); + node.setPrototype(getPrototype(node.getClass())); + return node; + } + + /** + * The decodeAudioData() method of the BaseAudioContext Interface is used to asynchronously + * decode audio file data contained in an ArrayBuffer. In this case the ArrayBuffer is + * loaded from XMLHttpRequest and FileReader. + * The decoded AudioBuffer is resampled to the AudioContext's sampling rate, + * then passed to a callback or promise. + * @param buffer An ArrayBuffer containing the audio data to be decoded, usually grabbed + * from XMLHttpRequest, WindowOrWorkerGlobalScope.fetch() or FileReader + * @param success A callback function to be invoked when the decoding successfully finishes. + * The single argument to this callback is an AudioBuffer representing the decodedData + * (the decoded PCM audio data). Usually you'll want to put the decoded data into + * an AudioBufferSourceNode, from which it can be played and manipulated how you want. + * @param error An optional error callback, to be invoked if an error occurs + * when the audio data is being decoded. + * @return the promise or null + */ + @JsxFunction + public Promise decodeAudioData(final NativeArrayBuffer buffer, final Function success, final Function error) { + final Window window = getWindow(); + final HtmlPage owningPage = (HtmlPage) window.getDocument().getPage(); + final JavaScriptEngine jsEngine = + (JavaScriptEngine) window.getWebWindow().getWebClient().getJavaScriptEngine(); + + if (error != null) { + jsEngine.addPostponedAction(new PostponedAction(owningPage) { + @Override + public void execute() throws Exception { + jsEngine.callFunction(owningPage, error, getParentScope(), AudioContext.this, new Object[] {}); + } + }); + return null; + } + + final Promise promise = Promise.reject(Context.getCurrentContext(), AudioContext.this, new Object[] {}, null); + return promise; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioDestinationNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioDestinationNode.java index bb5b99ab297..4b73c15e60b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioDestinationNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioDestinationNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioDestinationNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioListener.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioListener.java index 2b533df82d5..b12ba0c01b1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioListener.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioListener extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioNode.java index caec5415b5d..09582b2712d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioNode extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioParam.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioParam.java index 5ad2131bacd..8f0802925e5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioParam.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/AudioParam.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class AudioParam extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BaseAudioContext.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BaseAudioContext.java index 634583301c5..0966bd4d34c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BaseAudioContext.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BaseAudioContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,9 +25,9 @@ * A JavaScript object for {@code BaseAudioContext}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -@JsxClass(isJSObject = false, value = FF) +@JsxClass({CHROME, FF}) public class BaseAudioContext extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BiquadFilterNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BiquadFilterNode.java index 07cb6c5fb9a..393010bf1aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BiquadFilterNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/BiquadFilterNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class BiquadFilterNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelMergerNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelMergerNode.java index 697df5f226a..e0bf4d62b6e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelMergerNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelMergerNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class ChannelMergerNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelSplitterNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelSplitterNode.java index 119a128d3ff..47c4b969a7a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelSplitterNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ChannelSplitterNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class ChannelSplitterNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConstantSourceNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConstantSourceNode.java index b4648022772..e42fd1b6921 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConstantSourceNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConstantSourceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,8 +25,9 @@ * A JavaScript object for {@code ConstantSourceNode}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class ConstantSourceNode extends AudioScheduledSourceNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConvolverNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConvolverNode.java index c20bb3d08b1..2b7083a694d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConvolverNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ConvolverNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class ConvolverNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DelayNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DelayNode.java index f1628471edb..a02f95ba58c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DelayNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DelayNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class DelayNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DynamicsCompressorNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DynamicsCompressorNode.java index cb75506dd44..36a0e6c1cb3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DynamicsCompressorNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/DynamicsCompressorNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class DynamicsCompressorNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/GainNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/GainNode.java index 520ab6a96d0..cf7c687dedf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/GainNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/GainNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class GainNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/IIRFilterNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/IIRFilterNode.java index 206fe590982..73899bab72a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/IIRFilterNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/IIRFilterNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -24,8 +24,9 @@ * A JavaScript object for {@code IIRFilterNode}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class IIRFilterNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/InputDeviceCapabilities.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/InputDeviceCapabilities.java index 647252012bc..ab503fbc7a0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/InputDeviceCapabilities.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/InputDeviceCapabilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/LocalMediaStream.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/LocalMediaStream.java index 12a7d507205..b9a876501a3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/LocalMediaStream.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/LocalMediaStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.media; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -23,8 +23,9 @@ * A JavaScript object for {@code LocalMediaStream}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) +@JsxClass(FF60) public class LocalMediaStream extends MediaStream { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDeviceInfo.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDeviceInfo.java index 746cf53e219..fc418c0f21b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDeviceInfo.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDeviceInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDevices.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDevices.java index 67abb4882c3..366c92f83ff 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDevices.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaDevices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class MediaDevices extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaElementAudioSourceNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaElementAudioSourceNode.java index 75eb8849616..7dbe17de55c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaElementAudioSourceNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaElementAudioSourceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class MediaElementAudioSourceNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaError.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaError.java index 13b8796967a..0ad3db09730 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -50,7 +49,7 @@ public class MediaError extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public MediaError() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyError.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyError.java index 548a34980b7..28fcf79acc3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyError.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySession.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySession.java index 9da76210d89..80668d2943f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySession.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyStatusMap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyStatusMap.java index 54e1045b378..78ce6fc3f66 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyStatusMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeyStatusMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySystemAccess.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySystemAccess.java index 9a380eed977..8a5639f3b11 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySystemAccess.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeySystemAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeys.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeys.java index de12e7ed3ef..1a150060cff 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeys.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaKeys.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaRecorder.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaRecorder.java index 0bb1306161e..6a76c230e13 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaRecorder.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaRecorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaSource.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaSource.java index 97eedd76495..9366f277ab1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaSource.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -29,7 +28,7 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class MediaSource extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStream.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStream.java index 1ea88b175a0..860f7f96617 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStream.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class MediaStream extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioDestinationNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioDestinationNode.java index 6dfabb406d4..f1d4a660261 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioDestinationNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioDestinationNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioSourceNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioSourceNode.java index c940f468e68..34fff821cf5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioSourceNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamAudioSourceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class MediaStreamAudioSourceNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamTrack.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamTrack.java index 158b92fdb0f..f2e85912bf1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamTrack.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/MediaStreamTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class MediaStreamTrack extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java index 439303e0b86..51b7b55920c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OfflineAudioContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,20 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction; /** * A JavaScript object for {@code OfflineAudioContext}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) -public class OfflineAudioContext extends AudioContext { +@JsxClass({CHROME, FF}) +public class OfflineAudioContext extends BaseAudioContext { /** * Creates an instance. @@ -35,4 +36,13 @@ public class OfflineAudioContext extends AudioContext { @JsxConstructor public OfflineAudioContext() { } + + /** + * @see + * MDN OfflineAudioContext#startRendering + */ + @JsxFunction + public void startRendering() { + // only a dummy + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java index 629056c5602..8e9be9f8602 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/OscillatorNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,20 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.AudioScheduledSourceNode; /** * A JavaScript object for {@code OscillatorNode}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) -public class OscillatorNode extends AudioNode { +@JsxClass({CHROME, FF}) +public class OscillatorNode extends AudioScheduledSourceNode { /** * Creates an instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PannerNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PannerNode.java index ddf0848d669..d5af17e983b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PannerNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PannerNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class PannerNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PeriodicWave.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PeriodicWave.java index 2eb78d0956a..80aa5be40f5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PeriodicWave.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/PeriodicWave.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -27,7 +26,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class PeriodicWave extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/RemotePlayback.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/RemotePlayback.java index f4bca83600c..986586ae589 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/RemotePlayback.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/RemotePlayback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ScriptProcessorNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ScriptProcessorNode.java index 5f26893e59c..df466e51ef6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ScriptProcessorNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/ScriptProcessorNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class ScriptProcessorNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBuffer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBuffer.java index 1ebd856dfb4..5bfda236e7b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBuffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBufferList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBufferList.java index 3d03df237ea..1e2b19fa4ce 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBufferList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/SourceBufferList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/StereoPannerNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/StereoPannerNode.java index 4cf4ff36175..750d012ac9e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/StereoPannerNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/StereoPannerNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class StereoPannerNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrack.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrack.java index 40442aa52ba..fe42a5cdbc6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrack.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -57,7 +56,7 @@ public class TextTrack extends EventTarget { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TextTrack() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCue.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCue.java index cb5f0f84c79..85b45f5ca37 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCue.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCueList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCueList.java index 84afe41e5a5..858d4a79dc6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCueList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackCueList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class TextTrackCueList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TextTrackCueList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackList.java index ed9a06d0631..168c9481c5a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TextTrackList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class TextTrackList extends EventTarget { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TextTrackList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TimeRanges.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TimeRanges.java index 53ccebc55f1..0d1fec90017 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TimeRanges.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/TimeRanges.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class TimeRanges extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public TimeRanges() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VTTCue.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VTTCue.java index 3cbccf4beec..9890de8aa41 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VTTCue.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VTTCue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VideoPlaybackQuality.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VideoPlaybackQuality.java index a2a4e5792fb..7c146bcd44a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VideoPlaybackQuality.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/VideoPlaybackQuality.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WaveShaperNode.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WaveShaperNode.java index 5d4d9cb4a79..84a5ddf4e1f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WaveShaperNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WaveShaperNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.media; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class WaveShaperNode extends AudioNode { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/webkitMediaStream.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WebkitMediaStream.java similarity index 83% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/webkitMediaStream.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WebkitMediaStream.java index f92a161aaf1..3dd589283ec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/webkitMediaStream.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/WebkitMediaStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code webkitMediaStream}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitMediaStream extends EventTarget { +@JsxClass(value = CHROME, className = "webkitMediaStream") +public class WebkitMediaStream extends EventTarget { /** * Creates an instance. */ @JsxConstructor - public webkitMediaStream() { + public WebkitMediaStream() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIAccess.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIAccess.java index 084b8365513..c8761004212 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIAccess.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInput.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInput.java index 2d2ab6f3bcc..2572e50fa86 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInputMap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInputMap.java index 010a47427d5..712fd3bed32 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInputMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIInputMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutput.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutput.java index 53cc84a0bf5..11d8214dc19 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutput.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutputMap.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutputMap.java index 60462885aac..7ed442dc395 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutputMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIOutputMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIPort.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIPort.java index 4ece541851c..f4a2e884643 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIPort.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/MIDIPort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/package-info.java index 7179f0b29e0..c1344cc1dc8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/midi/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/package-info.java index 7f0a749d401..a56afc89af9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/Presentation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/Presentation.java index 23b00f9e63d..70ac53a5e32 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/Presentation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/Presentation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationAvailability.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationAvailability.java index 11a749d0f1b..865b75ba211 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationAvailability.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationAvailability.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationConnection.java index 2bdd49cd96c..db10bf4d24f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationRequest.java index 16e0b241da2..1ba80654641 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/PresentationRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/package-info.java index c0a2a01444e..4865fcad286 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/presentation/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCIceCandidate.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCIceCandidate.java similarity index 83% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCIceCandidate.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCIceCandidate.java index e1e2adae592..c071f2031aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCIceCandidate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCIceCandidate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code mozRTCIceCandidate}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) -public class mozRTCIceCandidate extends SimpleScriptable { +@JsxClass(value = FF, className = "mozRTCIceCandidate") +public class MozRTCIceCandidate extends SimpleScriptable { /** * Creates a new instance. */ @JsxConstructor - public mozRTCIceCandidate() { + public MozRTCIceCandidate() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCPeerConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCPeerConnection.java similarity index 83% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCPeerConnection.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCPeerConnection.java index a76e6e5b80b..2030f4bade2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCPeerConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCPeerConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code mozRTCPeerConnection}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) -public class mozRTCPeerConnection extends EventTarget { +@JsxClass(value = FF, className = "mozRTCPeerConnection") +public class MozRTCPeerConnection extends EventTarget { /** * Creates a new instance. */ @JsxConstructor - public mozRTCPeerConnection() { + public MozRTCPeerConnection() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCSessionDescription.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCSessionDescription.java similarity index 82% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCSessionDescription.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCSessionDescription.java index b45c17cec09..0a21db5b116 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/mozRTCSessionDescription.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/MozRTCSessionDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code mozRTCSessionDescription}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(FF) -public class mozRTCSessionDescription extends SimpleScriptable { +@JsxClass(value = FF, className = "mozRTCSessionDescription") +public class MozRTCSessionDescription extends SimpleScriptable { /** * Creates a new instance. */ @JsxConstructor - public mozRTCSessionDescription() { + public MozRTCSessionDescription() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCCertificate.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCCertificate.java index 32d87505e5d..13447f0c674 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCCertificate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCCertificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCIceCandidate.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCIceCandidate.java index 8ec119f848e..f29ac257c6c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCIceCandidate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCIceCandidate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCPeerConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCPeerConnection.java index 70fc1392af9..fbd8940d6e8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCPeerConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCPeerConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCSessionDescription.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCSessionDescription.java index f60287e0b15..7c40ad3fa2c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCSessionDescription.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCSessionDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java index c93ec5702b4..f27fc065c85 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/RTCStatsReport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/webkitRTCPeerConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/WebkitRTCPeerConnection.java similarity index 82% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/webkitRTCPeerConnection.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/WebkitRTCPeerConnection.java index a857c02dd9b..db1cd2c6c48 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/webkitRTCPeerConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/WebkitRTCPeerConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code webkitRTCPeerConnection}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitRTCPeerConnection extends EventTarget { +@JsxClass(value = CHROME, className = "webkitRTCPeerConnection") +public class WebkitRTCPeerConnection extends EventTarget { /** * Creates a new instance. */ @JsxConstructor - public webkitRTCPeerConnection() { + public WebkitRTCPeerConnection() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/package-info.java index 1e727705beb..af3add0e849 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/media/rtc/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java deleted file mode 100644 index 0dd38da7d9e..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/moz/MozPowerManager.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.moz; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; - -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; - -/** - * A JavaScript object for {@code MozPowerManager}. - * - * @author Ahmed Ashour - */ -@JsxClass(FF45) -public class MozPowerManager extends SimpleScriptable { - - /** - * Creates a new instance. - */ - @JsxConstructor - public MozPowerManager() { - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/NetworkInformation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/NetworkInformation.java index 5a7a2913477..99fe12293e7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/NetworkInformation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/NetworkInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/package-info.java index c96026c0707..6dc60192fc6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/network/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/package-info.java index f13b49f7385..d73a284ad57 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentAddress.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentAddress.java index b0ef962e60a..d28c781fe91 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentAddress.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentRequest.java index 4d05b20f3f1..76341c6d428 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentResponse.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentResponse.java index da2f98feffc..48f41d74093 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentResponse.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/PaymentResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; /** * A JavaScript object for {@code PaymentResponse}. @@ -27,7 +27,7 @@ * @author Ronald Brill */ @JsxClass(CHROME) -public class PaymentResponse extends SimpleScriptable { +public class PaymentResponse extends EventTarget { /** * Creates an instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/package-info.java index 6c4a39e63fd..40a279eff22 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/payment/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/Performance.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/Performance.java index c2ddfa68df5..b922f5b6fdf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/Performance.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/Performance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -40,7 +39,7 @@ public class Performance extends EventTarget { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public Performance() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceEntry.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceEntry.java index e957a26910c..3ee3037d123 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceEntry.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class PerformanceEntry extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PerformanceEntry() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMark.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMark.java index ecacb2436e5..6e6c8d1d36f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMark.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class PerformanceMark extends PerformanceEntry { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PerformanceMark() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMeasure.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMeasure.java index e31b676f254..794face24fa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMeasure.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceMeasure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class PerformanceMeasure extends PerformanceEntry { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PerformanceMeasure() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigation.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigation.java index 9b6848d99d8..89c37c82544 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigation.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import org.apache.commons.logging.Log; @@ -62,7 +61,7 @@ public class PerformanceNavigation extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PerformanceNavigation() { } @@ -100,7 +99,9 @@ public Object toJSON() { return new JsonParser(Context.getCurrentContext(), getParentScope()).parseValue(jsonString); } catch (final ParseException e) { - LOG.warn("Failed parsingJSON '" + jsonString + "' reason: " + e.getMessage()); + if (LOG.isWarnEnabled()) { + LOG.warn("Failed parsingJSON '" + jsonString + "' reason: " + e.getMessage()); + } } return null; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java index 498c8777ba9..2fbbc07beae 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceNavigationTiming.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,8 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,14 +24,15 @@ * A JavaScript object for {@code PerformanceNavigationTiming}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, IE}) -public class PerformanceNavigationTiming extends SimpleScriptable { +@JsxClass +public class PerformanceNavigationTiming extends PerformanceResourceTiming { /** * Creates an instance. */ - @JsxConstructor(CHROME) + @JsxConstructor({CHROME, FF}) public PerformanceNavigationTiming() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceResourceTiming.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceResourceTiming.java index 404e3971c07..251371a9a2a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceResourceTiming.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceResourceTiming.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class PerformanceResourceTiming extends PerformanceEntry { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PerformanceResourceTiming() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java index fd2eace332d..404c4385e0d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/PerformanceTiming.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.performance; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -54,7 +53,7 @@ public class PerformanceTiming extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public PerformanceTiming() { final long now = System.currentTimeMillis(); @@ -131,7 +130,7 @@ public long getResponseEnd() { /** * @return a secureConnectionStart */ - @JsxGetter(CHROME) + @JsxGetter({CHROME, FF}) public long getSecureConnectionStart() { return 0; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/package-info.java index ad26c6699b8..6d999a4b0f5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/performance/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/Credential.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/Credential.java index 643b2c0a3c7..81fc49c58dd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/Credential.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/Credential.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.security; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code Credential}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class Credential extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/CredentialsContainer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/CredentialsContainer.java index d5f9f3bc111..beec0035e8b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/CredentialsContainer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/CredentialsContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.security; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -24,8 +25,9 @@ * A JavaScript object for {@code CredentialsContainer}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) +@JsxClass({CHROME, FF}) public class CredentialsContainer extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/FederatedCredential.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/FederatedCredential.java index afaf2a3a36a..b2eb6f15e15 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/FederatedCredential.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/FederatedCredential.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/PasswordCredential.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/PasswordCredential.java index d73f7a5ba6c..174d669fee2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/PasswordCredential.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/PasswordCredential.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/package-info.java index c655f64c4c7..c98432bae9f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/security/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesis.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesis.java index 4d668925dfa..fa1bbbcf8a7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesis.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesis.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.speech; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,9 +25,10 @@ * A JavaScript object for {@code SpeechSynthesis}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass(isJSObject = false, value = CHROME) -@JsxClass(FF52) +@JsxClass(FF) public class SpeechSynthesis extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java index d89cfc95e00..8669be0d7d3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisErrorEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,52 +14,20 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.speech; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.host.event.SpeechSynthesisEvent; /** * A JavaScript object for {@code SpeechSynthesisErrorEvent}. * * @author Ronald Brill */ -@JsxClass(FF52) -public class SpeechSynthesisErrorEvent extends SimpleScriptable { - - /** Constant. */ - @JsxConstant(FF52) - public static final int ALT_MASK = 0x1; - - /** Constant. */ - @JsxConstant(FF52) - public static final int CONTROL_MASK = 0x2; - - /** Constant. */ - @JsxConstant(FF52) - public static final int SHIFT_MASK = 0x4; - - /** Constant. */ - @JsxConstant(FF52) - public static final int META_MASK = 0x8; - - /** The first event phase: the capturing phase. */ - @JsxConstant(FF52) - public static final short CAPTURING_PHASE = 1; - - /** The second event phase: at the event target. */ - @JsxConstant(FF52) - public static final short AT_TARGET = 2; - - /** The third (and final) event phase: the bubbling phase. */ - @JsxConstant(FF52) - public static final short BUBBLING_PHASE = 3; - - /** No event phase. */ - @JsxConstant(FF52) - public static final short NONE = 0; +@JsxClass({CHROME, FF}) +public class SpeechSynthesisErrorEvent extends SpeechSynthesisEvent { /** * Creates a new instance. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java index 357a6151aa4..7e29cbc3326 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisUtterance.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.javascript.host.speech; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; @@ -25,8 +25,9 @@ * A JavaScript object for {@code SpeechSynthesisUtterance}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({CHROME, FF52}) +@JsxClass({CHROME, FF}) public class SpeechSynthesisUtterance extends EventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java index 5f59b19f873..20bb549b00d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/SpeechSynthesisVoice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.speech; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -25,7 +25,7 @@ * * @author Ronald Brill */ -@JsxClass(FF52) +@JsxClass(FF) public class SpeechSynthesisVoice extends SimpleScriptable { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechGrammar.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechGrammar.java similarity index 82% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechGrammar.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechGrammar.java index fd34b213f69..79c075a252f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechGrammar.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechGrammar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code webkitSpeechGrammar}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitSpeechGrammar extends SimpleScriptable { +@JsxClass(value = CHROME, className = "webkitSpeechGrammar") +public class WebkitSpeechGrammar extends SimpleScriptable { /** * Creates a new instance. */ @JsxConstructor - public webkitSpeechGrammar() { + public WebkitSpeechGrammar() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechGrammarList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechGrammarList.java similarity index 82% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechGrammarList.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechGrammarList.java index a1c10474ac3..730263129ab 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechGrammarList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechGrammarList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,15 @@ * A JavaScript object for {@code webkitSpeechGrammarList}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitSpeechGrammarList extends SimpleScriptable { +@JsxClass(value = CHROME, className = "webkitSpeechGrammarList") +public class WebkitSpeechGrammarList extends SimpleScriptable { /** * Creates a new instance. */ @JsxConstructor - public webkitSpeechGrammarList() { + public WebkitSpeechGrammarList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechRecognition.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechRecognition.java similarity index 82% rename from src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechRecognition.java rename to src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechRecognition.java index ab3aa044269..80767a7265f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/webkitSpeechRecognition.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/WebkitSpeechRecognition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,15 +24,16 @@ * A JavaScript object for {@code webkitSpeechRecognition}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -public class webkitSpeechRecognition extends EventTarget { +@JsxClass(value = CHROME, className = "webkitSpeechRecognition") +public class WebkitSpeechRecognition extends EventTarget { /** * Creates a new instance. */ @JsxConstructor - public webkitSpeechRecognition() { + public WebkitSpeechRecognition() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/package-info.java index f6d1387aa1c..9c1df045401 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/speech/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/MatrixTransformer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/MatrixTransformer.java index 8c5b9c8431c..96543afbfb8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/MatrixTransformer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/MatrixTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAElement.java index 0cd46bdbe88..b6cee68102c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGAElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAltGlyphElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAltGlyphElement.java deleted file mode 100644 index 3a031bf769e..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAltGlyphElement.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.svg; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.svg.SvgAltGlyph; - -/** - * A JavaScript object for {@code SVGAltGlyphElement}. - * - * @author Ahmed Ashour - * @author Frank Danek - */ -@JsxClass(domClass = SvgAltGlyph.class, value = FF45) -public class SVGAltGlyphElement extends SVGTextPositioningElement { - - /** - * Creates an instance. - */ - @JsxConstructor - public SVGAltGlyphElement() { - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAngle.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAngle.java index 5df44357d77..1decb5f60ed 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAngle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAngle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -54,7 +53,7 @@ public class SVGAngle extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAngle() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateElement.java index fe8b1f786f4..987c77d2fd6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateMotionElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateMotionElement.java index dc15930275b..8e3ac5ebece 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateMotionElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateMotionElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateTransformElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateTransformElement.java index fdae10752a3..a4bda40e9c1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateTransformElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimateTransformElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedAngle.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedAngle.java index e155c9c81e2..223c5bc1635 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedAngle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedAngle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedAngle extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedAngle() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedBoolean.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedBoolean.java index a9df03db4b4..ba25d3691a0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedBoolean.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedBoolean extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedBoolean() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedEnumeration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedEnumeration.java index 1523af1bc33..9eba061e256 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedEnumeration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedEnumeration extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedEnumeration() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedInteger.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedInteger.java index dd29cd09ba5..c13146d4c27 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedInteger.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedInteger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedInteger extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedInteger() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLength.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLength.java index 86f587882d0..831ba34e983 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLength.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLength.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedLength extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedLength() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLengthList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLengthList.java index a99149cdb26..21ec031b0fc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLengthList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedLengthList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedLengthList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedLengthList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumber.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumber.java index 49a3434465a..5e737f9c4b5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumber.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedNumber extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedNumber() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumberList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumberList.java index 0b40a989257..0a5a5b8ae87 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumberList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedNumberList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedNumberList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedNumberList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedPreserveAspectRatio.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedPreserveAspectRatio.java index 5bea03e7656..13b0a422da3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedPreserveAspectRatio.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedPreserveAspectRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedPreserveAspectRatio extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedPreserveAspectRatio() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedRect.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedRect.java index 1a73112cd01..afc19582a00 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedRect.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedRect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedRect extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedRect() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedString.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedString.java index 60dd8b13c3d..c6f379b0c23 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedString.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedString.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedString extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedString() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedTransformList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedTransformList.java index fd8dc6a9b91..ca3d75072f3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedTransformList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimatedTransformList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGAnimatedTransformList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGAnimatedTransformList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimationElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimationElement.java index 50de7c0e432..56a5ddc28b6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimationElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGAnimationElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGCircleElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGCircleElement.java index cf17399a4a8..22e211ffc4e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGCircleElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGCircleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGCircleElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGCircleElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGClipPathElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGClipPathElement.java index 94e97031838..a488e51cb8c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGClipPathElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGClipPathElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -33,19 +32,19 @@ public class SVGClipPathElement extends SVGElement { /** Constant for {@code SVG_UNIT_TYPE_UNKNOWN}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_UNKNOWN = 0; /** Constant for {@code SVG_UNIT_TYPE_USERSPACEONUSE}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_USERSPACEONUSE = 1; /** Constant for {@code SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGClipPathElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGComponentTransferFunctionElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGComponentTransferFunctionElement.java index 080e26bc72b..f6ddd3420b3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGComponentTransferFunctionElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGComponentTransferFunctionElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -52,7 +51,7 @@ public class SVGComponentTransferFunctionElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGComponentTransferFunctionElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDefsElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDefsElement.java index 09b92b1c268..c0a613ac348 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDefsElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDefsElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGDefsElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGDefsElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDescElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDescElement.java index 7f9ec276635..6e670b721b4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDescElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDescElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGDescElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGDescElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDiscardElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDiscardElement.java index 9256bb40c7b..5f82c4e170c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDiscardElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDiscardElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDocument.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDocument.java deleted file mode 100644 index 04df23b92f9..00000000000 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGDocument.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2002-2018 Gargoyle 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 - * http://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 com.gargoylesoftware.htmlunit.javascript.host.svg; - -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; - -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; -import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; - -/** - * A JavaScript object for {@code SVGDocument}. - * - * @author Ahmed Ashour - */ -@JsxClass(FF45) -public class SVGDocument extends Document { - - /** - * Creates an instance. - */ - @JsxConstructor - public SVGDocument() { - } -} diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java index abda22c22e8..34d69aa6f4c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF60; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -44,7 +42,7 @@ public class SVGElement extends Element { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGElement() { } @@ -437,24 +435,6 @@ public void setOnpointerleave(final Object pointerleave) { setEventHandler("pointerleave", pointerleave); } - /** - * Returns the {@code onmozpointerlockchange} event handler. - * @return the {@code onmozpointerlockchange} event handler - */ - @JsxGetter(FF45) - public Function getOnmozpointerlockchange() { - return getEventHandler("mozpointerlockchange"); - } - - /** - * Sets the {@code onmozpointerlockchange} event handler. - * @param mozpointerlockchange the {@code onmozpointerlockchange} event handler - */ - @JsxSetter(FF45) - public void setOnmozpointerlockchange(final Object mozpointerlockchange) { - setEventHandler("mozpointerlockchange", mozpointerlockchange); - } - /** * Returns the {@code onclick} event handler. * @return the {@code onclick} event handler @@ -657,7 +637,7 @@ public void setOnloadedmetadata(final Object loadedmetadata) { * Returns the {@code ontoggle} event handler. * @return the {@code ontoggle} event handler */ - @JsxGetter({CHROME, FF52}) + @JsxGetter(CHROME) public Function getOntoggle() { return getEventHandler("toggle"); } @@ -666,7 +646,7 @@ public Function getOntoggle() { * Sets the {@code ontoggle} event handler. * @param toggle the {@code ontoggle} event handler */ - @JsxSetter({CHROME, FF52}) + @JsxSetter(CHROME) public void setOntoggle(final Object toggle) { setEventHandler("toggle", toggle); } @@ -851,24 +831,6 @@ public void setOninput(final Object input) { setEventHandler(Event.TYPE_INPUT, input); } - /** - * Returns the {@code onmozpointerlockerror} event handler. - * @return the {@code onmozpointerlockerror} event handler - */ - @JsxGetter(FF45) - public Function getOnmozpointerlockerror() { - return getEventHandler("mozpointerlockerror"); - } - - /** - * Sets the {@code onmozpointerlockerror} event handler. - * @param mozpointerlockerror the {@code onmozpointerlockerror} event handler - */ - @JsxSetter(FF45) - public void setOnmozpointerlockerror(final Object mozpointerlockerror) { - setEventHandler("mozpointerlockerror", mozpointerlockerror); - } - /** * {@inheritDoc} */ @@ -1482,201 +1444,20 @@ public void setOngotpointercapture(final Object gotpointercapture) { } /** - * Returns the {@code onanimationiteration} event handler. - * @return the {@code onanimationiteration} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationiteration() { - return getEventHandler("animationiteration"); - } - - /** - * Sets the {@code onanimationiteration} event handler. - * @param animationiteration the {@code onanimationiteration} event handler - */ - @JsxSetter(FF52) - public void setOnanimationiteration(final Object animationiteration) { - setEventHandler("animationiteration", animationiteration); - } - - /** - * Returns the {@code onwebkittransitionend} event handler. - * @return the {@code onwebkittransitionend} event handler + * Returns the {@code onwheel} event handler for this element. + * @return the {@code onwheel} event handler for this element */ - @JsxGetter(FF52) - public Function getOnwebkittransitionend() { - return getEventHandler("webkittransitionend"); + @JsxGetter({CHROME, FF60}) + public Function getOnwheel() { + return getEventHandler("wheel"); } /** - * Sets the {@code onwebkittransitionend} event handler. - * @param webkittransitionend the {@code onwebkittransitionend} event handler + * Sets the {@code onwheel} event handler for this element. + * @param onwheel the {@code onwheel} event handler for this element */ - @JsxSetter(FF52) - public void setOnwebkittransitionend(final Object webkittransitionend) { - setEventHandler("webkittransitionend", webkittransitionend); + @JsxSetter({CHROME, FF60}) + public void setOnwheel(final Object onwheel) { + setEventHandler("wheel", onwheel); } - - /** - * Returns the {@code onanimationstart} event handler. - * @return the {@code onanimationstart} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationstart() { - return getEventHandler("animationstart"); - } - - /** - * Sets the {@code onanimationstart} event handler. - * @param animationstart the {@code onanimationstart} event handler - */ - @JsxSetter(FF52) - public void setOnanimationstart(final Object animationstart) { - setEventHandler("animationstart", animationstart); - } - - /** - * Returns the {@code onwebkitanimationstart} event handler. - * @return the {@code onwebkitanimationstart} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationstart() { - return getEventHandler("webkitanimationstart"); - } - - /** - * Sets the {@code onwebkitanimationstart} event handler. - * @param webkitanimationstart the {@code onwebkitanimationstart} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationstart(final Object webkitanimationstart) { - setEventHandler("webkitanimationstart", webkitanimationstart); - } - - /** - * Returns the {@code onwebkitanimationiteration} event handler. - * @return the {@code onwebkitanimationiteration} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationiteration() { - return getEventHandler("webkitanimationiteration"); - } - - /** - * Sets the {@code onwebkitanimationiteration} event handler. - * @param webkitanimationiteration the {@code onwebkitanimationiteration} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationiteration(final Object webkitanimationiteration) { - setEventHandler("webkitanimationiteration", webkitanimationiteration); - } - - /** - * Returns the {@code onanimationend} event handler. - * @return the {@code onanimationend} event handler - */ - @JsxGetter(FF52) - public Function getOnanimationend() { - return getEventHandler("animationend"); - } - - /** - * Sets the {@code onanimationend} event handler. - * @param animationend the {@code onanimationend} event handler - */ - @JsxSetter(FF52) - public void setOnanimationend(final Object animationend) { - setEventHandler("animationend", animationend); - } - - /** - * Returns the {@code onwebkitanimationend} event handler. - * @return the {@code onwebkitanimationend} event handler - */ - @JsxGetter(FF52) - public Function getOnwebkitanimationend() { - return getEventHandler("webkitanimationend"); - } - - /** - * Sets the {@code onwebkitanimationend} event handler. - * @param webkitanimationend the {@code onwebkitanimationend} event handler - */ - @JsxSetter(FF52) - public void setOnwebkitanimationend(final Object webkitanimationend) { - setEventHandler("webkitanimationend", webkitanimationend); - } - - /** - * Returns the {@code ontransitionend} event handler. - * @return the {@code ontransitionend} event handler - */ - @JsxGetter(FF52) - public Function getOntransitionend() { - return getEventHandler("transitionend"); - } - - /** - * Sets the {@code ontransitionend} event handler. - * @param transitionend the {@code ontransitionend} event handler - */ - @JsxSetter(FF52) - public void setOntransitionend(final Object transitionend) { - setEventHandler("transitionend", transitionend); - } - - /** - * {@inheritDoc} - */ - @Override - @JsxGetter(FF52) - public Function getOnselectstart() { - return getEventHandler("selectstart"); - } - - /** - * {@inheritDoc} - */ - @Override - @JsxSetter(FF52) - public void setOnselectstart(final Object selectstart) { - setEventHandler("selectstart", selectstart); - } - - /** - * Returns the {@code onloadend} event handler. - * @return the {@code onloadend} event handler - */ - @JsxGetter(FF52) - public Function getOnloadend() { - return getEventHandler("loadend"); - } - - /** - * Sets the {@code onloadend} event handler. - * @param loadend the {@code onloadend} event handler - */ - @JsxSetter(FF52) - public void setOnloadend(final Object loadend) { - setEventHandler("loadend", loadend); - } - - /** - * Returns the {@code ondragexit} event handler. - * @return the {@code ondragexit} event handler - */ - @JsxGetter(FF52) - public Function getOndragexit() { - return getEventHandler("dragexit"); - } - - /** - * Sets the {@code ondragexit} event handler. - * @param dragexit the {@code ondragexit} event handler - */ - @JsxSetter(FF52) - public void setOndragexit(final Object dragexit) { - setEventHandler("dragexit", dragexit); - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGEllipseElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGEllipseElement.java index 8f63073dc26..167ddbe4546 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGEllipseElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGEllipseElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGEllipseElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGEllipseElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEBlendElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEBlendElement.java index 4d6f3f7e948..216c5974978 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEBlendElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEBlendElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -50,43 +49,43 @@ public class SVGFEBlendElement extends SVGElement { @JsxConstant public static final int SVG_FEBLEND_MODE_LIGHTEN = 5; /** The constant {@code SVG_FEBLEND_MODE_OVERLAY}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_OVERLAY = 6; /** The constant {@code SVG_FEBLEND_MODE_COLOR_DODGE}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_COLOR_DODGE = 7; /** The constant {@code SVG_FEBLEND_MODE_COLOR_BURN}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_COLOR_BURN = 8; /** The constant {@code SVG_FEBLEND_MODE_HARD_LIGHT}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_HARD_LIGHT = 9; /** The constant {@code SVG_FEBLEND_MODE_SOFT_LIGHT}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_SOFT_LIGHT = 10; /** The constant {@code SVG_FEBLEND_MODE_DIFFERENCE}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_DIFFERENCE = 11; /** The constant {@code SVG_FEBLEND_MODE_EXCLUSION}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_EXCLUSION = 12; /** The constant {@code SVG_FEBLEND_MODE_HUE}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_HUE = 13; /** The constant {@code SVG_FEBLEND_MODE_SATURATION}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_SATURATION = 14; /** The constant {@code SVG_FEBLEND_MODE_COLOR}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_COLOR = 15; /** The constant {@code SVG_FEBLEND_MODE_LUMINOSITY}. */ - @JsxConstant(FF) + @JsxConstant({CHROME, FF}) public static final int SVG_FEBLEND_MODE_LUMINOSITY = 16; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEBlendElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEColorMatrixElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEColorMatrixElement.java index 1765d18d230..bd70fe86dde 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEColorMatrixElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEColorMatrixElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -50,7 +49,7 @@ public class SVGFEColorMatrixElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEColorMatrixElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEComponentTransferElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEComponentTransferElement.java index eb96e198b07..ce30cc0e12e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEComponentTransferElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEComponentTransferElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEComponentTransferElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEComponentTransferElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFECompositeElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFECompositeElement.java index a5625249db1..e6449754624 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFECompositeElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFECompositeElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -56,7 +55,7 @@ public class SVGFECompositeElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFECompositeElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEConvolveMatrixElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEConvolveMatrixElement.java index f42eb507113..53be60f41bc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEConvolveMatrixElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEConvolveMatrixElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -47,7 +46,7 @@ public class SVGFEConvolveMatrixElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEConvolveMatrixElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDiffuseLightingElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDiffuseLightingElement.java index c70d6e504e5..3dee9c64c68 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDiffuseLightingElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDiffuseLightingElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEDiffuseLightingElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEDiffuseLightingElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDisplacementMapElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDisplacementMapElement.java index 5868f2f1a15..f0b9f91179a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDisplacementMapElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDisplacementMapElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -50,7 +49,7 @@ public class SVGFEDisplacementMapElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEDisplacementMapElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDistantLightElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDistantLightElement.java index 79dce49348e..ab0c7ee45a8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDistantLightElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDistantLightElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEDistantLightElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEDistantLightElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDropShadowElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDropShadowElement.java index aaccf2ce235..6985485a06f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDropShadowElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEDropShadowElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFloodElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFloodElement.java index 182ca685c27..f880c926c92 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFloodElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFloodElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEFloodElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEFloodElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncAElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncAElement.java index 7abdb4e038c..843e4b7aa63 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncAElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncAElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEFuncAElement extends SVGComponentTransferFunctionElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEFuncAElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncBElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncBElement.java index d5c68be4434..7984fe36f82 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncBElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncBElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEFuncBElement extends SVGComponentTransferFunctionElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEFuncBElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncGElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncGElement.java index dba1d0edfb1..62d97bbd390 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncGElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncGElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEFuncGElement extends SVGComponentTransferFunctionElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEFuncGElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncRElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncRElement.java index a4f4cf6c53e..68dcaa2e2b5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncRElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEFuncRElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEFuncRElement extends SVGComponentTransferFunctionElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEFuncRElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEGaussianBlurElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEGaussianBlurElement.java index a0dc8c5d621..c48370dd6a0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEGaussianBlurElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEGaussianBlurElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEGaussianBlurElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEGaussianBlurElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEImageElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEImageElement.java index 55a972acf34..8dbc2184d46 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEImageElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEImageElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEImageElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEImageElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeElement.java index 7b56b7dac10..2723d4f53f9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEMergeElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEMergeElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeNodeElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeNodeElement.java index 72de335894f..c13e34f07ec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeNodeElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMergeNodeElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEMergeNodeElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEMergeNodeElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMorphologyElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMorphologyElement.java index d3fc0601fd8..fd348f5faa7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMorphologyElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEMorphologyElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -44,7 +43,7 @@ public class SVGFEMorphologyElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEMorphologyElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEOffsetElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEOffsetElement.java index 7dcf791ad65..b73a0a46605 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEOffsetElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEOffsetElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEOffsetElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEOffsetElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEPointLightElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEPointLightElement.java index caa36eb46dc..866e5613eb7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEPointLightElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFEPointLightElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFEPointLightElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFEPointLightElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpecularLightingElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpecularLightingElement.java index 7425ff64d01..0477ff4ae74 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpecularLightingElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpecularLightingElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFESpecularLightingElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFESpecularLightingElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpotLightElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpotLightElement.java index 8f85019a924..23830e8726e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpotLightElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFESpotLightElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFESpotLightElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFESpotLightElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETileElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETileElement.java index 0fb4dfda213..79b33c7c20c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETileElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETileElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGFETileElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFETileElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETurbulenceElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETurbulenceElement.java index f33ca03c18d..0d6bd2cb6b2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETurbulenceElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFETurbulenceElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -53,7 +52,7 @@ public class SVGFETurbulenceElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFETurbulenceElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFilterElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFilterElement.java index a584bfea8eb..31507d31388 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFilterElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGFilterElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -33,19 +32,19 @@ public class SVGFilterElement extends SVGElement { /** Constant for {@code SVG_UNIT_TYPE_UNKNOWN}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_UNKNOWN = 0; /** Constant for {@code SVG_UNIT_TYPE_USERSPACEONUSE}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_USERSPACEONUSE = 1; /** Constant for {@code SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGFilterElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGForeignObjectElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGForeignObjectElement.java index b9a54619606..7d7c602124f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGForeignObjectElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGForeignObjectElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -28,7 +27,7 @@ * @author Ahmed Ashour * @author Frank Danek */ -@JsxClass(domClass = SvgForeignObject.class, value = {FF, CHROME, EDGE}) +@JsxClass(domClass = SvgForeignObject.class, value = {FF, CHROME}) public class SVGForeignObjectElement extends SVGGraphicsElement { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java index 0e0b1df74ee..faa8b5ff8f7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -34,7 +33,7 @@ public class SVGGElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGGElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java index b85964ac3d9..fff4932f13b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGeometryElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -27,9 +26,10 @@ * A JavaScript object for {@code SVGGeometryElement}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass(CHROME) -@JsxClass(isJSObject = false, value = {IE, FF, EDGE}) +@JsxClass({CHROME, FF}) +@JsxClass(isJSObject = false, value = IE) public class SVGGeometryElement extends SVGGraphicsElement { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGradientElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGradientElement.java index 496cce0fad8..124a5923b33 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGradientElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGradientElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -44,19 +43,19 @@ public class SVGGradientElement extends SVGElement { @JsxConstant public static final int SVG_SPREADMETHOD_REPEAT = 3; /** Constant for {@code SVG_UNIT_TYPE_UNKNOWN}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_UNKNOWN = 0; /** Constant for {@code SVG_UNIT_TYPE_USERSPACEONUSE}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_USERSPACEONUSE = 1; /** Constant for {@code SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGGradientElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGraphicsElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGraphicsElement.java index 61328214bfd..9ca210f25e9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGraphicsElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGGraphicsElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGImageElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGImageElement.java index 1c90d0e9b7d..0eb10eee0c4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGImageElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGImageElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGImageElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGImageElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLength.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLength.java index 6995cbf2078..f0e4d8ba317 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLength.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLength.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -68,7 +67,7 @@ public class SVGLength extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGLength() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLengthList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLengthList.java index ffbaac913eb..6c58d26453d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLengthList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLengthList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGLengthList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGLengthList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLineElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLineElement.java index 8aeddc3e8ad..e9cd4436898 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLineElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLineElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGLineElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGLineElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLinearGradientElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLinearGradientElement.java index b0fd29c4cad..f1ad4da6259 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLinearGradientElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGLinearGradientElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGLinearGradientElement extends SVGGradientElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGLinearGradientElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMPathElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMPathElement.java index e15fb8f19c5..dc038bb26b7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMPathElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMPathElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMarkerElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMarkerElement.java index b77fbac073e..7a5c0819f6d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMarkerElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMarkerElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -53,7 +52,7 @@ public class SVGMarkerElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGMarkerElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMaskElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMaskElement.java index dda1b6ebc94..109deb63e60 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMaskElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMaskElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -39,19 +38,19 @@ public class SVGMaskElement extends SVGElement { @JsxConstant(FF) public static final int SVG_MASKTYPE_ALPHA = 1; /** Constant for {@code SVG_UNIT_TYPE_UNKNOWN}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_UNKNOWN = 0; /** Constant for {@code SVG_UNIT_TYPE_USERSPACEONUSE}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_USERSPACEONUSE = 1; /** Constant for {@code SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGMaskElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMatrix.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMatrix.java index 23f12c2161f..8ddc45ceb97 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMatrix.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMatrix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -43,7 +42,7 @@ public class SVGMatrix extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGMatrix() { svgMatrix_ = new MatrixTransformer.SvgMatrix(); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMetadataElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMetadataElement.java index e8bc1a821aa..71981bcec01 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMetadataElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGMetadataElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGMetadataElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGMetadataElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumber.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumber.java index f48c538efda..0ee3112485e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumber.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGNumber extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGNumber() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumberList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumberList.java index 40c26a677cf..b77f23d482b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumberList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGNumberList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGNumberList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGNumberList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathElement.java index d704e233329..236089dda47 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -35,7 +34,7 @@ public class SVGPathElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPathElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSeg.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSeg.java index 59f3d529749..44eec4fcb8e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSeg.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSeg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +14,19 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSeg}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSeg extends SimpleScriptable { /** The constant {@code PATHSEG_UNKNOWN}. */ @@ -91,12 +89,4 @@ public class SVGPathSeg extends SimpleScriptable { /** The constant {@code PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL}. */ @JsxConstant public static final int PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSeg() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcAbs.java index b916e82a8fb..f662b1bf407 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegArcAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegArcAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegArcAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcRel.java index 3ac9c575cc5..9815907f35f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegArcRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegArcRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegArcRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegArcRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegClosePath.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegClosePath.java index 19988780afc..cd5293473fd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegClosePath.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegClosePath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegClosePath}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegClosePath extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegClosePath() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicAbs.java index c9a37ed3be5..5a9950d717c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoCubicAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoCubicAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicRel.java index ca336003df3..67bb9f0204e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoCubicRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoCubicRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoCubicRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothAbs.java index 97d7726190d..f78d71ea21c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoCubicSmoothAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoCubicSmoothAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothRel.java index 3c485c6a924..b7451d642b1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoCubicSmoothRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoCubicSmoothRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoCubicSmoothRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticAbs.java index 5ec782a872b..b04b3714609 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoQuadraticAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoQuadraticAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticRel.java index 2e90664b260..19c397c012f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoQuadraticRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoQuadraticRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java index 0ef3d3c7c39..7bedde76a4f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -25,14 +24,15 @@ * A JavaScript object for {@code SVGPathSegCurvetoQuadraticSmoothAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { /** * Creates an instance. */ - @JsxConstructor({FF, EDGE}) + @JsxConstructor(FF) public SVGPathSegCurvetoQuadraticSmoothAbs() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothRel.java index 72e79092d93..7afc5ab9a32 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegCurvetoQuadraticSmoothRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegCurvetoQuadraticSmoothRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegCurvetoQuadraticSmoothRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoAbs.java index 624f8e3b710..013028ea688 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegLinetoAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegLinetoAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegLinetoAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalAbs.java index 304c0408c76..77ef1afd2eb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegLinetoHorizontalAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegLinetoHorizontalAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalRel.java index 1bb8795781e..1a1b717d888 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoHorizontalRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegLinetoHorizontalRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegLinetoHorizontalRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoRel.java index 2b63f1ef019..b423ae8f229 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegLinetoRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegLinetoRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegLinetoRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalAbs.java index 0b6e8eceb2b..f17f138fdba 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegLinetoVerticalAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegLinetoVerticalAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalRel.java index b31a8f8ac35..fb7d90f0efa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegLinetoVerticalRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegLinetoVerticalRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegLinetoVerticalRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegLinetoVerticalRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegList.java index 4bfa1a80944..f1797e898c5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -27,13 +26,13 @@ * * @author Ahmed Ashour */ -@JsxClass({FF, IE, EDGE}) +@JsxClass({FF, IE}) public class SVGPathSegList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({FF, EDGE}) + @JsxConstructor(FF) public SVGPathSegList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoAbs.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoAbs.java index 068f514f2a7..c8307b45831 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoAbs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoAbs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegMovetoAbs}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegMovetoAbs extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegMovetoAbs() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoRel.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoRel.java index f6d183ff9bb..1f6f8f39495 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoRel.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPathSegMovetoRel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,16 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.svg; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; -import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; /** * A JavaScript object for {@code SVGPathSegMovetoRel}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@JsxClass({FF, IE, EDGE}) +@JsxClass(IE) public class SVGPathSegMovetoRel extends SVGPathSeg { - - /** - * Creates an instance. - */ - @JsxConstructor({FF, EDGE}) - public SVGPathSegMovetoRel() { - } - } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPatternElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPatternElement.java index cfcd104359d..5eac2e5a4ff 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPatternElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPatternElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -33,19 +32,19 @@ public class SVGPatternElement extends SVGElement { /** Constant for {@code SVG_UNIT_TYPE_UNKNOWN}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_UNKNOWN = 0; /** Constant for {@code SVG_UNIT_TYPE_USERSPACEONUSE}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_USERSPACEONUSE = 1; /** Constant for {@code SVG_UNIT_TYPE_OBJECTBOUNDINGBOX}. */ - @JsxConstant({FF, IE}) + @JsxConstant(IE) public static final int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPatternElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPoint.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPoint.java index 8df0a3eff8e..7106dae8ea3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPoint.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGPoint extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPoint() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPointList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPointList.java index a0de187dae9..321abc9b1ec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPointList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPointList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGPointList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPointList() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolygonElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolygonElement.java index 6f01073d969..9cd002c4cef 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolygonElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolygonElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGPolygonElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPolygonElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolylineElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolylineElement.java index 7abf69fbd7a..bbaa70979a4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolylineElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPolylineElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGPolylineElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPolylineElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPreserveAspectRatio.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPreserveAspectRatio.java index ae6650b8cc9..62cc20806d9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPreserveAspectRatio.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGPreserveAspectRatio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -77,7 +76,7 @@ public class SVGPreserveAspectRatio extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGPreserveAspectRatio() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRadialGradientElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRadialGradientElement.java index f0ee48870a7..a15fb63bc3d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRadialGradientElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRadialGradientElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGRadialGradientElement extends SVGGradientElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGRadialGradientElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRect.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRect.java index b69014610e9..1a28278e7d0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRect.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -40,7 +39,7 @@ public class SVGRect extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGRect() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRectElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRectElement.java index a4ebb325689..4e38589486e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRectElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGRectElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGRectElement extends SVGGeometryElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGRectElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSVGElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSVGElement.java index e64a64cf2fc..682d77a033e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSVGElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSVGElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.html.HtmlSvg; @@ -45,7 +44,7 @@ public class SVGSVGElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGSVGElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGScriptElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGScriptElement.java index d83bf78629d..3113bb5c8d7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGScriptElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGScriptElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGScriptElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGScriptElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSetElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSetElement.java index 7ee1babd2ef..4196c6e7b70 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSetElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSetElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStopElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStopElement.java index 4d53e2f11ee..a40dbf4f1f9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStopElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStopElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGStopElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGStopElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStringList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStringList.java index a163aa6699e..8a9cdee45cf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStringList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStringList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGStringList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGStringList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStyleElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStyleElement.java index 7d24c4ca70d..ca76a92586a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStyleElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGStyleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGStyleElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGStyleElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSwitchElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSwitchElement.java index 37e42e3e76b..abd2ee482d2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSwitchElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSwitchElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGSwitchElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGSwitchElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSymbolElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSymbolElement.java index d930064dad7..e1f57e33862 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSymbolElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGSymbolElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGSymbolElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGSymbolElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTSpanElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTSpanElement.java index b9c988417d7..0f31b3678e8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTSpanElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTSpanElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGTSpanElement extends SVGTextPositioningElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTSpanElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextContentElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextContentElement.java index 6f2197bb2f0..2fbb05565ad 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextContentElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextContentElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -45,7 +44,7 @@ public class SVGTextContentElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTextContentElement() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextElement.java index d8a30e37c63..07cc8c14b91 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -34,7 +33,7 @@ public class SVGTextElement extends SVGTextPositioningElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTextElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPathElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPathElement.java index 3e41de6a61c..5a1483b772e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPathElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPathElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -53,7 +52,7 @@ public class SVGTextPathElement extends SVGTextContentElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTextPathElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPositioningElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPositioningElement.java index 4e5fab5cf54..db266a874be 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPositioningElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTextPositioningElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -32,7 +31,7 @@ public class SVGTextPositioningElement extends SVGTextContentElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTextPositioningElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTitleElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTitleElement.java index 781849f3266..0e63b7ed19b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTitleElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTitleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGTitleElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTitleElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransform.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransform.java index 19ac7332f85..33fc9b7056d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransform.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -56,7 +55,7 @@ public class SVGTransform extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTransform() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransformList.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransformList.java index e34362f9d99..6fdcc2b6bf9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransformList.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGTransformList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -33,7 +32,7 @@ public class SVGTransformList extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGTransformList() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUnitTypes.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUnitTypes.java index 6220a6249ad..1d8db109d34 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUnitTypes.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUnitTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.SimpleScriptable; @@ -44,7 +43,7 @@ public class SVGUnitTypes extends SimpleScriptable { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGUnitTypes() { } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUseElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUseElement.java index 9a77ab29132..a64cf47e15e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUseElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGUseElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -33,7 +32,7 @@ public class SVGUseElement extends SVGGraphicsElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGUseElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGViewElement.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGViewElement.java index 6ec36080080..71504fc5a34 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGViewElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGViewElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.svg; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -44,7 +43,7 @@ public class SVGViewElement extends SVGElement { /** * Creates an instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public SVGViewElement() { } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/package-info.java index 6d0b609e968..90d5474dca8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/svg/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/webkitURL.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/webkitURL.java index b955a8c535e..701c99d4549 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/webkitURL.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/webkitURL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ * A JavaScript object for {@code webkitURL}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass(CHROME) public class webkitURL extends URL { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java index 20973b67613..f8b6df9d11f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ import net.sourceforge.htmlunit.corejs.javascript.Function; import net.sourceforge.htmlunit.corejs.javascript.Script; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; +import net.sourceforge.htmlunit.corejs.javascript.Undefined; /** * The scope for the execution of {@link Worker}s. @@ -81,7 +82,7 @@ public DedicatedWorkerGlobalScope() { */ DedicatedWorkerGlobalScope(final Window owningWindow, final Context context, final BrowserVersion browserVersion, final Worker worker) throws Exception { - context.initStandardObjects(this); + context.initSafeStandardObjects(this); final ClassConfiguration config = AbstractJavaScriptConfiguration.getClassConfiguration( DedicatedWorkerGlobalScope.class, browserVersion); @@ -111,7 +112,8 @@ public Object getSelf() { @JsxFunction public void postMessage(final Object message) { final MessageEvent event = new MessageEvent(); - event.initMessageEvent(Event.TYPE_MESSAGE, false, false, message, origin_, "", owningWindow_, null); + event.initMessageEvent(Event.TYPE_MESSAGE, false, false, message, origin_, "", + owningWindow_, Undefined.instance); event.setParentScope(owningWindow_); event.setPrototype(owningWindow_.getPrototype(event.getClass())); @@ -120,12 +122,13 @@ public void postMessage(final Object message) { } final JavaScriptEngine jsEngine = (JavaScriptEngine) owningWindow_.getWebWindow().getWebClient().getJavaScriptEngine(); - final ContextAction action = new ContextAction() { + final ContextAction action = new ContextAction() { @Override public Object run(final Context cx) { worker_.getEventListenersContainer().executeCapturingListeners(event, null); final Object[] args = new Object[] {event}; - return worker_.getEventListenersContainer().executeBubblingListeners(event, args, args); + worker_.getEventListenersContainer().executeBubblingListeners(event, args); + return null; } }; @@ -139,13 +142,14 @@ public Object run(final Context cx) { void messagePosted(final Object message) { final MessageEvent event = new MessageEvent(); - event.initMessageEvent(Event.TYPE_MESSAGE, false, false, message, origin_, "", owningWindow_, null); + event.initMessageEvent(Event.TYPE_MESSAGE, false, false, message, origin_, "", + owningWindow_, Undefined.instance); event.setParentScope(owningWindow_); event.setPrototype(owningWindow_.getPrototype(event.getClass())); final JavaScriptEngine jsEngine = (JavaScriptEngine) owningWindow_.getWebWindow().getWebClient().getJavaScriptEngine(); - final ContextAction action = new ContextAction() { + final ContextAction action = new ContextAction() { @Override public Object run(final Context cx) { return executeEvent(cx, event); @@ -202,7 +206,7 @@ void loadAndExecute(final String url, final Context context) throws IOException final JavaScriptEngine javaScriptEngine = (JavaScriptEngine) webClient.getJavaScriptEngine(); final DedicatedWorkerGlobalScope thisScope = this; - final ContextAction action = new ContextAction() { + final ContextAction action = new ContextAction() { @Override public Object run(final Context cx) { final Script script = javaScriptEngine.compile(page, thisScope, scriptCode, @@ -226,10 +230,10 @@ public Object run(final Context cx) { class WorkerJob extends BasicJavaScriptJob { private final ContextFactory contextFactory_; - private final ContextAction action_; + private final ContextAction action_; private final String description_; - WorkerJob(final ContextFactory contextFactory, final ContextAction action, final String description) { + WorkerJob(final ContextFactory contextFactory, final ContextAction action, final String description) { contextFactory_ = contextFactory; action_ = action; description_ = description; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorker.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorker.java index 3b51217eff3..edad6901074 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorker.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerContainer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerContainer.java index 86d6e9510e1..b09a4912b78 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerContainer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerRegistration.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerRegistration.java index cf693eafaa9..6998f4b0757 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerRegistration.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/ServiceWorkerRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/SyncManager.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/SyncManager.java index d9e9060d2b4..1cc5d3d263e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/SyncManager.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/SyncManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/Worker.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/Worker.java index 0f321a2d4c1..24274ba992e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/Worker.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/Worker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/package-info.java index 60415739064..7138071cb76 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/worker/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/FormData.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/FormData.java index 8b5be6acc8a..804e90442bb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/FormData.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/FormData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.xml; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_FORM_DATA_CONTENT_TYPE_PLAIN_IF_FILE_TYPE_UNKNOWN; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; @@ -33,6 +34,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.file.File; import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLFormElement; import com.gargoylesoftware.htmlunit.util.KeyDataPair; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; import net.sourceforge.htmlunit.corejs.javascript.Context; @@ -85,7 +87,12 @@ public void append(final String name, final Object value, final Object filename) } contentType = file.getType(); if (StringUtils.isEmpty(contentType)) { - contentType = "application/octet-stream"; + if (getBrowserVersion().hasFeature(JS_FORM_DATA_CONTENT_TYPE_PLAIN_IF_FILE_TYPE_UNKNOWN)) { + contentType = MimeType.TEXT_PLAIN; + } + else { + contentType = MimeType.APPLICATION_OCTET_STREAM; + } } requestParameters_.add(new KeyDataPair(name, file.getFile(), fileName, contentType, (Charset) null)); } @@ -152,7 +159,7 @@ public Scriptable getAll(final String name) { } } - final Object[] stringValues = values.toArray(new Object[values.size()]); + final Object[] stringValues = values.toArray(new Object[0]); return Context.getCurrentContext().newArray(this, stringValues); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocument.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocument.java index d7e5b2bc9ef..2339ce3a89d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocument.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,7 @@ import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMPARSER_EXCEPTION_ON_ERROR; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_DOMPARSER_PARSERERROR_ON_ERROR; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_GET_ELEMENTS_BY_TAG_NAME_LOCAL; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XML_GET_ELEMENT_BY_ID__ANY_ELEMENT; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import java.io.IOException; @@ -28,9 +26,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.w3c.dom.CDATASection; -import org.w3c.dom.ProcessingInstruction; - import com.gargoylesoftware.htmlunit.StringWebResponse; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; @@ -78,7 +73,7 @@ public class XMLDocument extends Document { /** * Creates a new instance. */ - @JsxConstructor({CHROME, FF, EDGE}) + @JsxConstructor({CHROME, FF}) public XMLDocument() { this(null); } @@ -276,48 +271,4 @@ protected boolean isMatching(final DomNode node) { return collection; } - - /** - * Returns the element with the specified ID, as long as it is an HTML element; {@code null} otherwise. - * @param id the ID to search for - * @return the element with the specified ID, as long as it is an HTML element; {@code null} otherwise - */ - @JsxFunction - public Object getElementById(final String id) { - final DomNode domNode = getDomNodeOrDie(); - final Object domElement = domNode.getFirstByXPath("//*[@id = \"" + id + "\"]"); - if (domElement != null) { - if (!(domNode instanceof XmlPage) || domElement instanceof HtmlElement - || getBrowserVersion().hasFeature(JS_XML_GET_ELEMENT_BY_ID__ANY_ELEMENT)) { - return ((DomElement) domElement).getScriptableObject(); - } - if (LOG.isDebugEnabled()) { - LOG.debug("getElementById(" + id + "): no HTML DOM node found with this ID"); - } - } - return null; - } - - /** - * Creates a new ProcessingInstruction. - * @param target the target - * @param data the data - * @return the new ProcessingInstruction - */ - @JsxFunction - public Object createProcessingInstruction(final String target, final String data) { - final ProcessingInstruction node = getPage().createProcessingInstruction(target, data); - return getScriptableFor(node); - } - - /** - * Creates a new createCDATASection. - * @param data the data - * @return the new CDATASection - */ - @JsxFunction - public Object createCDATASection(final String data) { - final CDATASection node = getPage().createCDATASection(data); - return getScriptableFor(node); - } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java index 3bb3b4eca22..80cc96c863a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +14,15 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.xml; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ALL_RESPONSE_HEADERS_APPEND_CRLF; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_FIRE_STATE_OPENED_AGAIN_IN_ASYNC_MODE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_IGNORE_PORT_FOR_SAME_ORIGIN; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_LENGTH_COMPUTABLE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_NO_CROSS_ORIGIN_TO_ABOUT; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OPEN_ALLOW_EMTPY_URL; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTION; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_USE_CONTENT_CHARSET; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_USE_DEFAULT_CHARSET_FROM_PAGE; import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_WITHCREDENTIALS_ALLOW_ORIGIN_ALL; -import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.XHR_WITHCREDENTIALS_NOT_WRITEABLE_IN_SYNC_EXCEPTION; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE; @@ -58,6 +55,7 @@ import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.WebWindow; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine; import com.gargoylesoftware.htmlunit.javascript.background.BackgroundJavaScriptFactory; @@ -71,8 +69,8 @@ import com.gargoylesoftware.htmlunit.javascript.host.Window; import com.gargoylesoftware.htmlunit.javascript.host.event.Event; import com.gargoylesoftware.htmlunit.javascript.host.event.ProgressEvent; -import com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument; import com.gargoylesoftware.htmlunit.util.EncodingSniffer; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; import com.gargoylesoftware.htmlunit.util.WebResponseWrapper; import com.gargoylesoftware.htmlunit.xml.XmlPage; @@ -136,8 +134,6 @@ public class XMLHttpRequest extends XMLHttpRequestEventTarget { private int state_; private Function stateChangeHandler_; - private Function loadHandler_; - private Function errorHandler_; private WebRequest webRequest_; private boolean async_; private int jobID_; @@ -201,14 +197,19 @@ private void setState(final int state, Context context) { if (LOG.isDebugEnabled()) { LOG.debug("Calling onreadystatechange handler for state " + state); - } - final Object[] params = new Event[] {new Event(this, Event.TYPE_READY_STATE_CHANGE)}; - jsEngine.callFunction(containingPage_, stateChangeHandler_, scope, this, params); - if (LOG.isDebugEnabled()) { + + // do the decompilation an the debug output before the call, because the + // handler might deregister itself if (context == null) { context = Context.getCurrentContext(); } LOG.debug("onreadystatechange handler: " + context.decompileFunction(stateChangeHandler_, 4)); + } + + final Object[] params = new Event[] {new Event(this, Event.TYPE_READY_STATE_CHANGE)}; + jsEngine.callFunction(containingPage_, stateChangeHandler_, scope, this, params); + + if (LOG.isDebugEnabled()) { LOG.debug("Calling onreadystatechange handler for state " + state + ". Done."); } } @@ -231,8 +232,9 @@ private void setState(final int state, Context context) { } } - if (loadHandler_ != null) { - jsEngine.callFunction(containingPage_, loadHandler_, loadHandler_.getParentScope(), this, params); + final Function onLoad = getOnload(); + if (onLoad != null) { + jsEngine.callFunction(containingPage_, onLoad, onLoad.getParentScope(), this, params); } List handlers = getEventListenersContainer().getListeners(Event.TYPE_LOAD, false); @@ -257,50 +259,15 @@ private void setState(final int state, Context context) { } } - /** - * Returns the event handler that fires on load. - * @return the event handler that fires on load - */ - @JsxGetter - public Function getOnload() { - return loadHandler_; - } - - /** - * Sets the event handler that fires on load. - * @param loadHandler the event handler that fires on load - */ - @JsxSetter - public void setOnload(final Function loadHandler) { - loadHandler_ = loadHandler; - } - - /** - * Returns the event handler that fires on error. - * @return the event handler that fires on error - */ - @JsxGetter - public Function getOnerror() { - return errorHandler_; - } - - /** - * Sets the event handler that fires on error. - * @param errorHandler the event handler that fires on error - */ - @JsxSetter - public void setOnerror(final Function errorHandler) { - errorHandler_ = errorHandler; - } - /** * Invokes the onerror handler if one has been set. * @param context the context within which the onerror handler is to be invoked; * if {@code null}, the current thread's context is used. */ private void processError(Context context) { - if (errorHandler_ != null) { - final Scriptable scope = errorHandler_.getParentScope(); + final Function onError = getOnerror(); + if (onError != null) { + final Scriptable scope = onError.getParentScope(); final JavaScriptEngine jsEngine = (JavaScriptEngine) containingPage_.getWebClient().getJavaScriptEngine(); final Object[] params = new Event[] {new ProgressEvent(this, Event.TYPE_ERROR)}; @@ -308,12 +275,12 @@ private void processError(Context context) { if (LOG.isDebugEnabled()) { LOG.debug("Calling onerror handler"); } - jsEngine.callFunction(containingPage_, errorHandler_, this, scope, params); + jsEngine.callFunction(containingPage_, onError, this, scope, params); if (LOG.isDebugEnabled()) { if (context == null) { context = Context.getCurrentContext(); } - LOG.debug("onerror handler: " + context.decompileFunction(errorHandler_, 4)); + LOG.debug("onerror handler: " + context.decompileFunction(onError, 4)); LOG.debug("Calling onerror handler done."); } } @@ -393,8 +360,10 @@ public Object getResponseXML() { return document; } catch (final IOException e) { - LOG.warn("Failed parsing XML document " + webResponse_.getWebRequest().getUrl() + ": " - + e.getMessage()); + if (LOG.isWarnEnabled()) { + LOG.warn("Failed parsing XML document " + webResponse_.getWebRequest().getUrl() + ": " + + e.getMessage()); + } return null; } } @@ -419,8 +388,10 @@ public int getStatus() { return webResponse_.getStatusCode(); } - LOG.error("XMLHttpRequest.status was retrieved without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHttpRequest.status was retrieved without a response available (readyState: " + + state_ + ")."); + } return 0; } @@ -437,8 +408,10 @@ public String getStatusText() { return webResponse_.getStatusMessage(); } - LOG.error("XMLHttpRequest.statusText was retrieved without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHttpRequest.statusText was retrieved without a response available (readyState: " + + state_ + ")."); + } return null; } @@ -462,16 +435,26 @@ public String getAllResponseHeaders() { if (webResponse_ != null) { final StringBuilder builder = new StringBuilder(); for (final NameValuePair header : webResponse_.getResponseHeaders()) { - builder.append(header.getName()).append(": ").append(header.getValue()).append("\r\n"); + builder.append(header.getName()).append(": ").append(header.getValue()); + + if (!getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF)) { + builder.append('\r'); + } + builder.append('\n'); } - if (getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_APPEND_CRLF)) { - builder.append("\r\n"); + if (getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_APPEND_SEPARATOR)) { + if (!getBrowserVersion().hasFeature(XHR_ALL_RESPONSE_HEADERS_SEPARATE_BY_LF)) { + builder.append('\r'); + } + builder.append('\n'); } return builder.toString(); } - LOG.error("XMLHttpRequest.getAllResponseHeaders() was called without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHttpRequest.getAllResponseHeaders() was called without a response available (readyState: " + + state_ + ")."); + } return null; } @@ -489,8 +472,10 @@ public String getResponseHeader(final String headerName) { return webResponse_.getResponseHeaderValue(headerName); } - LOG.error("XMLHttpRequest.getAllResponseHeaders(..) was called without a response available (readyState: " - + state_ + ")."); + if (LOG.isErrorEnabled()) { + LOG.error("XMLHttpRequest.getAllResponseHeaders(..) was called without a response available (readyState: " + + state_ + ")."); + } return null; } @@ -511,17 +496,10 @@ public void open(final String method, final Object urlParam, final Object asyncP // async defaults to true if not specified boolean async = true; - if (asyncParam != Undefined.instance) { + if (!Undefined.isUndefined(asyncParam)) { async = ScriptRuntime.toBoolean(asyncParam); } - if (!async - && isWithCredentials() - && getBrowserVersion().hasFeature(XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTION)) { - throw Context.reportRuntimeError( - "open() in sync mode is not possible because 'withCredentials' is set to true"); - } - final String url = Context.toString(urlParam); // (URL + Method + User + Password) become a WebRequest instance. @@ -534,7 +512,8 @@ && getBrowserVersion().hasFeature(XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTIO throw Context.reportRuntimeError("Access to restricted URI denied"); } - final WebRequest request = new WebRequest(fullUrl, getBrowserVersion().getXmlHttpRequestAcceptHeader()); + final WebRequest request = new WebRequest(fullUrl, getBrowserVersion().getXmlHttpRequestAcceptHeader(), + getBrowserVersion().getAcceptEncodingHeader()); request.setCharset(UTF_8); request.setAdditionalHeader(HttpHeader.REFERER, containingPage_.getUrl().toExternalForm()); @@ -551,16 +530,18 @@ && getBrowserVersion().hasFeature(XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTIO request.setHttpMethod(HttpMethod.valueOf(method.toUpperCase(Locale.ROOT))); } catch (final IllegalArgumentException e) { - LOG.info("Incorrect HTTP Method '" + method + "'"); + if (LOG.isInfoEnabled()) { + LOG.info("Incorrect HTTP Method '" + method + "'"); + } return; } // password is ignored if no user defined - if (user != null && user != Undefined.instance) { + if (user != null && !Undefined.isUndefined(user)) { final String userCred = user.toString(); String passwordCred = ""; - if (password != null && password != Undefined.instance) { + if (password != null && !Undefined.isUndefined(password)) { passwordCred = password.toString(); } @@ -569,7 +550,9 @@ && getBrowserVersion().hasFeature(XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTIO webRequest_ = request; } catch (final MalformedURLException e) { - LOG.error("Unable to initialize XMLHttpRequest using malformed URL '" + url + "'."); + if (LOG.isErrorEnabled()) { + LOG.error("Unable to initialize XMLHttpRequest using malformed URL '" + url + "'."); + } return; } // Async stays a boolean. @@ -579,13 +562,8 @@ && getBrowserVersion().hasFeature(XHR_OPEN_WITHCREDENTIALS_TRUE_IN_SYNC_EXCEPTIO } private boolean isAllowCrossDomainsFor(final URL newUrl) { - final BrowserVersion browser = getBrowserVersion(); - if (browser.hasFeature(XHR_NO_CROSS_ORIGIN_TO_ABOUT) - && "about".equals(newUrl.getProtocol())) { - return false; - } - - return true; + return !(getBrowserVersion().hasFeature(XHR_NO_CROSS_ORIGIN_TO_ABOUT) + && "about".equals(newUrl.getProtocol())); } private boolean isSameOrigin(final URL originUrl, final URL newUrl) { @@ -620,9 +598,10 @@ public void send(final Object content) { prepareRequest(content); final Window w = getWindow(); - final WebClient client = w.getWebWindow().getWebClient(); + final WebWindow ww = w.getWebWindow(); + final WebClient client = ww.getWebClient(); final AjaxController ajaxController = client.getAjaxController(); - final HtmlPage page = (HtmlPage) w.getWebWindow().getEnclosedPage(); + final HtmlPage page = (HtmlPage) ww.getEnclosedPage(); final boolean synchron = ajaxController.processSynchron(page, webRequest_, async_); if (synchron) { doSend(Context.getCurrentContext()); @@ -637,7 +616,7 @@ public void send(final Object content) { // Create and start a thread in which to execute the request. final Scriptable startingScope = w; final ContextFactory cf = ((JavaScriptEngine) client.getJavaScriptEngine()).getContextFactory(); - final ContextAction action = new ContextAction() { + final ContextAction action = new ContextAction() { @Override public Object run(final Context cx) { // KEY_STARTING_SCOPE maintains a stack of scopes @@ -669,7 +648,7 @@ public String toString() { if (LOG.isDebugEnabled()) { LOG.debug("Starting XMLHttpRequest thread for asynchronous request"); } - jobID_ = w.getWebWindow().getJobManager().addJob(job, page); + jobID_ = ww.getJobManager().addJob(job, page); } } @@ -682,7 +661,7 @@ private void prepareRequest(final Object content) { && (HttpMethod.POST == webRequest_.getHttpMethod() || HttpMethod.PUT == webRequest_.getHttpMethod() || HttpMethod.PATCH == webRequest_.getHttpMethod()) - && content != Undefined.instance) { + && !Undefined.isUndefined(content)) { if (content instanceof FormData) { ((FormData) content).fillRequest(webRequest_); } @@ -749,6 +728,9 @@ private void doSend(final Context context) { if (LOG.isDebugEnabled()) { LOG.debug("Web response loaded successfully."); } + // this kind of web responses using UTF-8 as default encoding + webResponse.defaultCharsetUtf8(); + boolean allowOriginResponse = true; if (originHeaderValue != null) { String value = webResponse.getResponseHeaderValue(HttpHeader.ACCESS_CONTROL_ALLOW_ORIGIN); @@ -776,12 +758,7 @@ private void doSend(final Context context) { if (index != -1) { charsetName = overriddenMimeType_.substring(index + "charset=".length()); } - Charset charset = EncodingSniffer.toCharset(charsetName); - if (charset == null - && getBrowserVersion().hasFeature(XHR_USE_DEFAULT_CHARSET_FROM_PAGE)) { - final HTMLDocument doc = containingPage_.getScriptableObject(); - charset = Charset.forName(doc.getDefaultCharset()); - } + final Charset charset = EncodingSniffer.toCharset(charsetName); final String charsetNameFinal = charsetName; final Charset charsetFinal = charset; webResponse_ = new WebResponseWrapper(webResponse) { @@ -874,7 +851,7 @@ private static boolean isPreflightHeader(final String name, final String value) final String lcValue = value.toLowerCase(Locale.ROOT); if (lcValue.startsWith(FormEncodingType.URL_ENCODED.getName()) || lcValue.startsWith(FormEncodingType.MULTIPART.getName()) - || lcValue.startsWith("text/plain")) { + || lcValue.startsWith(MimeType.TEXT_PLAIN)) { return false; } return true; @@ -899,8 +876,10 @@ private static boolean isPreflightHeader(final String name, final String value) @JsxFunction public void setRequestHeader(final String name, final String value) { if (!isAuthorizedHeader(name)) { - LOG.warn("Ignoring XMLHttpRequest.setRequestHeader for " + name - + ": it is a restricted header"); + if (LOG.isWarnEnabled()) { + LOG.warn("Ignoring XMLHttpRequest.setRequestHeader for " + name + + ": it is a restricted header"); + } return; } @@ -938,8 +917,7 @@ else if (nameLowerCase.startsWith("proxy-") || nameLowerCase.startsWith("sec-")) */ @JsxFunction public void overrideMimeType(final String mimeType) { - if (getBrowserVersion().hasFeature(XHR_OVERRIDE_MIME_TYPE_BEFORE_SEND) - && state_ != UNSENT && state_ != OPENED) { + if (state_ != UNSENT && state_ != OPENED) { throw Context.reportRuntimeError("Property 'overrideMimeType' not writable after sent."); } overriddenMimeType_ = mimeType; @@ -960,11 +938,6 @@ public boolean isWithCredentials() { */ @JsxSetter public void setWithCredentials(final boolean withCredentials) { - if (!async_ && state_ != UNSENT) { - if (getBrowserVersion().hasFeature(XHR_WITHCREDENTIALS_NOT_WRITEABLE_IN_SYNC_EXCEPTION)) { - throw Context.reportRuntimeError("Property 'withCredentials' not writable in sync mode."); - } - } withCredentials_ = withCredentials; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestEventTarget.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestEventTarget.java index bf98686d111..d25438e3851 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestEventTarget.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestEventTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,21 +19,72 @@ import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter; +import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter; import com.gargoylesoftware.htmlunit.javascript.host.event.EventTarget; +import net.sourceforge.htmlunit.corejs.javascript.Function; +import net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime; + /** * A JavaScript object for {@code XMLHttpRequestEventTarget}. * * @author Ahmed Ashour + * @author Ronald Brill */ @JsxClass public class XMLHttpRequestEventTarget extends EventTarget { + private Function loadHandler_; + private Function errorHandler_; + /** * Creates an instance. */ - @JsxConstructor({CHROME, FF}) public XMLHttpRequestEventTarget() { } + /** + * @return the constructed object + */ + @JsxConstructor({CHROME, FF}) + public static XMLHttpRequestEventTarget ctor() { + throw ScriptRuntime.typeError("Illegal constructor."); + } + + /** + * Returns the event handler that fires on load. + * @return the event handler that fires on load + */ + @JsxGetter + public Function getOnload() { + return loadHandler_; + } + + /** + * Sets the event handler that fires on load. + * @param loadHandler the event handler that fires on load + */ + @JsxSetter + public void setOnload(final Function loadHandler) { + loadHandler_ = loadHandler; + } + + /** + * Returns the event handler that fires on error. + * @return the event handler that fires on error + */ + @JsxGetter + public Function getOnerror() { + return errorHandler_; + } + + /** + * Sets the event handler that fires on error. + * @param errorHandler the event handler that fires on error + */ + @JsxSetter + public void setOnerror(final Function errorHandler) { + errorHandler_ = errorHandler; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestUpload.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestUpload.java index 45ad94b3088..723060830f6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestUpload.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLHttpRequestUpload.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.javascript.host.xml; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; @@ -26,7 +25,7 @@ * * @author Ahmed Ashour */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class XMLHttpRequestUpload extends XMLHttpRequestEventTarget { /** diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java index f0c229bf69d..192b0acbb99 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XMLSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -112,6 +112,7 @@ public String serializeToString(Node root) { if (root == null) { return ""; } + if (root instanceof Document) { root = ((Document) root).getDocumentElement(); } @@ -122,6 +123,7 @@ && getBrowserVersion().hasFeature(JS_XML_SERIALIZER_HTML_DOCUMENT_FRAGMENT_ALWAY } root = root.getFirstChild(); } + if (root instanceof Element) { final StringBuilder builder = new StringBuilder(); final DomNode node = root.getDomNodeOrDie(); @@ -136,6 +138,7 @@ && getBrowserVersion().hasFeature(JS_XML_SERIALIZER_HTML_DOCUMENT_FRAGMENT_ALWAY return builder.toString(); } + if (root instanceof CDATASection && getBrowserVersion().hasFeature(JS_XML_SERIALIZER_ROOT_CDATA_AS_ESCAPED_TEXT)) { final DomCDataSection domCData = (DomCDataSection) root.getDomNodeOrDie(); @@ -201,7 +204,7 @@ else if (foredNamespace != null) { break; default: - + break; } } if (!startTagClosed) { @@ -214,7 +217,7 @@ else if (foredNamespace != null) { builder.append(optionalPrefix); if (builder.charAt(builder.length() - 1) != ' ' && getBrowserVersion().hasFeature(JS_XML_SERIALIZER_BLANK_BEFORE_SELF_CLOSING)) { - builder.append(" "); + builder.append(' '); } builder.append("/>"); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java index e7e251c0fcc..3986979268d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,18 @@ */ package com.gargoylesoftware.htmlunit.javascript.host.xml; +import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_XSLT_TRANSFORM_INDENT; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.FF; +import java.io.ByteArrayOutputStream; import java.io.StringWriter; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; @@ -34,6 +37,8 @@ import org.w3c.dom.NodeList; import com.gargoylesoftware.htmlunit.SgmlPage; +import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.WebResponseData; import com.gargoylesoftware.htmlunit.html.DomDocumentFragment; import com.gargoylesoftware.htmlunit.html.DomNode; import com.gargoylesoftware.htmlunit.html.DomText; @@ -44,8 +49,8 @@ import com.gargoylesoftware.htmlunit.javascript.host.dom.Document; import com.gargoylesoftware.htmlunit.javascript.host.dom.DocumentFragment; import com.gargoylesoftware.htmlunit.javascript.host.dom.Node; +import com.gargoylesoftware.htmlunit.util.XmlUtils; import com.gargoylesoftware.htmlunit.xml.XmlPage; -import com.gargoylesoftware.htmlunit.xml.XmlUtil; import net.sourceforge.htmlunit.corejs.javascript.Context; @@ -55,7 +60,7 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@JsxClass({CHROME, FF, EDGE}) +@JsxClass({CHROME, FF}) public class XSLTProcessor extends SimpleScriptable { private Node style_; @@ -113,28 +118,56 @@ public XMLDocument transformToDocument(final Node source) { */ private Object transform(final Node source) { try { - Source xmlSource = new DOMSource(source.getDomNodeOrDie()); - final Source xsltSource = new DOMSource(style_.getDomNodeOrDie()); + final DomNode sourceDomNode = source.getDomNodeOrDie(); + Source xmlSource = new DOMSource(sourceDomNode); - final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - final org.w3c.dom.Document containerDocument = - factory.newDocumentBuilder().newDocument(); - final org.w3c.dom.Element containerElement = containerDocument.createElement("container"); - containerDocument.appendChild(containerElement); - - final DOMResult result = new DOMResult(containerElement); + final DomNode xsltDomNode = style_.getDomNodeOrDie(); + final Source xsltSource = new DOMSource(xsltDomNode); final Transformer transformer = TransformerFactory.newInstance().newTransformer(xsltSource); for (final Map.Entry entry : parameters_.entrySet()) { transformer.setParameter(entry.getKey(), entry.getValue()); } + + // hack to preserve indention + // the transformer only accepts the OutputKeys.INDENT setting if + // the StreamResult is used + final SgmlPage page = sourceDomNode.getPage(); + if (page != null && page.getWebClient().getBrowserVersion() + .hasFeature(JS_XSLT_TRANSFORM_INDENT)) { + final DomNode outputNode = findOutputNode(xsltDomNode); + if (outputNode != null) { + final org.w3c.dom.Node indentNode = outputNode.getAttributes().getNamedItem("indent"); + if (indentNode != null && "yes".equalsIgnoreCase(indentNode.getNodeValue())) { + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + + try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { + transformer.transform(xmlSource, new StreamResult(out)); + final WebResponseData data = + new WebResponseData(out.toByteArray(), 200, null, Collections.emptyList()); + final WebResponse response = new WebResponse(data, null, 0); + final org.w3c.dom.Document doc = XmlUtils.buildDocument(response); + return doc; + } + } + } + } + + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + final org.w3c.dom.Document containerDocument = factory.newDocumentBuilder().newDocument(); + final org.w3c.dom.Element containerElement = containerDocument.createElement("container"); + containerDocument.appendChild(containerElement); + + final DOMResult result = new DOMResult(containerElement); transformer.transform(xmlSource, result); final org.w3c.dom.Node transformedNode = result.getNode(); if (transformedNode.getFirstChild().getNodeType() == Node.ELEMENT_NODE) { return transformedNode; } - //output is not DOM (text) + + // output is not DOM (text) xmlSource = new DOMSource(source.getDomNodeOrDie()); final StringWriter writer = new StringWriter(); final Result streamResult = new StreamResult(writer); @@ -173,7 +206,7 @@ private void transform(final Node source, final DomNode parent) { final SgmlPage parentPage = parent.getPage(); final NodeList children = ((org.w3c.dom.Node) result).getChildNodes(); for (int i = 0; i < children.getLength(); i++) { - XmlUtil.appendChild(parentPage, parent, children.item(i), true); + XmlUtils.appendChild(parentPage, parent, children.item(i), true); } } else { @@ -215,4 +248,19 @@ private static String getQualifiedName(final String namespaceURI, final String l } return qualifiedName; } + + private static DomNode findOutputNode(final DomNode xsltDomNode) { + for (DomNode child : xsltDomNode.getChildren()) { + if ("output".equals(child.getLocalName())) { + return child; + } + + for (DomNode child1 : child.getChildren()) { + if ("output".equals(child1.getLocalName())) { + return child1; + } + } + } + return null; + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/package-info.java index ce1fe9b2a9f..32221a21c9f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/package-info.java index 86123a6b352..7ebb02ac75f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/HtmlUnitRegExpProxy.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/HtmlUnitRegExpProxy.java index 9fdac43e5ec..ae133cfc2c0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/HtmlUnitRegExpProxy.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/HtmlUnitRegExpProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,6 +52,8 @@ public class HtmlUnitRegExpProxy extends RegExpImpl { private static final Log LOG = LogFactory.getLog(HtmlUnitRegExpProxy.class); + /** Pattern cache */ + private static final Map PATTENS = new HashMap<>(); private final RegExpProxy wrapped_; private final BrowserVersion browserVersion_; @@ -376,8 +378,10 @@ public Object compileRegExp(final Context cx, final String source, final String return wrapped_.compileRegExp(cx, source, flags); } catch (final Exception e) { - LOG.warn("compileRegExp() threw for >" + source + "<, flags: >" + flags + "<. " - + "Replacing with a '####shouldNotFindAnything###'"); + if (LOG.isWarnEnabled()) { + LOG.warn("compileRegExp() threw for >" + source + "<, flags: >" + flags + "<. " + + "Replacing with a '####shouldNotFindAnything###'"); + } return wrapped_.compileRegExp(cx, "####shouldNotFindAnything###", ""); } } @@ -408,9 +412,6 @@ public Scriptable wrapRegExp(final Context cx, final Scriptable scope, final Obj return wrapped_.wrapRegExp(cx, scope, compiled); } - /** Pattern cache */ - private static final Map PATTENS = new HashMap<>(); - private static class RegExpData { private final boolean global_; private Pattern pattern_; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/RegExpJsToJavaConverter.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/RegExpJsToJavaConverter.java index d3aea63530c..8c5c04c5eae 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/RegExpJsToJavaConverter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/RegExpJsToJavaConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,12 @@ public class RegExpJsToJavaConverter { private static final String DIGITS = "0123456789"; + private Tape tape_; + private boolean insideCharClass_; + private boolean insideRepetition_; + private Deque parsingSubexpressions_; + private List subexpressions_; + /** * Helper to encapsulate the transformations. */ @@ -143,12 +149,6 @@ private Subexpresion() { } } - private Tape tape_; - private boolean insideCharClass_; - private boolean insideRepetition_; - private Deque parsingSubexpressions_; - private List subexpressions_; - /** * Initiate the FSM. */ diff --git a/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/package-info.java index 3d2b7fd7028..a6474a8a476 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/javascript/regexp/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/package-info.java index 760813fa831..4252e606e43 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ /** - * Framework classes (contains the {@link WebClient} class which is the main entry point). + * Framework classes (contains the {@link com.gargoylesoftware.htmlunit.WebClient} + * class which is the main entry point). */ package com.gargoylesoftware.htmlunit; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/AnyHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/AnyHandler.java index 46cb03dacc2..d43dea87733 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/AnyHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/AnyHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/AboutURLConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/AboutURLConnection.java index 8887a4403ba..de3c40f2d2b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/AboutURLConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/AboutURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/Handler.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/Handler.java index be322e572c8..0ee2f00fca1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/Handler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/Handler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/package-info.java index 5e99eff27a1..cf959144db5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/about/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataURLConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataURLConnection.java index f4624bc56d9..12c1c901f05 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataURLConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataUrlDecoder.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataUrlDecoder.java index b4032a90664..3e3e9617b5a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataUrlDecoder.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/DataUrlDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,8 @@ import org.apache.commons.codec.net.URLCodec; import org.apache.commons.lang3.StringUtils; +import com.gargoylesoftware.htmlunit.util.MimeType; + /** * Helper to work with data URLs. * @see RFC2397 @@ -37,7 +39,7 @@ */ public class DataUrlDecoder { private static final Charset DEFAULT_CHARSET = US_ASCII; - private static final String DEFAULT_MEDIA_TYPE = "text/plain"; + private static final String DEFAULT_MEDIA_TYPE = MimeType.TEXT_PLAIN; private final String mediaType_; private final Charset charset_; private byte[] content_; diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/Handler.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/Handler.java index 79e047a8659..baf396b63f0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/Handler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/Handler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,10 +44,14 @@ protected URLConnection openConnection(final URL url) { return new DataURLConnection(url); } catch (final UnsupportedEncodingException e) { - LOG.error("Exception decoding " + url, e); + if (LOG.isErrorEnabled()) { + LOG.error("Exception decoding " + url, e); + } } catch (final DecoderException e) { - LOG.error("Exception decoding " + url, e); + if (LOG.isErrorEnabled()) { + LOG.error("Exception decoding " + url, e); + } } return null; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/package-info.java index ada8938541a..062271606cd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/data/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/Handler.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/Handler.java index f9d1c2cab76..b6cf750cd49 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/Handler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/Handler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/JavaScriptURLConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/JavaScriptURLConnection.java index d242a183421..cafd15a01b2 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/JavaScriptURLConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/JavaScriptURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import java.net.URL; import java.net.URLConnection; -import com.gargoylesoftware.htmlunit.TextUtil; +import com.gargoylesoftware.htmlunit.util.TextUtils; /** * A URLConnection for supporting JavaScript URLs. @@ -56,7 +56,7 @@ public void connect() { */ @Override public InputStream getInputStream() { - return TextUtil.toInputStream(content_); + return TextUtils.toInputStream(content_); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/package-info.java index 552b6cc1681..24c6b6120d6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/javascript/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/protocol/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/protocol/package-info.java index adac7670da0..35a0b4d89e0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/protocol/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/protocol/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyph.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyph.java index e21237bbe75..f99b95ee4d0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyph.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphDef.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphDef.java index c0dcc6432ca..43a038d19db 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphDef.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphDef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphItem.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphItem.java index 06983929322..28b4b9c92e0 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphItem.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAltGlyphItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnchor.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnchor.java index fdaf7fc2e29..5fd99e4a481 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnchor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnchor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimate.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimate.java index 4200d2bdc8f..9a543899a1e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimate.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateColor.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateColor.java index 100afbb1c4b..cde81c4a194 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateColor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateColor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateMotion.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateMotion.java index bd1311db667..8616120f331 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateMotion.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateMotion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateTransform.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateTransform.java index 5f740740902..7ef3af7e97b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateTransform.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgAnimateTransform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCircle.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCircle.java index 7ebd4a8af56..8c9ca379721 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCircle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCircle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgClipPath.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgClipPath.java index 3aaa1f36cbd..900993ea9a7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgClipPath.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgClipPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgColorProfile.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgColorProfile.java index 97d5eaf0f5b..f9c8ae4779a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgColorProfile.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgColorProfile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCursor.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCursor.java index cf33ec75f6c..c12ffea73ea 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCursor.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgCursor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDefs.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDefs.java index c9d84f6ec96..07a4f801277 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDefs.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDefs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDesc.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDesc.java index bd3fb807724..20a2a3d7013 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDesc.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgDesc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElement.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElement.java index a30bb997705..f31efb1dec7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElement.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElementFactory.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElementFactory.java index b86eea9095f..8c528027930 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElementFactory.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgEllipse.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgEllipse.java index 7bff941ca30..c97647f404d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgEllipse.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgEllipse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeBlend.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeBlend.java index 77e2f4fa209..225ef04199d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeBlend.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeBlend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeColorMatrix.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeColorMatrix.java index 4c36a86e1f8..51ace2a51bb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeColorMatrix.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeColorMatrix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComponentTransfer.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComponentTransfer.java index c4ca20aa13b..ba090cf7c1b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComponentTransfer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComponentTransfer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComposite.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComposite.java index 3dea17aeecf..6417ba50723 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComposite.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeComposite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeConvolveMatrix.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeConvolveMatrix.java index b2956ef3d33..c066b170a54 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeConvolveMatrix.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeConvolveMatrix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDiffuseLighting.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDiffuseLighting.java index 2f374105404..43abf248f0c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDiffuseLighting.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDiffuseLighting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDisplacementMap.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDisplacementMap.java index 3a2c8509a12..83f293f1b54 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDisplacementMap.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDisplacementMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDistantLight.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDistantLight.java index 4ade1ee06a0..88fa75458f9 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDistantLight.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeDistantLight.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFlood.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFlood.java index d0756b18edc..8d03241a887 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFlood.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFlood.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncA.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncA.java index 0b5d5c8b959..9af78841bfe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncA.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncB.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncB.java index 3948362c31c..077cbba5585 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncB.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncG.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncG.java index 997552ead81..d38b11e08ca 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncG.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncR.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncR.java index 33d3defe539..1dab67528d3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncR.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeFuncR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeGaussianBlur.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeGaussianBlur.java index 8c3c6f7ca20..0feb4011b8a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeGaussianBlur.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeGaussianBlur.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeImage.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeImage.java index 857b6f4a941..8c039545b41 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeImage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMerge.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMerge.java index 1b39b68fc00..4abb376ac9f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMerge.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMerge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMergeNode.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMergeNode.java index a961cc9fb4b..a6ac941a3ce 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMergeNode.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMergeNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMorphology.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMorphology.java index e24456e0770..5b750c53773 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMorphology.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeMorphology.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeOffset.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeOffset.java index 8cc91c97616..a5c309bb985 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeOffset.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeOffset.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFePointLight.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFePointLight.java index 2531140a645..e25ee293759 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFePointLight.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFePointLight.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpecularLighting.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpecularLighting.java index 2a04b271dc5..c53721533f7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpecularLighting.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpecularLighting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpotLight.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpotLight.java index 465300cdf58..00121ec41c1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpotLight.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeSpotLight.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTile.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTile.java index 1d2be04d09b..ce36e815407 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTile.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTurbulence.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTurbulence.java index eb897cd7bd7..d8feed3b78c 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTurbulence.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFeTurbulence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFilter.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFilter.java index 198de47b7c6..f0599a541aa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFilter.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFont.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFont.java index 7a877e1d930..aac25a44cd4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFont.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFace.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFace.java index 53c6f1e3981..c8ca707c3a5 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFace.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceFormat.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceFormat.java index b8faed2c277..320946c1b56 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceFormat.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceName.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceName.java index a3180c58802..38bdb51ea51 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceName.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceSrc.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceSrc.java index 38f1133a314..a9e5dd75e11 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceSrc.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceSrc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceURI.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceURI.java index 90a4bc68635..f82909af3fb 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceURI.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgFontFaceURI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgForeignObject.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgForeignObject.java index bf2048a1d5d..231cdb3359d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgForeignObject.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgForeignObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyph.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyph.java index 7c838deac09..3fbad8ffc95 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyph.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyphRef.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyphRef.java index 5efb88668e4..71db1e17afc 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyphRef.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGlyphRef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGroup.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGroup.java index 8955a7fa15a..3b23ad509ed 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGroup.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgHKern.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgHKern.java index 7bd349f929f..91461150705 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgHKern.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgHKern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgImage.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgImage.java index 85ba830251d..b8920aa546f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgImage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLine.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLine.java index 347a35d4f94..bab6afb8672 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLine.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLinearGradient.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLinearGradient.java index 72b5a0118c6..20150bfac7f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLinearGradient.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgLinearGradient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMPath.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMPath.java index aab0b84140c..2ce81556bfe 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMPath.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMarker.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMarker.java index 673c5e815c4..a53e52872f8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMarker.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMarker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMask.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMask.java index d662a84bc39..51a55d570a6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMask.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMetadata.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMetadata.java index 21153ae072e..18945375a7f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMetadata.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMissingGlyph.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMissingGlyph.java index 417dfac78a7..74b9cb9d3e4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMissingGlyph.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgMissingGlyph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPath.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPath.java index 76aeda6f6e5..ef9888ab20e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPath.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPattern.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPattern.java index 3b1c7bb41f1..8cd8b36b1bf 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPattern.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPattern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolygon.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolygon.java index 1db25faf33d..1568b63c7fa 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolygon.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolygon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolyline.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolyline.java index ded029d3dd9..e68ad1bb4bd 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolyline.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgPolyline.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRadialGradient.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRadialGradient.java index 428ea8091e7..ec61da50ff1 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRadialGradient.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRadialGradient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRect.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRect.java index f5c8433a59a..9879ed091ff 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRect.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgRect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgScript.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgScript.java index cc2d8f74d68..687b0cb6da6 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgScript.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgScript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.svg; -import java.nio.charset.Charset; import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -23,7 +22,6 @@ import com.gargoylesoftware.htmlunit.html.DomAttr; import com.gargoylesoftware.htmlunit.html.ScriptElement; import com.gargoylesoftware.htmlunit.html.ScriptElementSupport; -import com.gargoylesoftware.htmlunit.util.EncodingSniffer; /** * Wrapper for the SVG element {@code script}. @@ -83,7 +81,7 @@ protected final String getSrcAttributeNormalized() { // at the moment StringUtils.replaceChars returns the org string // if nothing to replace was found but the doc implies, that we // can't trust on this in the future - final String attrib = getAttributeDirect("src"); + final String attrib = getAttributeDirect(SRC_ATTRIBUTE); if (ATTRIBUTE_NOT_DEFINED == attrib) { return attrib; } @@ -99,23 +97,12 @@ public final String getCharsetAttribute() { return getAttributeDirect("charset"); } - /** - * {@inheritDoc} - * - * @deprecated as of 2.27, not used - */ - @Override - @Deprecated - public final Charset getCharset() { - return EncodingSniffer.toCharset(getCharsetAttribute()); - } - /** * Executes the onreadystatechange handler when simulating IE, as well as executing * the script itself, if necessary. {@inheritDoc} */ @Override - protected void onAllChildrenAddedToPage(final boolean postponed) { + public void onAllChildrenAddedToPage(final boolean postponed) { ScriptElementSupport.onAllChildrenAddedToPage(this, postponed); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSet.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSet.java index 60d17c7abb6..01a565791ea 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSet.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStop.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStop.java index 4369100709c..06431d16ef3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStop.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStyle.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStyle.java index 70902868565..42736c28e02 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStyle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSwitch.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSwitch.java index e6c43d77d29..ae99c7cdfec 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSwitch.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSwitch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSymbol.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSymbol.java index 838fd0cdf81..162971962c7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSymbol.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgSymbol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTRef.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTRef.java index d463cefc5c5..a5c6b0fe8a7 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTRef.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTRef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTSpan.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTSpan.java index 0fe38fd6f3d..285cc84b5a8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTSpan.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTSpan.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgText.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgText.java index 5610c98a06e..5ea731c2d13 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgText.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTextPath.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTextPath.java index c3e6986b5a0..b1a8b2dd356 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTextPath.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTextPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTitle.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTitle.java index 37f1e61fe5b..704cdff5f57 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTitle.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgUse.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgUse.java index c7440367e43..b7f73920158 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgUse.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgUse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgVKern.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgVKern.java index 2f77b979e34..e3bb8bfe28e 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgVKern.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgVKern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgView.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgView.java index 5657f73f5a7..e4144dab089 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgView.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/SvgView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/svg/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/svg/package-info.java index 24c6f6ab76e..e62398ec7f3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/svg/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/svg/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/Cookie.java b/src/main/java/com/gargoylesoftware/htmlunit/util/Cookie.java index 7e9319e702c..7ea58aef84f 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/Cookie.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/Cookie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/DebuggingWebConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/util/DebuggingWebConnection.java index ad12bbee4e9..a70bfbbe159 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/DebuggingWebConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/DebuggingWebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,15 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; +import java.io.BufferedWriter; import java.io.EOFException; import java.io.File; -import java.io.FileOutputStream; -import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; @@ -129,7 +130,7 @@ protected WebResponse uncompressJavaScript(final WebResponse response) { // skip if it is already formatted? => TODO final ContextFactory factory = new ContextFactory(); - final ContextAction action = new ContextAction() { + final ContextAction action = new ContextAction() { @Override public Object run(final Context cx) { cx.setOptimizationLevel(-1); @@ -168,7 +169,9 @@ public void addMark(String mark) throws IOException { mark = mark.replace("\"", "\\\""); } appendToJSFile("tab[tab.length] = \"" + mark + "\";\n"); - LOG.info("--- " + mark + " ---"); + if (LOG.isInfoEnabled()) { + LOG.info("--- " + mark + " ---"); + } } /** @@ -181,11 +184,11 @@ protected void saveResponse(final WebResponse response, final WebRequest request throws IOException { counter_++; final String extension = chooseExtension(response.getContentType()); - final File f = createFile(request.getUrl(), extension); + final File file = createFile(request.getUrl(), extension); int length = 0; try (InputStream input = response.getContentAsStream()) { - try (OutputStream output = new FileOutputStream(f)) { - length = IOUtils.copy(input, output); + try (OutputStream fos = Files.newOutputStream(file.toPath())) { + length = IOUtils.copy(input, fos); } catch (final EOFException e) { // ignore @@ -193,21 +196,23 @@ protected void saveResponse(final WebResponse response, final WebRequest request } final URL url = response.getWebRequest().getUrl(); - LOG.info("Created file " + f.getAbsolutePath() + " for response " + counter_ + ": " + url); + if (LOG.isInfoEnabled()) { + LOG.info("Created file " + file.getAbsolutePath() + " for response " + counter_ + ": " + url); + } final StringBuilder bduiler = new StringBuilder(); - bduiler.append("tab[tab.length] = {code: " + response.getStatusCode() + ", "); - bduiler.append("fileName: '" + f.getName() + "', "); - bduiler.append("contentType: '" + response.getContentType() + "', "); - bduiler.append("method: '" + request.getHttpMethod().name() + "', "); + bduiler.append("tab[tab.length] = {code: " + response.getStatusCode() + ", ") + .append("fileName: '" + file.getName() + "', ") + .append("contentType: '" + response.getContentType() + "', ") + .append("method: '" + request.getHttpMethod().name() + "', "); if (request.getHttpMethod() == HttpMethod.POST && request.getEncodingType() == FormEncodingType.URL_ENCODED) { bduiler.append("postParameters: " + nameValueListToJsMap(request.getRequestParameters()) + ", "); } - bduiler.append("url: '" + escapeJSString(url.toString()) + "', "); - bduiler.append("loadTime: " + response.getLoadTime() + ", "); - bduiler.append("responseSize: " + length + ", "); - bduiler.append("responseHeaders: " + nameValueListToJsMap(response.getResponseHeaders())); - bduiler.append("};\n"); + bduiler.append("url: '" + escapeJSString(url.toString()) + "', ") + .append("loadTime: " + response.getLoadTime() + ", ") + .append("responseSize: " + length + ", ") + .append("responseHeaders: " + nameValueListToJsMap(response.getResponseHeaders())) + .append("};\n"); appendToJSFile(bduiler.toString()); } @@ -219,13 +224,13 @@ static String chooseExtension(final String contentType) { if (isJavaScript(contentType)) { return ".js"; } - else if ("text/html".equals(contentType)) { + else if (MimeType.TEXT_HTML.equals(contentType)) { return ".html"; } - else if ("text/css".equals(contentType)) { + else if (MimeType.TEXT_CSS.equals(contentType)) { return ".css"; } - else if ("text/xml".equals(contentType)) { + else if (MimeType.TEXT_XML.equals(contentType)) { return ".xml"; } else if ("image/gif".equals(contentType)) { @@ -263,7 +268,7 @@ public void setUncompressJavaScript(final boolean decompress) { } private void appendToJSFile(final String str) throws IOException { - try (FileWriter jsFileWriter = new FileWriter(javaScriptFile_, true)) { + try (BufferedWriter jsFileWriter = Files.newBufferedWriter(javaScriptFile_.toPath(), StandardCharsets.UTF_8)) { jsFileWriter.write(str); } } @@ -316,7 +321,7 @@ static String nameValueListToJsMap(final List headers) { bduiler.append("'" + header.getName() + "': '" + escapeJSString(header.getValue()) + "', "); } bduiler.delete(bduiler.length() - 2, bduiler.length()); - bduiler.append("}"); + bduiler.append('}'); return bduiler.toString(); } @@ -334,7 +339,9 @@ private void createOverview() throws IOException { final File summary = new File(reportFolder_, "index.html"); FileUtils.copyURLToFile(indexResource, summary); - LOG.info("Summary will be in " + summary.getAbsolutePath()); + if (LOG.isInfoEnabled()) { + LOG.info("Summary will be in " + summary.getAbsolutePath()); + } } File getReportFolder() { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java b/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java index 9e88e487339..27909b181ac 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/EncodingSniffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,6 +87,9 @@ public final class EncodingSniffer { new byte[] {'t', 'T'} }; + private static final byte[] WHITESPACE = new byte[] {0x09, 0x0A, 0x0C, 0x0D, 0x20, 0x3E}; + private static final byte[] COMMENT_END = new byte[] {'-', '-', '>'}; + /** Reference */ private static final Map ENCODING_FROM_LABEL; static { @@ -474,7 +477,7 @@ else if (isXml(headers)) { * @return {@code true} if the specified HTTP response headers indicate an HTML response */ static boolean isHtml(final List headers) { - return contentTypeEndsWith(headers, "text/html"); + return contentTypeEndsWith(headers, MimeType.TEXT_HTML); } /** @@ -484,7 +487,7 @@ static boolean isHtml(final List headers) { * @return {@code true} if the specified HTTP response headers indicate an XML response */ static boolean isXml(final List headers) { - return contentTypeEndsWith(headers, "text/xml", "application/xml", "text/vnd.wap.wml", "+xml"); + return contentTypeEndsWith(headers, MimeType.TEXT_XML, "application/xml", "text/vnd.wap.wml", "+xml"); } /** @@ -684,7 +687,7 @@ private static boolean startsWith(final byte[] bytes, final ByteOrderMark bom) { static Charset sniffEncodingFromMetaTag(final byte[] bytes) { for (int i = 0; i < bytes.length; i++) { if (matches(bytes, i, COMMENT_START)) { - i = indexOfSubArray(bytes, new byte[] {'-', '-', '>'}, i); + i = indexOfSubArray(bytes, COMMENT_END, i); if (i == -1) { break; } @@ -720,13 +723,14 @@ else if ("content".equals(name)) { } } else if (i + 1 < bytes.length && bytes[i] == '<' && Character.isLetter(bytes[i + 1])) { - i = skipToAnyOf(bytes, i, new byte[] {0x09, 0x0A, 0x0C, 0x0D, 0x20, 0x3E}); + i = skipToAnyOf(bytes, i, WHITESPACE); if (i == -1) { break; } - Attribute att; - while ((att = getAttribute(bytes, i)) != null) { + Attribute att = getAttribute(bytes, i); + while (att != null) { i = att.getUpdatedIndex(); + att = getAttribute(bytes, i); } } else if (i + 2 < bytes.length && bytes[i] == '<' && bytes[i + 1] == '/' && Character.isLetter(bytes[i + 2])) { @@ -734,9 +738,10 @@ else if (i + 2 < bytes.length && bytes[i] == '<' && bytes[i + 1] == '/' && Chara if (i == -1) { break; } - Attribute attribute; - while ((attribute = getAttribute(bytes, i)) != null) { + Attribute attribute = getAttribute(bytes, i); + while (attribute != null) { i = attribute.getUpdatedIndex(); + attribute = getAttribute(bytes, i); } } else if (matches(bytes, i, OTHER_START)) { @@ -1007,8 +1012,8 @@ static boolean matches(final byte[] bytes, final int i, final byte[][] sought) { for (int x = 0; x < sought.length; x++) { final byte[] possibilities = sought[x]; boolean match = false; - for (int y = 0; y < possibilities.length; y++) { - if (bytes[i + x] == possibilities[y]) { + for (byte possibility : possibilities) { + if (bytes[i + x] == possibility) { match = true; break; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/FalsifyingWebConnection.java b/src/main/java/com/gargoylesoftware/htmlunit/util/FalsifyingWebConnection.java index 49cc503d012..6f648bcbf6b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/FalsifyingWebConnection.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/FalsifyingWebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/HeaderUtils.java b/src/main/java/com/gargoylesoftware/htmlunit/util/HeaderUtils.java index eb27c95d0ef..d207c5a18da 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/HeaderUtils.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/HeaderUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ private HeaderUtils() { * @return if 'Cache-Control' header is present and contains 'private' value */ public static boolean containsPrivate(final WebResponse response) { - return containsValue(response, CACHE_CONTROL_PRIVATE); + return containsCacheControlValue(response, CACHE_CONTROL_PRIVATE); } /** @@ -53,7 +53,7 @@ public static boolean containsPrivate(final WebResponse response) { * @return if 'Cache-Control' header is present and contains 'public' value */ public static boolean containsPublic(final WebResponse response) { - return containsValue(response, CACHE_CONTROL_PUBLIC); + return containsCacheControlValue(response, CACHE_CONTROL_PUBLIC); } /** @@ -61,7 +61,7 @@ public static boolean containsPublic(final WebResponse response) { * @return if 'Cache-Control' header is present and contains 'no-store' value */ public static boolean containsNoStore(final WebResponse response) { - return containsValue(response, CACHE_CONTROL_NO_STORE); + return containsCacheControlValue(response, CACHE_CONTROL_NO_STORE); } /** @@ -69,7 +69,7 @@ public static boolean containsNoStore(final WebResponse response) { * @return if 'Cache-Control' header is present and contains 'no-cache' value@return */ public static boolean containsNoCache(final WebResponse response) { - return containsValue(response, CACHE_CONTROL_NO_CACHE); + return containsCacheControlValue(response, CACHE_CONTROL_NO_CACHE); } /** @@ -77,7 +77,7 @@ public static boolean containsNoCache(final WebResponse response) { * @return if 'Cache-Control' header is present and contains 's-maxage' value */ public static boolean containsSMaxage(final WebResponse response) { - return containsValue(response, CACHE_CONTROL_S_MAXAGE); + return containsCacheControlValue(response, CACHE_CONTROL_S_MAXAGE); } /** @@ -85,7 +85,19 @@ public static boolean containsSMaxage(final WebResponse response) { * @return if 'Cache-Control' header is present and contains 'max-age' value */ public static boolean containsMaxAge(final WebResponse response) { - return containsValue(response, CACHE_CONTROL_MAX_AGE); + return containsCacheControlValue(response, CACHE_CONTROL_MAX_AGE); + } + + /** + * @param response {@code WebResponse} + * @return if 'Cache-Control' header is present and contains 'max-age' value + */ + public static boolean containsMaxAgeOrSMaxage(final WebResponse response) { + final String cacheControl = response.getResponseHeaderValue(HttpHeader.CACHE_CONTROL); + if (StringUtils.contains(cacheControl, CACHE_CONTROL_MAX_AGE)) { + return true; + } + return StringUtils.contains(cacheControl, CACHE_CONTROL_S_MAXAGE); } /** @@ -93,7 +105,7 @@ public static boolean containsMaxAge(final WebResponse response) { * @return value of 's-maxage' directive and 0 if it is absent */ public static long sMaxage(final WebResponse response) { - if (containsValue(response, CACHE_CONTROL_S_MAXAGE)) { + if (containsCacheControlValue(response, CACHE_CONTROL_S_MAXAGE)) { return directiveValue(response, S_MAXAGE_HEADER_PATTERN); } return 0; @@ -104,7 +116,7 @@ public static long sMaxage(final WebResponse response) { * @return value of 'max-age' directive and 0 if it is absent */ public static long maxAge(final WebResponse response) { - if (containsValue(response, CACHE_CONTROL_MAX_AGE)) { + if (containsCacheControlValue(response, CACHE_CONTROL_MAX_AGE)) { return directiveValue(response, MAX_AGE_HEADER_PATTERN); } @@ -116,14 +128,14 @@ private static long directiveValue(final WebResponse response, final Pattern pat if (value != null) { final Matcher matcher = pattern.matcher(value); if (matcher.matches()) { - return Long.valueOf(matcher.group(1)); + return Long.parseLong(matcher.group(1)); } } return 0; } - private static boolean containsValue(final WebResponse response, final String value) { + private static boolean containsCacheControlValue(final WebResponse response, final String value) { final String cacheControl = response.getResponseHeaderValue(HttpHeader.CACHE_CONTROL); return StringUtils.contains(cacheControl, value); } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/KeyDataPair.java b/src/main/java/com/gargoylesoftware/htmlunit/util/KeyDataPair.java index 22f8fb3e7a1..092ffe85d95 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/KeyDataPair.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/KeyDataPair.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/MimeType.java b/src/main/java/com/gargoylesoftware/htmlunit/util/MimeType.java index 654b2fed77e..ea808d70a54 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/MimeType.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/MimeType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,25 @@ /** * Utility holding information about association between MIME type and file extensions. * @author Marc Guillemot + * @author Ronald Brill */ public final class MimeType { + + /** "application/javascript". */ + public static final String APPLICATION_JAVASCRIPT = "application/javascript"; + /** "application/octet-stream". */ + public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + /** application/xhtml+xml. */ + public static final String APPLICATION_XHTML = "application/xhtml+xml"; + /** "text/css". */ + public static final String TEXT_CSS = "text/css"; + /** "text/html". */ + public static final String TEXT_HTML = "text/html"; + /** "text/xml". */ + public static final String TEXT_XML = "text/xml"; + /** "text/plain". */ + public static final String TEXT_PLAIN = "text/plain"; + private static final Map type2extension = buildMap(); private static Map buildMap() { @@ -34,9 +51,9 @@ private static Map buildMap() { map.put("image/jpeg", "jpeg"); map.put("image/png", "png"); map.put("image/svg+xml", "svg"); - map.put("text/css", "css"); - map.put("text/html", "html"); - map.put("text/plain", "txt"); + map.put(TEXT_CSS, "css"); + map.put(MimeType.TEXT_HTML, "html"); + map.put(TEXT_PLAIN, "txt"); map.put("image/x-icon", "ico"); return map; } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/NameValuePair.java b/src/main/java/com/gargoylesoftware/htmlunit/util/NameValuePair.java index 1fb5e78cfce..fe615878db8 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/NameValuePair.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/NameValuePair.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/StringUtils.java b/src/main/java/com/gargoylesoftware/htmlunit/util/StringUtils.java index 508a2cda9e3..a9b91cac10a 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/StringUtils.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/StringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,14 @@ public final class StringUtils { private static final Pattern HEX_COLOR = Pattern.compile("#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})"); private static final Pattern RGB_COLOR = - Pattern.compile("rgb\\s*?\\(\\s*?(\\d{1,3})\\s*?,\\s*?(\\d{1,3})\\s*?,\\s*?(\\d{1,3})\\s*?\\)"); + Pattern.compile("rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%?\\s*," + + "\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%?\\s*," + + "\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%?\\s*\\)"); + private static final Pattern RGBA_COLOR = + Pattern.compile("rgba\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%?\\s*," + + "\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%?\\s*," + + "\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])%?\\s*," + + "\\s*((0?.[1-9])|[01])\\s*\\)"); private static final Pattern ILLEGAL_FILE_NAME_CHARS = Pattern.compile("\\\\|/|\\||:|\\?|\\*|\"|<|>|\\p{Cntrl}"); /** @@ -176,6 +183,27 @@ public static Color findColorRGB(final String token) { return new Color(tmpRed, tmpGreen, tmpBlue); } + /** + * Returns a Color parsed from the given rgb notation. + * @param token the token to parse + * @return a Color whether the token is a color in RGB notation; otherwise null + */ + public static Color findColorRGBA(final String token) { + if (token == null) { + return null; + } + final Matcher tmpMatcher = RGBA_COLOR.matcher(token); + if (!tmpMatcher.find()) { + return null; + } + + final int tmpRed = Integer.parseInt(tmpMatcher.group(1)); + final int tmpGreen = Integer.parseInt(tmpMatcher.group(2)); + final int tmpBlue = Integer.parseInt(tmpMatcher.group(3)); + final int tmpAlpha = (int) (Float.parseFloat(tmpMatcher.group(4)) * 255); + return new Color(tmpRed, tmpGreen, tmpBlue, tmpAlpha); + } + /** * Formats the specified color. * diff --git a/src/main/java/com/gargoylesoftware/htmlunit/TextUtil.java b/src/main/java/com/gargoylesoftware/htmlunit/util/TextUtils.java similarity index 88% rename from src/main/java/com/gargoylesoftware/htmlunit/TextUtil.java rename to src/main/java/com/gargoylesoftware/htmlunit/util/TextUtils.java index 5911bfc4e1b..b1dfbce4822 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/TextUtil.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/TextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit; +package com.gargoylesoftware.htmlunit.util; import static java.nio.charset.StandardCharsets.ISO_8859_1; @@ -29,19 +29,13 @@ * @author Mike Bowler * @author Brad Clarke * @author Ahmed Ashour + * @author Ronald Brill */ -public final class TextUtil { - - /** - * Default charset used. - * - * @deprecated as of 2.26, use {@link java.nio.charset.StandardCharsets#ISO_8859_1} - */ - @Deprecated - public static final Charset DEFAULT_CHARSET = ISO_8859_1; +public final class TextUtils { /** Private constructor to prevent instantiation. */ - private TextUtil() { } + private TextUtils() { + } /** * Convert a string into an input stream. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/UrlUtils.java b/src/main/java/com/gargoylesoftware/htmlunit/util/UrlUtils.java index 051cf9dfea1..820b5b95e99 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/UrlUtils.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/UrlUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -292,11 +292,11 @@ public static URL encodeUrl(final URL url, final boolean minimalQueryEncoding, f * @param anchor the anchor string to encode and escape * @return the encoded and escaped anchor string */ - public static String encodeAnchor(String anchor) { - if (anchor != null) { - anchor = encode(anchor, ANCHOR_ALLOWED_CHARS, UTF_8); + public static String encodeAnchor(final String anchor) { + if (anchor == null) { + return null; } - return anchor; + return encode(anchor, ANCHOR_ALLOWED_CHARS, UTF_8); } /** @@ -305,11 +305,11 @@ public static String encodeAnchor(String anchor) { * @param hash the anchor string to encode and escape * @return the encoded and escaped anchor string */ - public static String encodeHash(String hash) { - if (hash != null) { - hash = encode(hash, HASH_ALLOWED_CHARS, UTF_8); + public static String encodeHash(final String hash) { + if (hash == null) { + return null; } - return hash; + return encode(hash, HASH_ALLOWED_CHARS, UTF_8); } /** @@ -470,6 +470,16 @@ public static URL getUrlWithNewQuery(final URL u, final String newQuery) throws return createNewUrl(u.getProtocol(), u.getAuthority(), u.getPath(), u.getRef(), newQuery); } + /** + * Creates and returns a new URL identical to the specified URL, ignoring path, protocol and query. + * @param u the URL on which to base the returned URL + * @return a new URL identical to the specified URL, ignoring path, protocol and query + * @throws MalformedURLException if there is a problem creating the new URL + */ + public static URL getUrlWithProtocolAndAuthority(final URL u) throws MalformedURLException { + return createNewUrl(u.getProtocol(), u.getAuthority(), null, null, null); + } + /** * Creates a new URL based on the specified fragments. * @param protocol the protocol to use (may not be {@code null}) @@ -485,27 +495,26 @@ public static URL getUrlWithNewQuery(final URL u, final String newQuery) throws private static URL createNewUrl(final String protocol, final String userInfo, final String host, final int port, final String path, final String ref, final String query) throws MalformedURLException { final StringBuilder s = new StringBuilder(); - s.append(protocol); - s.append("://"); + s.append(protocol).append("://"); if (userInfo != null) { - s.append(userInfo).append("@"); + s.append(userInfo).append('@'); } s.append(host); if (port != -1) { - s.append(":").append(port); + s.append(':').append(port); } if (path != null && !path.isEmpty()) { - if (!('/' == path.charAt(0))) { - s.append("/"); + if ('/' != path.charAt(0)) { + s.append('/'); } s.append(path); } if (query != null) { - s.append("?").append(query); + s.append('?').append(query); } if (ref != null) { if (ref.isEmpty() || ref.charAt(0) != '#') { - s.append("#"); + s.append('#'); } s.append(ref); } @@ -542,8 +551,7 @@ private static URL createNewUrl(final String protocol, final String authority, } final StringBuilder s = new StringBuilder(len); - s.append(protocol); - s.append(":"); + s.append(protocol).append(':'); if (authority != null && !authority.isEmpty()) { s.append("//"); s.append(authority); @@ -557,7 +565,7 @@ private static URL createNewUrl(final String protocol, final String authority, } if (ref != null) { if (ref.isEmpty() || ref.charAt(0) != '#') { - s.append("#"); + s.append('#'); } s.append(ref); } @@ -923,11 +931,16 @@ private static Url resolveUrl(final Url baseUrl, final String relativeUrl) { } /** - * "/.." at the beginning should be removed as browsers do (not in RFC) + * "../" after the leading "/" should be removed as browsers do (not in RFC) */ - private static String removeLeadingSlashPoints(String path) { - while (path.startsWith("/..")) { - path = path.substring(3); + private static String removeLeadingSlashPoints(final String path) { + int i = 1; + while (path.startsWith("../", i)) { + i = i + 3; + } + + if (i > 1) { + return "/" + path.substring(i); } return path; @@ -1064,11 +1077,8 @@ public static boolean sameFile(final URL u1, final URL u2) { // ignore } } - if (!(f1 == f2 || (f1 != null && f1.equals(f2)))) { - return false; - } - return true; + return f1 == f2 || (f1 != null && f1.equals(f2)); } /** @@ -1080,17 +1090,16 @@ public static boolean sameFile(final URL u1, final URL u2) { */ public static String normalize(final URL url) { final StringBuilder result = new StringBuilder(); - - result.append(url.getProtocol()); - result.append("://"); - result.append(url.getHost()); - result.append(':'); - result.append((url.getPort() != -1) ? url.getPort() : url.getDefaultPort()); + result.append(url.getProtocol()) + .append("://") + .append(url.getHost()) + .append(':') + .append((url.getPort() != -1) ? url.getPort() : url.getDefaultPort()); // Compare the files. String f = url.getFile(); if (f.isEmpty()) { - result.append("/"); + result.append('/'); } else { if (f.indexOf('.') > 0) { @@ -1138,7 +1147,7 @@ public static URI toURI(final URL url, final String query) throws URISyntaxExcep buffer.append(port); } } - if (path == null || !path.startsWith("/")) { + if (path == null || path.isEmpty() || path.charAt(0) != '/') { buffer.append('/'); } if (path != null) { diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/WebClientUtils.java b/src/main/java/com/gargoylesoftware/htmlunit/util/WebClientUtils.java index 15ca3ebe041..75704305e86 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/WebClientUtils.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/WebClientUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/WebConnectionWrapper.java b/src/main/java/com/gargoylesoftware/htmlunit/util/WebConnectionWrapper.java index f96972bbd01..c3e47edbe09 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/WebConnectionWrapper.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/WebConnectionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ public WebConnection getWrappedWebConnection() { * The default behavior of this method is to return {@link WebConnection#close()} on the wrapped connection object. */ @Override - public void close() throws Exception { + public void close() throws IOException { wrappedWebConnection_.close(); } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/WebResponseWrapper.java b/src/main/java/com/gargoylesoftware/htmlunit/util/WebResponseWrapper.java index d553acfe7e3..9540cb0f066 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/WebResponseWrapper.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/WebResponseWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ * @author Marc Guillemot * @author Ahmed Ashour * @author Ronald Brill + * @author Atsushi Nakagawa */ public class WebResponseWrapper extends WebResponse { @@ -49,6 +50,15 @@ public WebResponseWrapper(final WebResponse webResponse) throws IllegalArgumentE wrappedWebResponse_ = webResponse; } + /** + * {@inheritDoc} + * The default behavior of this method is to return getContentLength() on the wrapped webResponse object. + */ + @Override + public long getContentLength() { + return wrappedWebResponse_.getContentLength(); + } + /** * {@inheritDoc} * The default behavior of this method is to return getContentAsStream() on the wrapped webResponse object. @@ -166,4 +176,22 @@ public String getStatusMessage() { public WebRequest getWebRequest() { return wrappedWebResponse_.getWebRequest(); } + + /** + * {@inheritDoc} + * The default behavior of this method is to call cleanUp() on the wrapped webResponse object. + */ + @Override + public void cleanUp() { + wrappedWebResponse_.cleanUp(); + } + + /** + * {@inheritDoc} + * The default behavior of this method is to call defaultCharsetUtf8() on the wrapped webResponse object. + */ + @Override + public void defaultCharsetUtf8() { + wrappedWebResponse_.defaultCharsetUtf8(); + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlUtil.java b/src/main/java/com/gargoylesoftware/htmlunit/util/XmlUtils.java similarity index 94% rename from src/main/java/com/gargoylesoftware/htmlunit/xml/XmlUtil.java rename to src/main/java/com/gargoylesoftware/htmlunit/util/XmlUtils.java index b829e9c96da..f83a8470453 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlUtil.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/XmlUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,16 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.gargoylesoftware.htmlunit.xml; - -import static java.nio.charset.StandardCharsets.UTF_8; +package com.gargoylesoftware.htmlunit.util; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.lang.reflect.Field; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -63,7 +60,8 @@ import com.gargoylesoftware.htmlunit.html.DomProcessingInstruction; import com.gargoylesoftware.htmlunit.html.DomText; import com.gargoylesoftware.htmlunit.html.ElementFactory; -import com.gargoylesoftware.htmlunit.html.HTMLParser; +import com.gargoylesoftware.htmlunit.html.Html; +import com.gargoylesoftware.htmlunit.xml.XmlPage; /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
@@ -77,17 +75,9 @@ * @author Chuck Dumont * @author Frank Danek */ -public final class XmlUtil { - - /** - * Default encoding used. - * - * @deprecated as of 2.26, use {@link java.nio.charset.StandardCharsets#UTF_8} - */ - @Deprecated - public static final Charset DEFAULT_CHARSET = UTF_8; +public final class XmlUtils { - private static final Log LOG = LogFactory.getLog(XmlUtil.class); + private static final Log LOG = LogFactory.getLog(XmlUtils.class); private static final ErrorHandler DISCARD_MESSAGES_HANDLER = new ErrorHandler() { /** @@ -118,7 +108,7 @@ public void warning(final SAXParseException exception) { /** * Utility class, hide constructor. */ - private XmlUtil() { + private XmlUtils() { // Empty. } @@ -264,8 +254,8 @@ private static DomNode createFrom(final SgmlPage page, final Node source, final } final String ns = source.getNamespaceURI(); String localName = source.getLocalName(); - if (handleXHTMLAsHTML && HTMLParser.XHTML_NAMESPACE.equals(ns)) { - final ElementFactory factory = HTMLParser.getFactory(localName); + if (handleXHTMLAsHTML && Html.XHTML_NAMESPACE.equals(ns)) { + final ElementFactory factory = page.getWebClient().getPageCreator().getHtmlParser().getFactory(localName); return factory.createElementNS(page, ns, localName, namedNodeMapToSaxAttributes(source.getAttributes(), attributesOrderMap, source)); } @@ -282,9 +272,10 @@ private static DomNode createFrom(final SgmlPage page, final Node source, final } final String namespaceURI = source.getNamespaceURI(); - if (HTMLParser.SVG_NAMESPACE.equals(namespaceURI)) { - return HTMLParser.SVG_FACTORY.createElementNS(page, namespaceURI, qualifiedName, - namedNodeMapToSaxAttributes(nodeAttributes, attributesOrderMap, source)); + if (Html.SVG_NAMESPACE.equals(namespaceURI)) { + return page.getWebClient().getPageCreator().getHtmlParser().getSvgFactory() + .createElementNS(page, namespaceURI, qualifiedName, + namedNodeMapToSaxAttributes(nodeAttributes, attributesOrderMap, source)); } final Map attributes = new LinkedHashMap<>(); @@ -376,8 +367,10 @@ private static void copy(final SgmlPage page, final Node source, final DomNode d break; default: - LOG.warn("NodeType " + child.getNodeType() - + " (" + child.getNodeName() + ") is not yet supported."); + if (LOG.isWarnEnabled()) { + LOG.warn("NodeType " + child.getNodeType() + + " (" + child.getNodeName() + ") is not yet supported."); + } } } } @@ -446,7 +439,7 @@ public static Map> getAttributesOrderMap(final Document do final int fNodeCount = getPrivate(deferredDocument, "fNodeCount"); for (int i = 0; i < fNodeCount; i++) { final int type = deferredDocument.getNodeType(i, false); - if (type == org.w3c.dom.Node.ELEMENT_NODE) { + if (type == Node.ELEMENT_NODE) { int attrIndex = deferredDocument.getNodeExtra(i, false); final List attributes = new ArrayList<>(); map.put(i, attributes); diff --git a/src/main/java/com/gargoylesoftware/htmlunit/util/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/util/package-info.java index dce4bd0a656..602be9dcc8b 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/util/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/util/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/webstart/WebStartHandler.java b/src/main/java/com/gargoylesoftware/htmlunit/webstart/WebStartHandler.java index 670d5e2d9c6..0a1b9f3b3e3 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/webstart/WebStartHandler.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/webstart/WebStartHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit.webstart; +import java.io.Serializable; + import com.gargoylesoftware.htmlunit.WebResponse; /** @@ -21,7 +23,7 @@ * * @author Ronald Brill */ -public interface WebStartHandler { +public interface WebStartHandler extends Serializable { /** * Handles the jnlp file response. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/webstart/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/webstart/package-info.java index 75f35f1f004..acc607f4063 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/webstart/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/webstart/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java b/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java index fc112844ce8..234be3acdf4 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/xml/XmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,7 @@ import com.gargoylesoftware.htmlunit.html.DomAttr; import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomProcessingInstruction; +import com.gargoylesoftware.htmlunit.util.XmlUtils; /** * A page that will be returned for response with content type "text/xml". @@ -83,7 +84,7 @@ public XmlPage(final Node node, final WebWindow enclosingWindow) { super(null, enclosingWindow); node_ = node; if (node_ != null) { - XmlUtil.appendChild(this, this, node_, true); + XmlUtils.appendChild(this, this, node_, true); } } @@ -120,39 +121,51 @@ public XmlPage(final WebResponse webResponse, final WebWindow enclosingWindow, f try { try { - final Document document = XmlUtil.buildDocument(webResponse); + final Document document = XmlUtils.buildDocument(webResponse); node_ = document.getFirstChild(); } catch (final SAXException e) { - LOG.warn("Failed parsing XML document " + webResponse.getWebRequest().getUrl() - + ": " + e.getMessage()); + if (LOG.isWarnEnabled()) { + LOG.warn("Failed parsing XML document " + webResponse.getWebRequest().getUrl() + + ": " + e.getMessage()); + } if (!ignoreSAXException) { throw new IOException(e.getMessage()); } } } catch (final ParserConfigurationException e) { - if (null == webResponse) { - LOG.warn("Failed parsing XML empty document: " + e.getMessage()); - } - else { - LOG.warn("Failed parsing XML empty document " + webResponse.getWebRequest().getUrl() - + ": " + e.getMessage()); + if (LOG.isWarnEnabled()) { + if (null == webResponse) { + LOG.warn("Failed parsing XML empty document: " + e.getMessage()); + } + else { + LOG.warn("Failed parsing XML empty document " + webResponse.getWebRequest().getUrl() + + ": " + e.getMessage()); + } } } final Map> attributesOrderMap; if (node_ != null && getWebClient().getBrowserVersion().hasFeature(JS_XML)) { - attributesOrderMap = XmlUtil.getAttributesOrderMap(node_.getOwnerDocument()); + attributesOrderMap = XmlUtils.getAttributesOrderMap(node_.getOwnerDocument()); } else { attributesOrderMap = null; } for (Node node = node_; node != null; node = node.getNextSibling()) { - XmlUtil.appendChild(this, this, node, handleXHTMLAsHTML, attributesOrderMap); + XmlUtils.appendChild(this, this, node, handleXHTMLAsHTML, attributesOrderMap); } } + /** + * {@inheritDoc} + */ + @Override + public void initialize() throws IOException { + // nothing to do here + } + /** * {@inheritDoc} */ @@ -375,7 +388,23 @@ public String getContentType() { * {@inheritDoc} */ @Override - protected void setDocumentType(final DocumentType type) { + public void setDocumentType(final DocumentType type) { super.setDocumentType(type); } + + /** + * {@inheritDoc} + */ + @Override + public void setNodeValue(final String value) { + // Default behavior is to do nothing, overridden in some subclasses + } + + /** + * {@inheritDoc} + */ + @Override + public void setPrefix(final String prefix) { + // Empty. + } } diff --git a/src/main/java/com/gargoylesoftware/htmlunit/xml/package-info.java b/src/main/java/com/gargoylesoftware/htmlunit/xml/package-info.java index 7461c6efbea..31f6fb08f0d 100644 --- a/src/main/java/com/gargoylesoftware/htmlunit/xml/package-info.java +++ b/src/main/java/com/gargoylesoftware/htmlunit/xml/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/netscape/javascript/JSException.java b/src/main/java/netscape/javascript/JSException.java index 2dfde830b3c..f966adc5d42 100644 --- a/src/main/java/netscape/javascript/JSException.java +++ b/src/main/java/netscape/javascript/JSException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/netscape/javascript/JSObject.java b/src/main/java/netscape/javascript/JSObject.java index 07af368b3a4..41a01d24833 100644 --- a/src/main/java/netscape/javascript/JSObject.java +++ b/src/main/java/netscape/javascript/JSObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/netscape/javascript/package-info.java b/src/main/java/netscape/javascript/package-info.java index 9b184d0a458..a4ae8ba5b1d 100644 --- a/src/main/java/netscape/javascript/package-info.java +++ b/src/main/java/netscape/javascript/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/netscape/package-info.java b/src/main/java/netscape/package-info.java index cf0c180a5ee..2872c4c3c52 100644 --- a/src/main/java/netscape/package-info.java +++ b/src/main/java/netscape/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml index 0550aaf2dee..0697d5aef9c 100644 --- a/src/site/fml/faq.fml +++ b/src/site/fml/faq.fml @@ -16,7 +16,7 @@ a new one.

- If you know how to fix the problem then patches are gratefully accepted. + If you know how to fix the problem then pull requests are gratefully accepted.

@@ -32,7 +32,7 @@ tracking database. See the answer on bug reporting for why the database is preferred.

- If you're willing to write the feature yourself, you can always send us a patch. + If you're willing to write the feature yourself, you can always send us a pull requests.

@@ -89,9 +89,14 @@

- You can subclass HttpWebConnection and override getResponse() as: + You can subclass WebConnectionWrapper and override getResponse() as:

@@ -127,8 +136,9 @@ String htmlCode = "" try (WebClient webClient = new WebClient(browserVersion)) { + HTMLParser htmlParser = webClient.getPageCreator().getHtmlParser(); StringWebResponse response = new StringWebResponse(htmlCode, new URL("http://http://htmlunit.sourceforge.net//test.html")); - XHtmlPage page = HTMLParser.parseXHtml(response, webClient.getCurrentWindow()); + XHtmlPage page = htmlParser.parseXHtml(response, webClient.getCurrentWindow()); // work with the html page } ]]> @@ -137,8 +147,9 @@ String htmlCode = "........." try (WebClient webClient = new WebClient(browserVersion)) { + HTMLParser htmlParser = webClient.getPageCreator().getHtmlParser(); StringWebResponse response = new StringWebResponse(htmlCode, new URL("http://http://htmlunit.sourceforge.net//test.html")); - HtmlPage page = HTMLParser.parseHtml(response, webClient.getCurrentWindow()); + HtmlPage page = htmlParser.parseHtml(response, webClient.getCurrentWindow()); // work with the html page } ]]> @@ -165,8 +176,7 @@ 26.02.2003 16:07:05 org.apache.commons.httpclient.HttpMethodBase processRedirectResponse -INFO: Redirect requested but followRedirects is disabled - +INFO: Redirect requested but followRedirects is disabled

It's an annoyance that I haven't figured out how to fix yet.

@@ -184,6 +194,30 @@ INFO: Redirect requested but followRedirects is disabled
+ + + There are many errors reported by the DefaultCssErrorHandler inside my log output. Can I ignore/disable these messages? + + +

+ This is because our CSS parser detects some problem with one of the css resources your page relies on. + Usually you will see similar error messages if you open your browser debug output window and enable the css log + message. +

+

+ At least if you are scraping web pages you can ignore this. To suppress the output use the SilentCssErrorHandler + or implement your own CSSErrorHandler. +

+ +
+
+ What version will feature X be in? @@ -198,7 +232,7 @@ INFO: Redirect requested but followRedirects is disabled volunteers in their spare time. If feature X is important to you and nobody seems to be working on it then perhaps you should consider writing it yourself and submitting a - patch. + pull requests.

diff --git a/src/site/resources/images/logos/github.png b/src/site/resources/images/logos/github.png new file mode 100644 index 00000000000..e1a841faf5e Binary files /dev/null and b/src/site/resources/images/logos/github.png differ diff --git a/src/site/resources/images/logos/twitter.png b/src/site/resources/images/logos/twitter.png new file mode 100644 index 00000000000..806e700e6cf Binary files /dev/null and b/src/site/resources/images/logos/twitter.png differ diff --git a/src/site/site.xml b/src/site/site.xml index e3c7db0fa2a..817bdbccaa7 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -6,17 +6,17 @@ org.apache.maven.skins maven-fluido-skin - 1.5 + 1.7 + ${project.name} + http://htmlunit.sourceforge.net/ + + Gargoyle Software Inc. /images/GargoyleSoftwareLogo.jpg http://www.GargoyleSoftware.com/ - - - ${project.name} - http://htmlunit.sourceforge.net/ @@ -28,17 +28,19 @@ + + - + @@ -46,7 +48,7 @@ - + diff --git a/src/site/xdoc/details.xml b/src/site/xdoc/details.xml new file mode 100644 index 00000000000..fe4e8d7528c --- /dev/null +++ b/src/site/xdoc/details.xml @@ -0,0 +1,63 @@ + + + + + Details about HtmlUnit + RBRi + + + +
+

+ HtmlUnit mimics the browser as close as possible, of course this includes the sent request headers also. + But you can change this if needed at two levels; the request level and the client level.
+ To change the request header at the client level use WebClient.addRequestHeader(). You are able to + add additional headers to every request made by this client or overwrite the default ones.
+ Example: add an addition header to every client request +

+ +

+ To change the request header at the client level use WebClient.addRequestHeader().
+ Example: replace the default accept-language header for all request made by this client. +

+ +

+ Example: replace the default accept-language header for all request made by this client. +

+ +

+ Example: replace the default accept-language header for all request made by this client. +

+ +

+ It is also possible to add/overwrite a request header for a dedicated request. + Example: +

+ +
+ +
+

+ Normally pages are loaded inline: clicking on + a link, for example, loads the linked page in the current window. Attached pages are different + in that they are intended to be loaded outside of this flow: clicking on a link prompts the + user to either save the linked page, or open it outside of the current window, but does not + load the page in the current window. +

+

+ HtmlUnit complies with the semantics described above when an AttachmentHandler has + been registered with the com.gargoylesoftware.htmlunit.WebClient via + com.gargoylesoftware.htmlunit.WebClient#setAttachmentHandler(AttachmentHandler). When + no attachment handler has been registered with the WebClient, the semantics described + above to not apply, and attachments are loaded inline. By default, AttachmentHandlers + are not registered with new WebClient instances. +

+
+ +
diff --git a/src/site/xdoc/fileupload-howto.xml b/src/site/xdoc/fileupload-howto.xml new file mode 100644 index 00000000000..31074a470b7 --- /dev/null +++ b/src/site/xdoc/fileupload-howto.xml @@ -0,0 +1,70 @@ + + + + + Details about HtmlUnit + RBRi + + + +
+

+ From the browsers point of view the file upload is supported using a special input control. + You can find some basics here.
+ To trigger the file upload from HtmlUnit you have to +

    +
  • get the page
  • +
  • find the file input element
  • +
  • assign the path to the file you like to upload to the file input
  • +
  • submit the form (by pressing the button like the user does)
  • +
+

+

+ Example:
Upload a file using the path to a local file +

+ +

+ Example:
Upload file content from memory +

+ +

+ Example:
Upload multiple files (if the 'multiple' attribut is set for the file input control) +

+ +
+ +
diff --git a/src/site/xdoc/gettingLatestCode.xml b/src/site/xdoc/gettingLatestCode.xml index 277eac40947..42ed40ea171 100644 --- a/src/site/xdoc/gettingLatestCode.xml +++ b/src/site/xdoc/gettingLatestCode.xml @@ -13,15 +13,14 @@

- At any time, all the code in SVN should be compilable and should pass all the unit tests. There + At any time, all the code in the git repository should be compilable and should pass all the unit tests. There is no guarantee that it will be full featured - this is a work in progress.

- You can download the latest build from our Build server - kindly hosted by Canoo AG. + You can download the latest build from our Build server.

@@ -50,14 +49,10 @@

-
+

- Another way to get the latest code is through SVN. - Create a directory for HtmlUnit (for instance c:\htmlunit or ~/htmlunit). Change to that directory and execute the - following commands. + The source code is hosted at GitHub.

-
diff --git a/src/site/xdoc/gettingStarted.xml b/src/site/xdoc/gettingStarted.xml index 8e67cdb4f6c..a38d606c329 100644 --- a/src/site/xdoc/gettingStarted.xml +++ b/src/site/xdoc/gettingStarted.xml @@ -152,7 +152,7 @@ public void getElements() throws Exception {

XPath is the suggested way for more complex searches, a brief tutorial can be found in - W3Schools + W3Schools

HtmlUnit is used as the underlying "browser" by different Open Source tools like Canoo WebTest, - JWebUnit, + JWebUnit, WebDriver, JSFUnit, - WETATOR, + WETATOR, Celerity, - Spring MVC Test HtmlUnit, ... + Spring Testing, ...

HtmlUnit was originally written by @@ -54,14 +54,24 @@

-
Latest build
+
Latest release January 28, 2020
- Build server (Log in as 'guest') +

version 2.37.0

- -
Latest release March 25, 2018
+ +
Source code
+
+

GitHub

+
+ +
News
+
+

Twitter

+
+ +
Latest build / CI server
- version 2.30 +

Jenkins build server

@@ -90,7 +100,7 @@ Submitting bugs
  • - Submitting patches + Submitting pull requests
  • Getting and building the most recent code @@ -157,7 +167,7 @@ net.sourceforge.htmlunit htmlunit - 2.30 + 2.37.0 ]]>

  • @@ -172,6 +182,7 @@ The unit tests of some well-known JavaScript libraries are included in HtmlUnit's own unit tests; based on these unit tests, the following libraries are known to work well with HtmlUnit:
      +
    • jQuery 1.11.3: Full support (see unit test here)
    • jQuery 1.8.2: Full support (see unit test here)
    • MochiKit 1.4.1: Full support (see unit tests here)
    • GWT 2.5.0: Full support (see unit test here)
    • diff --git a/src/site/xdoc/logging.xml b/src/site/xdoc/logging.xml index 30ccd813d98..4caa805e969 100644 --- a/src/site/xdoc/logging.xml +++ b/src/site/xdoc/logging.xml @@ -8,51 +8,81 @@
      -

      - HtmlUnit uses the commons logging - package from the Apache Jakarta project. Commons - logging is a thin wrapper that sits on top of other logging frameworks such as - LOG4J or - LogKit. -

      -

      - For full details on configuring commons logging, refer to the - homepage. -

      -

      - If you don't explicitly configure commons logging to use LOG4J or another logging framework - then it will use the simple logger. When using the simple logger, you can change the default - logging level by setting the following system property. -

      - -

      - Valid values for this property are "trace", "debug", "info", "warn", "error", or "fatal" (in - order from least serious to most serious). -

      + +

      + HtmlUnit uses the commons logging + package from the Apache Jakarta project. Commons + logging is a thin wrapper that sits on top of other logging frameworks such as + LOG4J or + SLF4J. +

      +

      + For full details on configuring commons logging, refer to the + homepage. +

      +

      + If you don't explicitly configure commons logging to use LOG4J or another logging framework + then it will use the simple logger. When using the simple logger, you can change the default + logging level by setting the following system property. +

      + +

      + Valid values for this property are "trace", "debug", "info", "warn", "error", or "fatal" (in + order from least serious to most serious). +

      +
      + +

      + In HtmlUnit, each class has its own log named according to the class's fully qualified name. +

      +

      + HtmlUnit uses Apache HttpClient which uses "org.apache.http" to log the headers and wire content, + please read more in + HttpClient Logging Practices +

      +
      -
      -

      - In HtmlUnit, each class has its own log named according to the class's fully qualified name. -

      -

      - HtmlUnit uses Apache HttpClient which uses "org.apache.http" to log the headers and wire content, - please read more in - HttpClient Logging Practices -

      -
      -
      -

      - The package used to parse the HTML has the ability to report the problems it encounters while parsing source. - These messages may be programmatically catched or easily logged to the - "com.gargoylesoftware.htmlunit.html.HTMLParserListener" log for instance by calling: - + +

      + HtmlUnit uses a slightly modified version of Rhino for JavaScript processing (htmlunit-core-js). + All JavaScript related problems are forwarded to the JavaScriptErrorListener configured for + the WebClient. + The WebClient uses by default an instance of + class 'com.gargoylesoftware.htmlunit.javascript.DefaultJavaScriptErrorListener'. + The DefaultJavaScriptErrorListener simply logs all information using commons logging. + + If you only like to ignore all JavaScript problems use SilentJavaScriptErrorListener. +

      + + + +

      + The package used to parse the HTML (htmlunit-neko ) has the ability to report + the problems it encounters while parsing source. + These messages may be programmatically catched or easily logged to the + "com.gargoylesoftware.htmlunit.html.HTMLParserListener" log for instance by calling: + - The parser (NekoHTML) by default processes the - content that is outside of the BODY and HTML tags. This is seen by the logging reporting that the - BODY and HTML tags are not closed properly. This can be changed by calling - 'WebClient.setIgnoreOutsideContent(true);'. -

      +

      +
      + + +

      + HtmlUnit uses a separate CSS parser package (htmlunit-cssparser). + Parsing problems are reported using the CSSErrorHandler configured for the WebClient. + The WebClient by default uses an instance of class 'com.gargoylesoftware.htmlunit.DefaultCssErrorHandler'. + The DefaultCssErrorHandler simply logs all information using commons logging. + + If you only like to ignore all CSS parsing problems use SilentCssErrorHandler. +

      +
      diff --git a/src/site/xdoc/submittingBugs.xml b/src/site/xdoc/submittingBugs.xml index fc99fc1295f..9160e6dfba9 100644 --- a/src/site/xdoc/submittingBugs.xml +++ b/src/site/xdoc/submittingBugs.xml @@ -15,14 +15,13 @@ Bugs are a constant problem with software development. In HtmlUnit, there are several factors for the cause of bugs. These include: bugs in third-party code, functionality that still is not supported by HtmlUnit, bugs in your code, or true bugs in HtmlUnit. To track these bugs, we are - using the SourceForge issue tracking system located at - - http://sourceforge.net/tracker/?group_id=47038&atid=448266 + using the GitHub issue tracking system located at + https://github.com/HtmlUnit/htmlunit/issues

      Before reporting an error, make sure that you are up to the latest version of the software. If - you can, get the latest snapshot, - or build it from Subversion to see if the error still occurs. Check the + you can, get the latest snapshot, + or build it from the sources yourself to see if the error still occurs. Check the dependencies to be sure that you have all the required jar files. Also, review the list of bugs and recently closed bugs to see if someone else has already reported the bug. If they have, you may want to just add more detail to it. @@ -48,8 +47,8 @@

    • Best is to review the code and find what is causing the bug and not only write a unit test that - produces the bug, but also a patch that fixes the bug. Include these files in the bug report - following the rules for submitting patches. + produces the bug, but also a pull requests that fixes the bug. Include these files in the bug report + following the rules for submitting pull requests.

    diff --git a/src/site/xdoc/submittingJSBugs.xml b/src/site/xdoc/submittingJSBugs.xml index 02fc8eca257..da6e376ad8f 100644 --- a/src/site/xdoc/submittingJSBugs.xml +++ b/src/site/xdoc/submittingJSBugs.xml @@ -69,7 +69,7 @@ net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot call met

    Use the latest released version at least, if not the - + latest snapshot.

    diff --git a/src/site/xdoc/submittingPatches.xml b/src/site/xdoc/submittingPatches.xml index 3095078a1c5..234f5e36eba 100644 --- a/src/site/xdoc/submittingPatches.xml +++ b/src/site/xdoc/submittingPatches.xml @@ -2,7 +2,7 @@ - Submitting Patches + Submitting pull requests Mike Bowler Ahmed Ashour @@ -10,20 +10,15 @@

    - Contributions are always welcome. The preferred way to submit a patch is to attach it to - a bug or feature request in the SourceForge database. Remember that patches for documentation + Contributions are always welcome. The preferred way to create a pull request against the + GitHub repository. Remember that pull requests for documentation or additional test cases are just as valuable as code patches.

    -

    - In order to be successfully merged, patches must be generated from the most recent code in svn. - Refer to "Getting Latest Code" for information on retrieving - and building the latest code. -

    -
    +

    These rules are intended to reduce the effort that the maintainers need to do when accepting - a patch. If the patch requires too much effort to "clean up" before being merged then it will + a pull request. If the pull request requires too much effort to "clean up" before being merged then it will likely be rejected. Remember that everyone working on this project is volunteering their time so lets be considerate.

      @@ -62,19 +57,10 @@ author at the top. Refer to How to Write JavaDoc for more specific information on javadoc. -
    • - Patches should be in "unified diff" format. -
    • -
    • - Please provide only one patch that contains all the files. Some people - will submit separate patches for each file in the diff and this just - makes more work for the committer. Please also submit it as one single diff, - not zipped up - again because it's easier for the committers. -

    - IMPORTANT: Patches without tests will be rejected. Occasionally + IMPORTANT: Pull requests without tests will be rejected. Occasionally one of the committers will have the time to write the tests for you but this is rare. If you are not sure how to write a test for a given situation then ask on the developer mailing list. diff --git a/src/site/xdoc/table-howto.xml b/src/site/xdoc/table-howto.xml index 85479c382a9..f8a9d4eb3a5 100644 --- a/src/site/xdoc/table-howto.xml +++ b/src/site/xdoc/table-howto.xml @@ -7,7 +7,7 @@ -

    +

    The first set of examples will use this simple html.

    diff --git a/src/test/java/com/gargoylesoftware/htmlunit/AbstractPageTest.java b/src/test/java/com/gargoylesoftware/htmlunit/AbstractPageTest.java index 0264f87b057..467e0fb2806 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/AbstractPageTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/AbstractPageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BinaryPageTest.java b/src/test/java/com/gargoylesoftware/htmlunit/BinaryPageTest.java index 4a609cc7720..b0a3242005d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BinaryPageTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BinaryPageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,12 +31,11 @@ * Tests for binary content. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class BinaryPageTest extends WebServerTestCase { - private PrimitiveWebServer primitiveWebServer_; - /** * @throws Exception if the test fails */ @@ -131,21 +129,11 @@ public void chunked() throws Exception { + "Z\r\n" + "0\r\n\r\n"; - primitiveWebServer_ = new PrimitiveWebServer(PORT, response); - primitiveWebServer_.start(); - final WebClient client = getWebClient(); - - final TextPage page = client.getPage(URL_FIRST + "chunked"); - assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ", page.getContent()); - } + try (PrimitiveWebServer primitiveWebServer = new PrimitiveWebServer(null, response, null)) { + final WebClient client = getWebClient(); - /** - * @throws Exception if an error occurs - */ - @After - public void stopServer() throws Exception { - if (primitiveWebServer_ != null) { - primitiveWebServer_.stop(); + final TextPage page = client.getPage("http://localhost:" + primitiveWebServer.getPort() + "/" + "chunked"); + assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ", page.getContent()); } } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java b/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java index 441d1f01d4f..862c5e1e4b2 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -121,8 +121,7 @@ public BrowserParameterizedRunner(final Class klass) throws Throwab verifyDefaultMEthod(); - final Parameters parameters = getParametersMethod().getAnnotation( - Parameters.class); + final Parameters parameters = getParametersMethod().getAnnotation(Parameters.class); final List tests = createTestsForParameters( allParameters(), parameters.name()); @@ -134,44 +133,36 @@ public BrowserParameterizedRunner(final Class klass) throws Throwab runners_.add(new BrowserVersionClassRunnerWithParameters( klass, BrowserVersion.CHROME, true, tests)); } - if (browsers.contains("ff45")) { + if (browsers.contains("ff60")) { runners_.add(new BrowserVersionClassRunnerWithParameters( - klass, BrowserVersion.FIREFOX_45, true, tests)); + klass, BrowserVersion.FIREFOX_60, true, tests)); } - if (browsers.contains("ff52")) { + if (browsers.contains("ff68")) { runners_.add(new BrowserVersionClassRunnerWithParameters( - klass, BrowserVersion.FIREFOX_52, true, tests)); + klass, BrowserVersion.FIREFOX_68, true, tests)); } if (browsers.contains("ie")) { runners_.add(new BrowserVersionClassRunnerWithParameters( klass, BrowserVersion.INTERNET_EXPLORER, true, tests)); } - if (browsers.contains("edge")) { - runners_.add(new BrowserVersionClassRunnerWithParameters( - klass, BrowserVersion.EDGE, true, tests)); - } } if (browsers.contains("hu-chrome")) { runners_.add(new BrowserVersionClassRunnerWithParameters( klass, BrowserVersion.CHROME, false, tests)); } - if (browsers.contains("hu-ff45")) { + if (browsers.contains("hu-ff60")) { runners_.add(new BrowserVersionClassRunnerWithParameters( - klass, BrowserVersion.FIREFOX_45, false, tests)); + klass, BrowserVersion.FIREFOX_60, false, tests)); } - if (browsers.contains("hu-ff52")) { + if (browsers.contains("hu-ff68")) { runners_.add(new BrowserVersionClassRunnerWithParameters( - klass, BrowserVersion.FIREFOX_52, false, tests)); + klass, BrowserVersion.FIREFOX_68, false, tests)); } if (browsers.contains("hu-ie")) { runners_.add(new BrowserVersionClassRunnerWithParameters( klass, BrowserVersion.INTERNET_EXPLORER, false, tests)); } - if (browsers.contains("hu-edge")) { - runners_.add(new BrowserVersionClassRunnerWithParameters( - klass, BrowserVersion.EDGE, false, tests)); - } } else { throw new IllegalStateException("No @Test method found"); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java b/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java index 3b66b134d53..8bd46dec59d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; @@ -57,6 +56,7 @@ * * @author Ahmed Ashour * @author Frank Danek + * @author Ronald Brill */ public class BrowserRunner extends Suite { @@ -77,35 +77,29 @@ public BrowserRunner(final Class klass) throws Throwable { if (browsers.contains("chrome")) { runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.CHROME, true)); } - if (browsers.contains("ff45")) { - runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_45, true)); + if (browsers.contains("ff60")) { + runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_60, true)); } - if (browsers.contains("ff52")) { - runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_52, true)); + if (browsers.contains("ff68")) { + runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_68, true)); } if (browsers.contains("ie")) { runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.INTERNET_EXPLORER, true)); } - if (browsers.contains("edge")) { - runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.EDGE, true)); - } } if (browsers.contains("hu-chrome")) { runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.CHROME, false)); } - if (browsers.contains("hu-ff45")) { - runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_45, false)); + if (browsers.contains("hu-ff60")) { + runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_60, false)); } - if (browsers.contains("hu-ff52")) { - runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_52, false)); + if (browsers.contains("hu-ff68")) { + runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_68, false)); } if (browsers.contains("hu-ie")) { runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.INTERNET_EXPLORER, false)); } - if (browsers.contains("hu-edge")) { - runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.EDGE, false)); - } } else { throw new IllegalStateException("No @Test method found"); @@ -163,17 +157,14 @@ public enum TestedBrowser { /** Internet Explorer 11. */ IE, - /** Edge. */ - EDGE, - /** All versions of Firefox. */ FF, - /** Firefox 45. */ - FF45, + /** Firefox 60. */ + FF60, - /** Firefox 52. */ - FF52 + /** Firefox 68. */ + FF68 } /** @@ -201,12 +192,6 @@ public enum TestedBrowser { */ String[] IE() default { EMPTY_DEFAULT }; - /** - * Alerts for Edge. - * @return the alerts - */ - String[] EDGE() default { EMPTY_DEFAULT }; - /** * Alerts for any Firefox, it can be overridden by specific FF version. * @return the alerts @@ -214,16 +199,16 @@ public enum TestedBrowser { String[] FF() default { EMPTY_DEFAULT }; /** - * Alerts for Firefox 45. If not defined, {@link #FF()} is used. + * Alerts for Firefox 60. If not defined, {@link #FF()} is used. * @return the alerts */ - String[] FF45() default { EMPTY_DEFAULT }; + String[] FF60() default { EMPTY_DEFAULT }; /** - * Alerts for Firefox 52. If not defined, {@link #FF()} is used. + * Alerts for Firefox 68. If not defined, {@link #FF()} is used. * @return the alerts */ - String[] FF52() default { EMPTY_DEFAULT }; + String[] FF68() default { EMPTY_DEFAULT }; /** * Alerts for latest Chrome. @@ -259,12 +244,6 @@ public enum TestedBrowser { */ String[] IE() default { EMPTY_DEFAULT }; - /** - * Alerts for Edge. - * @return the alerts - */ - String[] EDGE() default { EMPTY_DEFAULT }; - /** * Alerts for any Firefox, it can be overridden by specific FF version. * @return the alerts @@ -272,16 +251,16 @@ public enum TestedBrowser { String[] FF() default { EMPTY_DEFAULT }; /** - * Alerts for Firefox 45. If not defined, {@link #FF()} is used. + * Alerts for Firefox 60. If not defined, {@link #FF()} is used. * @return the alerts */ - String[] FF45() default { EMPTY_DEFAULT }; + String[] FF60() default { EMPTY_DEFAULT }; /** - * Alerts for Firefox 52. If not defined, {@link #FF()} is used. + * Alerts for Firefox 68. If not defined, {@link #FF()} is used. * @return the alerts */ - String[] FF52() default { EMPTY_DEFAULT }; + String[] FF68() default { EMPTY_DEFAULT }; /** * Alerts for latest Chrome. @@ -311,7 +290,7 @@ public enum TestedBrowser { * @return the browsers */ TestedBrowser[] value() default { - IE, FF, CHROME, EDGE + IE, FF, CHROME }; } @@ -322,14 +301,85 @@ TestedBrowser[] value() default { @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public static @interface BuggyWebDriver { + /** + * Alerts that is used for all browsers (if defined, the other values are ignored). + * @return the alerts + */ + String[] value() default { EMPTY_DEFAULT }; /** - * The browsers with which the case is failing. - * @return the browsers + * Alerts for Internet Explorer 11. + * @return the alerts */ - TestedBrowser[] value() default { - IE, FF, CHROME, EDGE - }; + String[] IE() default { EMPTY_DEFAULT }; + + /** + * Alerts for any Firefox, it can be overridden by specific FF version. + * @return the alerts + */ + String[] FF() default { EMPTY_DEFAULT }; + + /** + * Alerts for Firefox 60. If not defined, {@link #FF()} is used. + * @return the alerts + */ + String[] FF60() default { EMPTY_DEFAULT }; + + /** + * Alerts for Firefox 68. If not defined, {@link #FF()} is used. + * @return the alerts + */ + String[] FF68() default { EMPTY_DEFAULT }; + + /** + * Alerts for latest Chrome. + * @return the alerts + */ + String[] CHROME() default { EMPTY_DEFAULT }; + + /** + * The default alerts, if nothing more specific is defined. + * @return the alerts + */ + String[] DEFAULT() default { EMPTY_DEFAULT }; + } + + /** + * Indicates that the test produces different result when running with HtmlUnit. + * @see TestedBrowser + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + public static @interface HtmlUnitNYI { + /** + * Alerts that is used for all browsers (if defined, the other values are ignored). + * @return the alerts + */ + String[] value() default { EMPTY_DEFAULT }; + + /** + * Alerts for Internet Explorer 11. + * @return the alerts + */ + String[] IE() default { EMPTY_DEFAULT }; + + /** + * Alerts for Firefox 60. + * @return the alerts + */ + String[] FF60() default { EMPTY_DEFAULT }; + + /** + * Alerts for Firefox 68. + * @return the alerts + */ + String[] FF68() default { EMPTY_DEFAULT }; + + /** + * Alerts for latest Chrome. + * @return the alerts + */ + String[] CHROME() default { EMPTY_DEFAULT }; } /** diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunnerTest.java b/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunnerTest.java index cf7808f23d8..6e5ea04482f 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunnerTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunnerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java index 4e39b4f64b9..d03611c4a63 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersion2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.html.HtmlPageTest; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Unit tests for {@link BrowserVersion}. @@ -42,9 +43,9 @@ public class BrowserVersion2Test extends WebDriverTestCase { */ @Test @Alerts(DEFAULT = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - CHROME = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", - IE = "Accept: text/html, application/xhtml+xml, */*", - EDGE = "Accept: text/html, application/xhtml+xml, image/jxr, */*") + CHROME = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9," + + "image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + IE = "Accept: text/html, application/xhtml+xml, */*") public void acceptHeaderGetUrl() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "Response"; @@ -59,9 +60,8 @@ public void acceptHeaderGetUrl() throws Exception { @Test @Alerts(DEFAULT = {"2", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}, CHROME = {"2", "Accept: text/html,application/xhtml+xml," - + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"}, - IE = {"2", "Accept: text/html, application/xhtml+xml, */*"}, - EDGE = {"2", "Accept: text/html, application/xhtml+xml, image/jxr, */*"}) + + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"}, + IE = {"2", "Accept: text/html, application/xhtml+xml, */*"}) public void acceptHeaderWindowOpen() throws Exception { String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "Response"; @@ -89,9 +89,8 @@ public void acceptHeaderWindowOpen() throws Exception { @Test @Alerts(DEFAULT = {"2", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}, CHROME = {"2", "Accept: text/html,application/xhtml+xml," - + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"}, - IE = {"2", "Accept: text/html, application/xhtml+xml, */*"}, - EDGE = { "2", "Accept: text/html, application/xhtml+xml, image/jxr, */*" }) + + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"}, + IE = {"2", "Accept: text/html, application/xhtml+xml, */*"}) public void acceptHeaderAnchorClick() throws Exception { String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "Response"; @@ -114,9 +113,9 @@ public void acceptHeaderAnchorClick() throws Exception { */ @Test @Alerts(DEFAULT = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - CHROME = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", - IE = "Accept: text/html, application/xhtml+xml, */*", - EDGE = "Accept: text/html, application/xhtml+xml, image/jxr, */*") + CHROME = "Accept: text/html,application/xhtml+xml,application/xml;" + + "q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + IE = "Accept: text/html, application/xhtml+xml, */*") public void acceptHeaderAnchorClickWithType() throws Exception { String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "Response"; @@ -141,11 +140,10 @@ public void acceptHeaderAnchorClickWithType() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "Accept: image/png,image/*;q=0.8,*/*;q=0.5", - CHROME = "Accept: image/webp,image/apng,image/*,*/*;q=0.8", - FF52 = "Accept: */*", - IE = "Accept: image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5", - EDGE = "Accept: image/png, image/svg+xml, image/jxr, image/*;q=0.8, */*;q=0.5") + @Alerts(CHROME = "Accept: image/webp,image/apng,image/*,*/*;q=0.8", + FF60 = "Accept: */*", + FF68 = "Accept: image/webp,*/*", + IE = "Accept: image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5") public void acceptHeaderImage() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -159,6 +157,7 @@ public void acceptHeaderImage() throws Exception { + "\n" + " \n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPage2(html); assertEquals(2, getMockWebConnection().getRequestCount()); @@ -170,8 +169,7 @@ public void acceptHeaderImage() throws Exception { */ @Test @Alerts(DEFAULT = "Accept: text/css,*/*;q=0.1", - IE = "Accept: text/css, */*", - EDGE = "Accept: text/css, */*") + IE = "Accept: text/css, */*") public void acceptHeaderCss() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -186,6 +184,7 @@ public void acceptHeaderCss() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPage2(html); assertEquals(2, getMockWebConnection().getRequestCount()); @@ -197,8 +196,7 @@ public void acceptHeaderCss() throws Exception { */ @Test @Alerts(DEFAULT = "Accept: */*", - IE = "Accept: application/javascript, */*;q=0.8", - EDGE = "Accept: application/javascript, */*;q=0.8") + IE = "Accept: application/javascript, */*;q=0.8") public void acceptHeaderJavascript() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -207,6 +205,7 @@ public void acceptHeaderJavascript() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPage2(html); assertEquals(2, getMockWebConnection().getRequestCount()); @@ -218,8 +217,7 @@ public void acceptHeaderJavascript() throws Exception { */ @Test @Alerts(DEFAULT = "Accept: */*", - IE = "Accept: application/javascript, */*;q=0.8", - EDGE = "Accept: application/javascript, */*;q=0.8") + IE = "Accept: application/javascript, */*;q=0.8") public void acceptHeaderJavascriptWithoutType() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -228,6 +226,7 @@ public void acceptHeaderJavascriptWithoutType() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPage2(html); assertEquals(2, getMockWebConnection().getRequestCount()); @@ -239,8 +238,7 @@ public void acceptHeaderJavascriptWithoutType() throws Exception { */ @Test @Alerts(DEFAULT = "Accept: text/css,*/*;q=0.1", - IE = "Accept: text/css, */*", - EDGE = "Accept: text/css, */*") + IE = "Accept: text/css, */*") public void acceptHeaderCssWithoutType() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -255,6 +253,7 @@ public void acceptHeaderCssWithoutType() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPage2(html); assertEquals(2, getMockWebConnection().getRequestCount()); @@ -266,8 +265,7 @@ public void acceptHeaderCssWithoutType() throws Exception { */ @Test @Alerts(DEFAULT = {"2", "Accept: text/css,*/*;q=0.1"}, - IE = {"2", "Accept: text/css, */*"}, - EDGE = {"2", "Accept: text/css, */*"}) + IE = {"2", "Accept: text/css, */*"}) public void acceptHeaderCssEmptyType() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -282,6 +280,7 @@ public void acceptHeaderCssEmptyType() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final int requests = getMockWebConnection().getRequestCount(); loadPage2(html); @@ -296,8 +295,7 @@ public void acceptHeaderCssEmptyType() throws Exception { */ @Test @Alerts(DEFAULT = {"2", "Accept: text/css,*/*;q=0.1"}, - IE = {"2", "Accept: text/css, */*"}, - EDGE = {"2", "Accept: text/css, */*"}) + IE = {"2", "Accept: text/css, */*"}) public void acceptHeaderCssBlankType() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -312,6 +310,7 @@ public void acceptHeaderCssBlankType() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final int requests = getMockWebConnection().getRequestCount(); loadPage2(html); @@ -327,9 +326,8 @@ public void acceptHeaderCssBlankType() throws Exception { @Test @Alerts(DEFAULT = {"2", "Accept: text/css,*/*;q=0.1"}, CHROME = {"1", "Accept: text/html,application/xhtml+xml," - + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"}, - IE = {"2", "Accept: text/css, */*"}, - EDGE = {"2", "Accept: text/css, */*"}) + + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"}, + IE = {"2", "Accept: text/css, */*"}) public void acceptHeaderCssDifferentType() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -344,6 +342,7 @@ public void acceptHeaderCssDifferentType() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final int requests = getMockWebConnection().getRequestCount(); loadPage2(html); @@ -359,9 +358,8 @@ public void acceptHeaderCssDifferentType() throws Exception { @Test @Alerts(DEFAULT = {"2", "Accept: text/css,*/*;q=0.1"}, CHROME = {"1", "Accept: text/html,application/xhtml+xml," - + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"}, - IE = {"2", "Accept: text/css, */*"}, - EDGE = {"2", "Accept: text/css, */*"}) + + "application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"}, + IE = {"2", "Accept: text/css, */*"}) public void acceptHeaderCssWrongType() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -376,6 +374,7 @@ public void acceptHeaderCssWrongType() throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final int requests = getMockWebConnection().getRequestCount(); loadPage2(html); @@ -389,8 +388,7 @@ public void acceptHeaderCssWrongType() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "Accept: */*", - FF45 = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") + @Alerts("Accept: */*") public void acceptHeaderXMLHttpRequest() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionFeaturesTest.java b/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionFeaturesTest.java index 4b00d3887b1..73e160c95e9 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionFeaturesTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionFeaturesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,11 +65,10 @@ public void lexicographicOrder() { @Test public void unusedFeatures() throws Exception { final List browsers = new LinkedList<>(); - browsers.add(BrowserVersion.FIREFOX_45); - browsers.add(BrowserVersion.FIREFOX_52); + browsers.add(BrowserVersion.FIREFOX_60); + browsers.add(BrowserVersion.FIREFOX_68); browsers.add(BrowserVersion.INTERNET_EXPLORER); browsers.add(BrowserVersion.CHROME); - browsers.add(BrowserVersion.EDGE); for (final BrowserVersionFeatures feature : BrowserVersionFeatures.values()) { int useCount = 0; @@ -109,17 +108,14 @@ private static SupportedBrowser expectedBrowserName(final BrowserVersion browser if (browser == BrowserVersion.CHROME) { return SupportedBrowser.CHROME; } - if (browser == BrowserVersion.INTERNET_EXPLORER) { - return SupportedBrowser.IE; + if (browser == BrowserVersion.FIREFOX_60) { + return SupportedBrowser.FF60; } - if (browser == BrowserVersion.FIREFOX_45) { - return SupportedBrowser.FF45; - } - if (browser == BrowserVersion.FIREFOX_52) { - return SupportedBrowser.FF52; + if (browser == BrowserVersion.FIREFOX_68) { + return SupportedBrowser.FF68; } - return SupportedBrowser.EDGE; + return SupportedBrowser.IE; } /** @@ -145,7 +141,7 @@ private void unusedCheck(final File dir, final List unusedFeatures) thro final File[] files = dir.listFiles(); if (files != null) { for (final File file : files) { - if (file.isDirectory() && !".svn".equals(file.getName())) { + if (file.isDirectory() && !".git".equals(file.getName())) { unusedCheck(file, unusedFeatures); } else if (file.getName().endsWith(".java")) { diff --git a/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java b/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java index e8d36f9547c..1671321b467 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,11 +31,10 @@ public class BrowserVersionTest extends WebTestCase { */ @Test public void getBrowserVersionNumeric() { - assertEquals(45, BrowserVersion.FIREFOX_45.getBrowserVersionNumeric()); - assertEquals(52, BrowserVersion.FIREFOX_52.getBrowserVersionNumeric()); + assertEquals(60, BrowserVersion.FIREFOX_60.getBrowserVersionNumeric()); + assertEquals(68, BrowserVersion.FIREFOX_68.getBrowserVersionNumeric()); assertEquals(11, BrowserVersion.INTERNET_EXPLORER.getBrowserVersionNumeric()); - assertEquals(60, BrowserVersion.CHROME.getBrowserVersionNumeric()); - assertEquals(14, BrowserVersion.EDGE.getBrowserVersionNumeric()); + assertEquals(67, BrowserVersion.CHROME.getBrowserVersionNumeric()); } /** @@ -43,7 +42,7 @@ public void getBrowserVersionNumeric() { */ @Test public void testClone() { - final BrowserVersion ff = BrowserVersion.FIREFOX_52; + final BrowserVersion ff = BrowserVersion.INTERNET_EXPLORER; final BrowserVersion clone = new BrowserVersion.BrowserVersionBuilder(ff).build(); // Nickname is used as key for dictionaries storing browser setups diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CacheTest.java b/src/test/java/com/gargoylesoftware/htmlunit/CacheTest.java index b70d86f6565..9007691a3ae 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CacheTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -47,7 +48,8 @@ * @author Ahmed Ashour * @author Frank Danek * @author Anton Demydenko - */ + * @author Ronald Brill +*/ @RunWith(BrowserRunner.class) public class CacheTest extends SimpleWebTestCase { @@ -124,8 +126,10 @@ public void usage() throws Exception { final List headers = new ArrayList<>(); headers.add(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); - connection.setResponse(new URL(URL_FIRST, "foo1.js"), script1, 200, "ok", JAVASCRIPT_MIME_TYPE, headers); - connection.setResponse(new URL(URL_FIRST, "foo2.js"), script2, 200, "ok", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo1.js"), script1, 200, "ok", + MimeType.APPLICATION_JAVASCRIPT, headers); + connection.setResponse(new URL(URL_FIRST, "foo2.js"), script2, 200, "ok", + MimeType.APPLICATION_JAVASCRIPT, headers); final List collectedAlerts = new ArrayList<>(); webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); @@ -179,8 +183,8 @@ public void jsUrlEncoded() throws Exception { final List headers = new ArrayList<>(); headers.add(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); getMockWebConnection().setResponse(new URL(URL_FIRST, "foo1.js"), script1, - 200, "ok", JAVASCRIPT_MIME_TYPE, headers); - getMockWebConnection().setDefaultResponse(script2, 200, "ok", JAVASCRIPT_MIME_TYPE, headers); + 200, "ok", MimeType.APPLICATION_JAVASCRIPT, headers); + getMockWebConnection().setDefaultResponse(script2, 200, "ok", MimeType.APPLICATION_JAVASCRIPT, headers); final WebClient webClient = getWebClientWithMockWebConnection(); @@ -247,8 +251,8 @@ public void cssUrlEncoded() throws Exception { final List headers = new ArrayList<>(); headers.add(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); getMockWebConnection().setResponse(new URL(URL_FIRST, "foo1.js"), "", - 200, "ok", "text/css", headers); - getMockWebConnection().setDefaultResponse("", 200, "ok", "text/css", headers); + 200, "ok", MimeType.TEXT_CSS, headers); + getMockWebConnection().setDefaultResponse("", 200, "ok", MimeType.TEXT_CSS, headers); final WebClient webClient = getWebClientWithMockWebConnection(); @@ -290,8 +294,8 @@ public void maxSizeMaintained() throws Exception { final List headers = Collections.singletonList(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); - connection.setResponse(new URL(URL_FIRST, "foo1.js"), ";", 200, "ok", JAVASCRIPT_MIME_TYPE, headers); - connection.setResponse(new URL(URL_FIRST, "foo2.js"), ";", 200, "ok", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo1.js"), ";", 200, "ok", MimeType.APPLICATION_JAVASCRIPT, headers); + connection.setResponse(new URL(URL_FIRST, "foo2.js"), ";", 200, "ok", MimeType.APPLICATION_JAVASCRIPT, headers); client.getPage(pageUrl); assertEquals(1, client.getCache().getSize()); @@ -323,12 +327,54 @@ public void cssIsCached() throws Exception { final List headers = Collections.singletonList(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); - connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", MimeType.TEXT_CSS, headers); client.getPage(pageUrl); assertEquals(2, client.getCache().getSize()); } + /** + * Check for correct caching if the css request gets redirected. + * + * @throws Exception if the test fails + */ + @Test + public void cssIsCachedIfUrlWasRedirected() throws Exception { + final String html = "page 1\n" + + "\n" + + "\n" + + "x\n" + + ""; + + final String css = ".x { color: red; }"; + + final WebClient client = getWebClient(); + + final MockWebConnection connection = new MockWebConnection(); + client.setWebConnection(connection); + + final URL pageUrl = new URL(URL_FIRST, "page1.html"); + connection.setResponse(pageUrl, html); + + final URL cssUrl = new URL(URL_FIRST, "foo.css"); + final URL redirectUrl = new URL(URL_FIRST, "fooContent.css"); + + List headers = new ArrayList<>(); + headers.add(new NameValuePair("Location", redirectUrl.toExternalForm())); + connection.setResponse(cssUrl, "", 301, "Redirect", null, headers); + + headers = Collections.singletonList(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); + connection.setResponse(redirectUrl, css, 200, "OK", MimeType.TEXT_CSS, headers); + + client.getPage(pageUrl); + client.getPage(pageUrl); + + // page1.html - foo.css - fooContent.css - page1.html + assertEquals(4, connection.getRequestCount()); + // foo.css - fooContent.css + assertEquals(2, client.getCache().getSize()); + } + /** * Test that content retrieved with XHR is cached when right headers are here. * @throws Exception if the test fails @@ -355,7 +401,7 @@ public void xhrContentCached() throws Exception { final List headers = Collections.singletonList(new NameValuePair("Last-Modified", "Sun, 15 Jul 2007 20:46:27 GMT")); - connection.setResponse(new URL(URL_FIRST, "foo.txt"), "hello", 200, "OK", "text/plain", headers); + connection.setResponse(new URL(URL_FIRST, "foo.txt"), "hello", 200, "OK", MimeType.TEXT_PLAIN, headers); loadPageWithAlerts(html); @@ -383,7 +429,7 @@ public void testNoStoreCacheControl() throws Exception { final URL pageUrl = new URL(URL_FIRST, "page1.html"); connection.setResponse(pageUrl, html, 200, "OK", "text/html;charset=ISO-8859-1", headers); - connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", MimeType.APPLICATION_JAVASCRIPT, headers); client.getPage(pageUrl); assertEquals(0, client.getCache().getSize()); @@ -416,7 +462,7 @@ public void testMaxAgeCacheControl() throws Exception { final URL pageUrl = new URL(URL_FIRST, "page1.html"); connection.setResponse(pageUrl, html, 200, "OK", "text/html;charset=ISO-8859-1", headers); - connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", MimeType.APPLICATION_JAVASCRIPT, headers); client.getPage(pageUrl); assertEquals(2, client.getCache().getSize()); @@ -430,6 +476,12 @@ public void testMaxAgeCacheControl() throws Exception { client.getPage(pageUrl); assertEquals(2, client.getCache().getSize()); assertEquals(4, connection.getRequestCount()); + + // wait for max-age seconds + 1 for recache + Thread.sleep(2 * 1000); + client.getCache().clearOutdated(); + assertEquals(0, client.getCache().getSize()); + assertEquals(4, connection.getRequestCount()); } /** @@ -454,7 +506,7 @@ public void testSMaxageCacheControl() throws Exception { final URL pageUrl = new URL(URL_FIRST, "page1.html"); connection.setResponse(pageUrl, html, 200, "OK", "text/html;charset=ISO-8859-1", headers); - connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", MimeType.APPLICATION_JAVASCRIPT, headers); client.getPage(pageUrl); assertEquals(2, client.getCache().getSize()); @@ -468,6 +520,12 @@ public void testSMaxageCacheControl() throws Exception { client.getPage(pageUrl); assertEquals(2, client.getCache().getSize()); assertEquals(4, connection.getRequestCount()); + + // wait for s-maxage seconds + 1 for recache + Thread.sleep(2 * 1000); + client.getCache().clearOutdated(); + assertEquals(0, client.getCache().getSize()); + assertEquals(4, connection.getRequestCount()); } /** @@ -494,7 +552,7 @@ public void testExpiresCacheControl() throws Exception { final URL pageUrl = new URL(URL_FIRST, "page1.html"); connection.setResponse(pageUrl, html, 200, "OK", "text/html;charset=ISO-8859-1", headers); - connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", JAVASCRIPT_MIME_TYPE, headers); + connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", MimeType.APPLICATION_JAVASCRIPT, headers); client.getPage(pageUrl); assertEquals(2, client.getCache().getSize()); @@ -510,6 +568,40 @@ public void testExpiresCacheControl() throws Exception { assertEquals(4, connection.getRequestCount()); } + /** + * @throws Exception if the test fails + */ + @Test + public void testMaxAgeOverrulesExpiresCacheControl() throws Exception { + final String html = "page 1\n" + + "\n" + + "\n" + + "x\n" + + ""; + + final WebClient client = getWebClient(); + + final MockWebConnection connection = new MockWebConnection(); + client.setWebConnection(connection); + + final List headers = new ArrayList<>(); + headers.add(new NameValuePair("Last-Modified", "Tue, 20 Feb 2018 10:00:00 GMT")); + headers.add(new NameValuePair("Expires", "0")); + headers.add(new NameValuePair("Cache-Control", "max-age=20")); + + final URL pageUrl = new URL(URL_FIRST, "page1.html"); + connection.setResponse(pageUrl, html, 200, "OK", "text/html;charset=ISO-8859-1", headers); + connection.setResponse(new URL(URL_FIRST, "foo.css"), "", 200, "OK", MimeType.APPLICATION_JAVASCRIPT, headers); + + client.getPage(pageUrl); + assertEquals(2, client.getCache().getSize()); + assertEquals(2, connection.getRequestCount()); + // resources should be still in cache + client.getPage(pageUrl); + assertEquals(2, client.getCache().getSize()); + assertEquals(2, connection.getRequestCount()); + } + /** * Ensures {@link WebResponse#cleanUp()} is called for overflow deleted entries. * @throws Exception if the test fails @@ -521,6 +613,7 @@ public void cleanUpOverflow() throws Exception { expect(response1.getWebRequest()).andReturn(request1); expectLastCall().atLeastOnce(); expect(response1.getResponseHeaderValue(HttpHeader.CACHE_CONTROL)).andReturn(null); + expect(response1.getResponseHeaderValue(HttpHeader.CACHE_CONTROL)).andReturn(null); expect(response1.getResponseHeaderValue(HttpHeader.LAST_MODIFIED)).andReturn(null); expect(response1.getResponseHeaderValue(HttpHeader.EXPIRES)).andReturn( formatDate(DateUtils.addHours(new Date(), 1))); @@ -530,6 +623,7 @@ public void cleanUpOverflow() throws Exception { expect(response2.getWebRequest()).andReturn(request2); expectLastCall().atLeastOnce(); expect(response2.getResponseHeaderValue(HttpHeader.CACHE_CONTROL)).andReturn(null); + expect(response2.getResponseHeaderValue(HttpHeader.CACHE_CONTROL)).andReturn(null); expect(response2.getResponseHeaderValue(HttpHeader.LAST_MODIFIED)).andReturn(null); expect(response2.getResponseHeaderValue(HttpHeader.EXPIRES)).andReturn( formatDate(DateUtils.addHours(new Date(), 1))); @@ -557,6 +651,7 @@ public void cleanUpOnClear() { expect(response1.getWebRequest()).andReturn(request1); expectLastCall().atLeastOnce(); expect(response1.getResponseHeaderValue(HttpHeader.CACHE_CONTROL)).andReturn(null); + expect(response1.getResponseHeaderValue(HttpHeader.CACHE_CONTROL)).andReturn(null); expect(response1.getResponseHeaderValue(HttpHeader.LAST_MODIFIED)).andReturn(null); expect(response1.getResponseHeaderValue(HttpHeader.EXPIRES)).andReturn( formatDate(DateUtils.addHours(new Date(), 1))); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CodeChecker.java b/src/test/java/com/gargoylesoftware/htmlunit/CodeChecker.java index 289bf4b870f..59c59184dc7 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CodeChecker.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CodeChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ public void codeChecker() throws Exception { private void process(final File dir) throws Exception { for (final File file : dir.listFiles()) { - if (file.isDirectory() && !file.getName().equals(".svn")) { + if (file.isDirectory() && !file.getName().equals(".git")) { process(file); } else { diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CodeStyleTest.java b/src/test/java/com/gargoylesoftware/htmlunit/CodeStyleTest.java index d7c509e20b3..ffee68c637a 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CodeStyleTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CodeStyleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; -import java.util.concurrent.atomic.AtomicBoolean; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -40,37 +39,23 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.tmatesoft.svn.core.SVNDepth; -import org.tmatesoft.svn.core.SVNURL; -import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; -import org.tmatesoft.svn.core.wc.ISVNOptions; -import org.tmatesoft.svn.core.wc.ISVNPropertyHandler; -import org.tmatesoft.svn.core.wc.SVNPropertyData; -import org.tmatesoft.svn.core.wc.SVNRevision; -import org.tmatesoft.svn.core.wc.SVNWCClient; -import org.tmatesoft.svn.core.wc.SVNWCUtil; - -import com.gargoylesoftware.htmlunit.source.SVN; /** * Test of coding style for issues which cannot be detected by Checkstyle. * * @author Ahmed Ashour + * @author Ronald Brill */ public class CodeStyleTest { private static final Pattern leadingWhitespace = Pattern.compile("^\\s+"); private List failures_ = new ArrayList<>(); - private SVNWCClient svnWCClient_; /** * After. */ @After public void after() { - if (svnWCClient_ != null) { - svnWCClient_.getOperationsFactory().getRepositoryPool().dispose(); - } final StringBuilder sb = new StringBuilder(); for (final String error : failures_) { sb.append('\n').append(error); @@ -94,9 +79,6 @@ private void addFailure(final String error) { */ @Test public void codeStyle() throws IOException { - final ISVNOptions options = SVNWCUtil.createDefaultOptions(true); - final ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(); - svnWCClient_ = new SVNWCClient(authManager, options); final List files = new ArrayList<>(); addAll(new File("src/main"), files); addAll(new File("src/test"), files); @@ -128,7 +110,7 @@ private void addAll(final File dir, final List files) throws IOException { final File[] children = dir.listFiles(); if (children != null) { for (final File child : children) { - if (child.isDirectory() && !".svn".equals(child.getName())) { + if (child.isDirectory() && !".git".equals(child.getName())) { addAll(child, files); } else { @@ -141,7 +123,6 @@ private void addAll(final File dir, final List files) throws IOException { private void process(final List files, final List classNames) throws IOException { for (final File file : files) { final String relativePath = file.getAbsolutePath().substring(new File(".").getAbsolutePath().length() - 1); - svnProperties(file, relativePath); if (file.getName().endsWith(".java")) { final List lines = FileUtils.readLines(file, ISO_8859_1); openingCurlyBracket(lines, relativePath); @@ -272,59 +253,6 @@ private void lineBetweenMethods(final List lines, final String relativeP } } - /** - * Checks property {@code svn:eol-style}. - */ - private void svnProperties(final File file, final String relativePath) { - if (!isSvnPropertiesDefined(file)) { - addFailure("'svn:eol-style' property is not defined for " + relativePath); - } - } - - private boolean isSvnPropertiesDefined(final File file) { - try { - final AtomicBoolean eol = new AtomicBoolean(); - svnWCClient_.doGetProperty(file, null, SVNRevision.WORKING, SVNRevision.WORKING, SVNDepth.EMPTY, - new ISVNPropertyHandler() { - - @Override - public void handleProperty(final long revision, final SVNPropertyData property) { - // nothing to do - } - - @Override - public void handleProperty(final SVNURL url, final SVNPropertyData property) { - // nothing to do - } - - @Override - public void handleProperty(final File path, final SVNPropertyData property) { - final String name = property.getName(); - final String value = property.getValue().getString(); - if ("svn:eol-style".equals(name) && "native".equals(value)) { - eol.set(true); - } - } - }, null); - - final String fileName = file.getName().toLowerCase(Locale.ROOT); - - for (final String extension : SVN.getEolExtenstions()) { - if (fileName.endsWith(extension)) { - return eol.get(); - } - } - return true; - } - catch (final Exception e) { - //nothing - } - final String path = file.getAbsolutePath(); - // automatically generated and is outside SVN control - return (path.contains("jQuery") && path.contains("WEB-INF") && path.contains("cgi")) - || (path.contains("jQuery") && path.contains("csp.log")); - } - /** * @throws Exception if an error occurs */ @@ -340,7 +268,7 @@ private void processXML(final File dir, final boolean recursive) throws Exceptio final File[] files = dir.listFiles(); if (files != null) { for (final File file : files) { - if (file.isDirectory() && !".svn".equals(file.getName())) { + if (file.isDirectory() && !".git".equals(file.getName())) { if (recursive) { processXML(file, true); } @@ -643,8 +571,7 @@ private void browserVersion_isIE(final List lines, final String relative && !relativePath.contains("BrowserVersionFeatures.java") && !relativePath.contains("DateTimeFormat.java") && !relativePath.contains("Document.java") - && !relativePath.contains("HTMLDocument2.java") - && !relativePath.contains("NashornJavaScriptEngine.java")) { + && !relativePath.contains("HTMLDocument2.java")) { int index = 1; for (final String line : lines) { if (line.contains(".isIE()")) { @@ -666,7 +593,8 @@ private void browserVersion_isIE(final List lines, final String relative && !relativePath.contains("BrowserConfiguration.java") && !relativePath.contains("BrowserVersion.java") && !relativePath.contains("Document.java") - && !relativePath.contains("HTMLParser.java") + && !relativePath.contains("HtmlUnitNekoDOMBuilder.java") + && !relativePath.contains("HtmlUnitValidatorDOMBuilder.java") && !relativePath.contains("Window.java") && !relativePath.contains("Window2.java")) { int index = 1; @@ -716,27 +644,40 @@ private void className(final List lines, final String relativePath) { if (relativePath.contains("main") && relativePath.contains("host")) { String fileName = relativePath.substring(0, relativePath.length() - 5); fileName = fileName.substring(fileName.lastIndexOf(File.separator) + 1); - if (!fileName.endsWith("2")) { - boolean failureFound = false; - for (final String line : lines) { - if (line.startsWith(" * ")) { - int p0 = line.indexOf("{@code "); - if (p0 != -1) { - p0 = p0 + "{@code ".length(); - final int p1 = line.indexOf('}', p0 + 1); - final String name = line.substring(p0, p1); - if (!name.equals(fileName)) { - failureFound = true; - } + String wrongName = null; + for (final String line : lines) { + if (line.startsWith(" * ")) { + int p0 = line.indexOf("{@code "); + if (p0 != -1) { + p0 = p0 + "{@code ".length(); + final int p1 = line.indexOf('}', p0 + 1); + final String name = line.substring(p0, p1); + if (!name.equals(fileName)) { + wrongName = name; } } - else if (line.startsWith("public class")) { - if (failureFound) { - addFailure("Incorrect host class in " + relativePath); + } + else if (line.startsWith("@JsxClass")) { + int p0 = line.indexOf("className = \""); + if (p0 != -1) { + p0 = p0 + "className = \"".length(); + final int p1 = line.indexOf("\"", p0 + 1); + String name = line.substring(p0, p1); + // JsxClass starts with lower case + if (Character.isLowerCase(name.charAt(0))) { + name = StringUtils.capitalize(name); + if (name.equals(fileName)) { + wrongName = null; + } } - return; } } + else if (line.startsWith("public class")) { + if (wrongName != null) { + addFailure("Incorrect host class '" + wrongName + "' in " + relativePath); + } + return; + } } } } @@ -912,7 +853,7 @@ private void alertVerifyOrder(final String browserName, final List previ break; case "FF": - if (previousList.contains("FF45") || previousList.contains("FF52")) { + if (previousList.contains("FF60") || previousList.contains("FF68")) { addFailure("FF must be before specifc FF version in " + relativePath + ", line: " + (lineIndex + 1)); } @@ -957,8 +898,8 @@ private void indentation(final List lines, final String relativePath) { if (line.startsWith(" CHROME = ") || line.startsWith(" IE = ") || line.startsWith(" FF = ") - || line.startsWith(" FF45 = ") - || line.startsWith(" FF52 = ")) { + || line.startsWith(" FF60 = ") + || line.startsWith(" FF68 = ")) { addFailure("Incorrect indentation in " + relativePath + ", line: " + (i + 2)); } } @@ -989,7 +930,7 @@ private void testTests(final File dir) throws Exception { for (final File file : files) { if (file.isDirectory()) { - if (!".svn".equals(file.getName())) { + if (!".git".equals(file.getName())) { testTests(file); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CookieManager2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/CookieManager2Test.java index 8138ddb5c9a..953bac56a8c 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CookieManager2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CookieManager2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java b/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java index e6f5a9edf8b..6b0c07191e7 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CookieManager3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CookieManager4Test.java b/src/test/java/com/gargoylesoftware/htmlunit/CookieManager4Test.java index b315ebe76df..927f4fb00c4 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CookieManager4Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CookieManager4Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import org.openqa.selenium.WebDriver; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -124,7 +125,7 @@ public void domain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c2=2; Domain=" + DOMAIN + "; Path=/")); responseHeader.add(new NameValuePair("Set-Cookie", "c3=3; Domain=." + DOMAIN + ":" + PORT + "; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final URL firstUrl = new URL(URL_HOST1); loadPageWithAlerts2(firstUrl); @@ -152,7 +153,7 @@ public void storedDomain1() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c12=12; Domain=htmlunit; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final WebDriver driver = loadPageWithAlerts2(new URL(URL_HOST1)); @@ -184,7 +185,7 @@ public void storedDomain2() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c12=12; Domain=htmlunit; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final WebDriver driver = loadPageWithAlerts2(new URL(URL_HOST2)); @@ -214,7 +215,7 @@ public void storedDomain3() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c12=12; Domain=htmlunit; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final WebDriver driver = loadPageWithAlerts2(new URL(URL_HOST3)); @@ -245,7 +246,7 @@ public void storedDomain4() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c12=12; Domain=htmlunit; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final WebDriver driver = loadPageWithAlerts2(new URL(URL_HOST4)); @@ -408,7 +409,7 @@ public void domainDuplicate() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c1=1; Domain=" + DOMAIN + "; Path=/")); responseHeader.add(new NameValuePair("Set-Cookie", "c2=2; Domain=" + DOMAIN + "; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final URL firstUrl = new URL(URL_HOST1); @@ -425,7 +426,7 @@ public void domainDuplicateLeadingDot() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c1=1; Domain=host1." + DOMAIN + "; Path=/")); responseHeader.add(new NameValuePair("Set-Cookie", "c2=2; Domain=.host1." + DOMAIN + "; Path=/")); getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "Ok", - "text/html", responseHeader); + MimeType.TEXT_HTML, responseHeader); final URL firstUrl = new URL(URL_HOST1); @@ -445,7 +446,7 @@ public void domainDuplicateLeadingDotSend() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c1=1; Domain=host1." + DOMAIN + "; Path=/")); responseHeader.add(new NameValuePair("Set-Cookie", "c2=2; Domain=.host1." + DOMAIN + "; Path=/")); - getMockWebConnection().setDefaultResponse(html, 200, "Ok", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(html, 200, "Ok", MimeType.TEXT_HTML, responseHeader); final WebDriver webDriver = getWebDriver(); webDriver.manage().deleteAllCookies(); @@ -474,10 +475,11 @@ public void domainDuplicateLeadingDotRedirect() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c2=2; Domain=.host1." + DOMAIN + "; path=/; expires=Fri, 04-Feb-2022 09:00:32 GMT")); - getMockWebConnection().setDefaultResponse(html, 200, "Ok", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(html, 200, "Ok", MimeType.TEXT_HTML, responseHeader); responseHeader.add(new NameValuePair("Location", URL_HOST1 + "next.html")); - getMockWebConnection().setResponse(new URL(URL_HOST1), "redirect", 301, "Ok", "text/html", responseHeader); + getMockWebConnection().setResponse(new URL(URL_HOST1), "redirect", 301, "Ok", MimeType.TEXT_HTML, + responseHeader); final WebDriver webDriver = getWebDriver(); webDriver.manage().deleteAllCookies(); @@ -514,7 +516,7 @@ public void domain2() throws Exception { getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_HOST1); - getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } @@ -544,7 +546,7 @@ public void domain3() throws Exception { getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_HOST3); - getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } @@ -570,7 +572,7 @@ public void differentHostsSameDomain() throws Exception { getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_HOST1); - getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } @@ -629,7 +631,7 @@ private void testCookies(final URL url, final String cookie1, final String cooki final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", cookie1)); responseHeader.add(new NameValuePair("Set-Cookie", cookie2)); - getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "OK", "text/html", + getMockWebConnection().setDefaultResponse(CookieManagerTest.HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(url); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/CookieManagerTest.java b/src/test/java/com/gargoylesoftware/htmlunit/CookieManagerTest.java index 58cab2c572c..0ba6d03a592 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/CookieManagerTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/CookieManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ */ package com.gargoylesoftware.htmlunit; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; + import java.net.URL; import java.util.ArrayList; import java.util.Date; @@ -29,7 +31,9 @@ import org.openqa.selenium.htmlunit.HtmlUnitDriver; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.html.HtmlPageTest; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -76,7 +80,7 @@ public void comma() throws Exception { final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", "my_key=\"Hello, big, big, world\"")); responseHeader.add(new NameValuePair("Set-Cookie", "yet_another_key=Hi")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(URL_FIRST); } @@ -91,7 +95,7 @@ public void orderFromServer() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c_key=helloC")); responseHeader.add(new NameValuePair("Set-Cookie", "a_key=helloA")); responseHeader.add(new NameValuePair("Set-Cookie", "b_key=helloB")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(URL_FIRST); } @@ -131,7 +135,7 @@ public void emptyCookie() throws Exception { final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", "key1=")); responseHeader.add(new NameValuePair("Set-Cookie", "key2=")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(URL_FIRST); } @@ -144,7 +148,7 @@ public void emptyCookie() throws Exception { public void emptyCookieName() throws Exception { final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", "=value1")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(URL_FIRST); } @@ -161,7 +165,7 @@ public void valueQuoted() throws Exception { final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", "key=value")); responseHeader.add(new NameValuePair("Set-Cookie", "test=\"aa= xx==\"")); - getMockWebConnection().setResponse(URL_FIRST, "", 200, "OK", "text/html", responseHeader); + getMockWebConnection().setResponse(URL_FIRST, "", 200, "OK", MimeType.TEXT_HTML, responseHeader); getMockWebConnection().setDefaultResponse(""); final WebDriver driver = loadPageWithAlerts2(URL_FIRST); @@ -219,7 +223,7 @@ public void unquotedCookieValueIsSentBackUnquotedAsWell() throws Exception { private void ensureCookieValueIsSentBackUnquoted(final String cookie) throws Exception { final List responseHeaders = new ArrayList<>(); responseHeaders.add(new NameValuePair("Set-Cookie", cookie + "; Path=/; Version=1")); - getMockWebConnection().setResponse(URL_FIRST, "", 200, "OK", "text/html", responseHeaders); + getMockWebConnection().setResponse(URL_FIRST, "", 200, "OK", MimeType.TEXT_HTML, responseHeaders); getMockWebConnection().setDefaultResponse(""); final WebDriver driver = loadPageWithAlerts2(URL_FIRST); @@ -237,13 +241,14 @@ private void ensureCookieValueIsSentBackUnquoted(final String cookie) throws Exc public void serverModifiesCookieValue() throws Exception { final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", "nbCalls=1")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(URL_FIRST); final List responseHeader2 = new ArrayList<>(); responseHeader2.add(new NameValuePair("Set-Cookie", "nbCalls=2")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader2); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader2); setExpectedAlerts("nbCalls=2"); loadPageWithAlerts2(URL_FIRST); @@ -257,13 +262,15 @@ public void serverModifiesCookieValue() throws Exception { public void cookie2() throws Exception { final List responseHeader1 = new ArrayList<>(); responseHeader1.add(new NameValuePair("Set-Cookie", "first=1")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); loadPageWithAlerts2(URL_FIRST); final List responseHeader2 = new ArrayList<>(); responseHeader2.add(new NameValuePair("Set-Cookie", "second=2")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader2); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader2); setExpectedAlerts("first=1; second=2"); loadPageWithAlerts2(URL_FIRST); @@ -284,7 +291,8 @@ public void setCookieExpired() throws Exception { "second=2;expires=" + DateUtils.formatDate(aBitLater))); responseHeader1.add(new NameValuePair("Set-Cookie", "visit=fo; expires=\"Sat, 07-Apr-2002 13:11:33 GMT\";")); responseHeader1.add(new NameValuePair("Set-Cookie", "visitor=f2; expires=\"Sat, 07-Apr-2092 13:11:33 GMT\";")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); loadPageWithAlerts2(URL_FIRST); } @@ -303,7 +311,8 @@ public void setCookieExpired_badDateFormat() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "second=2;expires=Dec-1-1994 16:00:00")); responseHeader1.add(new NameValuePair("Set-Cookie", "third=3;expires=Dec-1-2094 16:00:00")); responseHeader1.add(new NameValuePair("Set-Cookie", "fourth=4;expires=1/1/2000; path=/")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); loadPageWithAlerts2(URL_FIRST); } @@ -324,7 +333,8 @@ public void setCookieExpires_twoDigits() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "cookie4=4;expires=Thu 01-Jan-70 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "cookie5=5;expires=Tue 01-Dec-70 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "cookie6=6;expires=Wed 01-Dec-71 16:00:00 GMT")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); loadPageWithAlerts2(URL_FIRST); } @@ -346,7 +356,8 @@ public void setCookieExpires_twoDigits2() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "cookie4=4;expires=Thu,01 Jan 70 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "cookie5=5;expires=Tue,01 Dec 70 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "cookie6=6;expires=Wed,01 Dec 71 16:00:00 GMT")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); loadPageWithAlerts2(URL_FIRST); } @@ -363,7 +374,26 @@ public void cookieExpires_TwoDigits3() throws Exception { final List responseHeader1 = new ArrayList<>(); responseHeader1.add(new NameValuePair("Set-Cookie", "cookie1=1;expires=Sun-01 Dec 68 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "cookie6=6;expires=Wed-01 Dec 71 16:00:00 GMT")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); + + loadPageWithAlerts2(URL_FIRST); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "cookie1=1", + IE = "cookie1=1; cookie2=2") + @NotYetImplemented(IE) + public void cookieExpires_GMT() throws Exception { + final List responseHeader = new ArrayList<>(); + responseHeader.add(new NameValuePair("Set-Cookie", + "cookie1=1;expires=Sun Jan 20 2042 17:45:00 GMT+0800 (CST)")); + responseHeader.add(new NameValuePair("Set-Cookie", + "cookie2=2;expires=Sun Jan 20 2004 17:45:00 GMT+0800 (CST)")); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); loadPageWithAlerts2(URL_FIRST); } @@ -382,7 +412,8 @@ public void cookieExpires_badDateFormat() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "fourth=4;expires=Thu, 01 Dec 42 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "fifth=5;expires=Thu,01-Dec-42 16:00:00 GMT")); responseHeader1.add(new NameValuePair("Set-Cookie", "sixth=6;expires=Thu,01 Dec 42 16:00:00 GMT")); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, + responseHeader1); loadPageWithAlerts2(URL_FIRST); } @@ -442,14 +473,14 @@ public void removeExpiredCookies() throws Exception { final List responseHeader = new ArrayList<>(); responseHeader.add(new NameValuePair("Set-Cookie", "key1=value1")); responseHeader.add(new NameValuePair("Set-Cookie", "key2=value2")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); setExpectedAlerts("key1=value1; key2=value2"); loadPageWithAlerts2(URL_FIRST); responseHeader.clear(); responseHeader.add(new NameValuePair("Set-Cookie", "key1=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT")); responseHeader.add(new NameValuePair("Set-Cookie", "key2=value2")); - getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); setExpectedAlerts("key2=value2"); loadPageWithAlerts2(URL_FIRST); @@ -461,8 +492,7 @@ public void removeExpiredCookies() throws Exception { */ @Test @Alerts(DEFAULT = "first=1; second=2", - IE = "first=1", - EDGE = "first=1") + IE = "first=1") public void setCookieSubPath() throws Exception { final List responseHeader1 = new ArrayList<>(); responseHeader1.add(new NameValuePair("Set-Cookie", "first=1;path=/foo/blah")); @@ -470,7 +500,7 @@ public void setCookieSubPath() throws Exception { responseHeader1.add(new NameValuePair("Location", "/foo/blah/test")); getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE); - getMockWebConnection().setResponse(URL_FIRST, "", 302, "Moved", "text/html", responseHeader1); + getMockWebConnection().setResponse(URL_FIRST, "", 302, "Moved", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(URL_FIRST); } @@ -481,8 +511,7 @@ public void setCookieSubPath() throws Exception { */ @Test @Alerts(DEFAULT = "first=1; second=2", - IE = "first=1", - EDGE = "first=1") + IE = "first=1") public void setCookieDifferentPath() throws Exception { final List responseHeader1 = new ArrayList<>(); responseHeader1.add(new NameValuePair("Set-Cookie", "first=1; path=/foo/blah")); @@ -493,7 +522,7 @@ public void setCookieDifferentPath() throws Exception { getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_FIRST, "/a/b"); - getMockWebConnection().setResponse(firstUrl, "", 302, "Moved", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, "", 302, "Moved", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } @@ -514,7 +543,7 @@ public void setCookieDifferentPathSlashAtEnd() throws Exception { getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_FIRST, "/a/b"); - getMockWebConnection().setResponse(firstUrl, "", 302, "Moved", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, "", 302, "Moved", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } @@ -546,7 +575,7 @@ public void setCookieTimeout() throws Exception { final String expires = DateUtils.formatDate(new Date(System.currentTimeMillis() + 3500)); responseHeader1.add(new NameValuePair("Set-Cookie", "first=1; expires=" + expires + "; path=/foo")); responseHeader1.add(new NameValuePair("Location", "/foo/content.html")); - getMockWebConnection().setResponse(firstUrl, "", 302, "Moved", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, "", 302, "Moved", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl, 25_000); } @@ -563,7 +592,7 @@ public void httpOnly() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "second=2; path=/;")); getMockWebConnection().setDefaultResponse(""); - getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", "text/html", responseHeader); + getMockWebConnection().setResponse(URL_FIRST, HTML_ALERT_COOKIE, 200, "OK", MimeType.TEXT_HTML, responseHeader); final WebDriver driver = loadPageWithAlerts2(URL_FIRST); driver.get(URL_FIRST + "foo"); @@ -606,7 +635,7 @@ public void cookieSetFromJSWithoutPathUsesCurrentLocation() throws Exception { getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_FIRST, "/a/b"); - getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } @@ -631,7 +660,7 @@ public void cookieSetFromJSWithoutPathUsesCurrentLocation2() throws Exception { getMockWebConnection().setDefaultResponse(HTML_ALERT_COOKIE); final URL firstUrl = new URL(URL_FIRST, "/a/b"); - getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", "text/html", responseHeader1); + getMockWebConnection().setResponse(firstUrl, html, 200, "Ok", MimeType.TEXT_HTML, responseHeader1); loadPageWithAlerts2(firstUrl); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider2Test.java index 6d691c1b525..039f4bcd73b 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +17,16 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static org.junit.Assert.fail; +import java.io.StringWriter; import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import org.apache.log4j.AppenderSkeleton; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.spi.LoggingEvent; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.core.Logger; +import org.apache.logging.log4j.core.appender.WriterAppender; +import org.apache.logging.log4j.core.config.Configurator; +import org.apache.logging.log4j.core.layout.PatternLayout; import org.junit.Test; import org.junit.runner.RunWith; @@ -96,66 +98,33 @@ public void basicAuthenticationWrongPassword() throws Exception { */ @Test public void basicAuthentication_singleAuthenticaiton() throws Exception { - final Logger logger = Logger.getLogger("org.apache.http.headers"); + final Logger logger = (Logger) LogManager.getLogger("org.apache.http.headers"); final Level oldLevel = logger.getLevel(); - logger.setLevel(Level.DEBUG); + Configurator.setLevel(logger.getName(), Level.DEBUG); - final InMemoryAppender appender = new InMemoryAppender(); - logger.addAppender(appender); + final StringWriter stringWriter = new StringWriter(); + final PatternLayout layout = PatternLayout.newBuilder().withPattern("%msg%n").build(); + + final WriterAppender writerAppender = WriterAppender.newBuilder().setName("writeLogger").setTarget(stringWriter) + .setLayout(layout).build(); + writerAppender.start(); + + logger.addAppender(writerAppender); try { ((DefaultCredentialsProvider) getWebClient().getCredentialsProvider()).addCredentials("jetty", "jetty"); loadPage("Hi There"); - int unauthorizedCount = 0; - for (final String message : appender.getMessages()) { - if (message.contains("HTTP/1.1 401")) { - unauthorizedCount++; - } - } + int unauthorizedCount = StringUtils.countMatches(stringWriter.toString(), "HTTP/1.1 401"); assertEquals(1, unauthorizedCount); - } - finally { - logger.removeAppender(appender); - logger.setLevel(oldLevel); - } - } - - /** - * An in memory appender, used to save all logged messages in memory. - */ - public static class InMemoryAppender extends AppenderSkeleton { - private List messages_ = new ArrayList<>(); - - /** - * {@inheritDoc} - */ - @Override - protected void append(final LoggingEvent event) { - messages_.add(event.getMessage().toString()); - } - - /** - * Returns the saved messages. - * @return the saved messages - */ - public List getMessages() { - return messages_; - } - - /** - * {@inheritDoc} - */ - @Override - public void close() { + // and again + loadPage("Hi There"); + unauthorizedCount = StringUtils.countMatches(stringWriter.toString(), "HTTP/1.1 401"); + assertEquals(1, unauthorizedCount); } - - /** - * {@inheritDoc} - */ - @Override - public boolean requiresLayout() { - return false; + finally { + logger.removeAppender(writerAppender); + Configurator.setLevel(logger.getName(), oldLevel); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider3Test.java b/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider3Test.java index ed37add1b2e..5d702171fa1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider3Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProviderTest.java b/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProviderTest.java index baeaa549491..a62ee0ea782 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProviderTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/DefaultCredentialsProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreator2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreator2Test.java index b8a1c547adb..94c68324234 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreator2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreator2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ import org.junit.Test; import com.gargoylesoftware.htmlunit.DefaultPageCreator.PageType; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link DefaultPageCreator}. @@ -31,22 +32,22 @@ public class DefaultPageCreator2Test extends WebTestCase { */ @Test public void determinePageType() { - assertEquals(PageType.HTML, DefaultPageCreator.determinePageType("text/html")); + assertEquals(PageType.HTML, DefaultPageCreator.determinePageType(MimeType.TEXT_HTML)); assertEquals(PageType.HTML, DefaultPageCreator.determinePageType("image/svg+xml")); assertEquals(PageType.JAVASCRIPT, DefaultPageCreator.determinePageType("text/javascript")); assertEquals(PageType.JAVASCRIPT, DefaultPageCreator.determinePageType("application/x-javascript")); assertEquals(PageType.JAVASCRIPT, DefaultPageCreator.determinePageType("application/javascript")); - assertEquals(PageType.XML, DefaultPageCreator.determinePageType("text/xml")); + assertEquals(PageType.XML, DefaultPageCreator.determinePageType(MimeType.TEXT_XML)); assertEquals(PageType.XML, DefaultPageCreator.determinePageType("application/xml")); - assertEquals(PageType.XML, DefaultPageCreator.determinePageType("application/xhtml+xml")); + assertEquals(PageType.XML, DefaultPageCreator.determinePageType(MimeType.APPLICATION_XHTML)); assertEquals(PageType.XML, DefaultPageCreator.determinePageType("text/vnd.wap.wml")); assertEquals(PageType.XML, DefaultPageCreator.determinePageType("application/vnd.mozilla.xul+xml")); assertEquals(PageType.XML, DefaultPageCreator.determinePageType("application/vnd.wap.xhtml+xml")); assertEquals(PageType.XML, DefaultPageCreator.determinePageType("application/rdf+xml")); - assertEquals(PageType.TEXT, DefaultPageCreator.determinePageType("text/plain")); + assertEquals(PageType.TEXT, DefaultPageCreator.determinePageType(MimeType.TEXT_PLAIN)); assertEquals(PageType.TEXT, DefaultPageCreator.determinePageType("text/csv")); assertEquals(PageType.TEXT, DefaultPageCreator.determinePageType("text/css")); assertEquals(PageType.TEXT, DefaultPageCreator.determinePageType("text/xhtml")); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreatorTest.java b/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreatorTest.java index a3b65c798b0..52c3cefa413 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreatorTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/DefaultPageCreatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ * * @author Marc Guillemot * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class DefaultPageCreatorTest extends WebServerTestCase { @@ -88,17 +89,18 @@ public static class ContentTypeServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException { response.setContentType(request.getParameter("type")); - final Writer writer = response.getWriter(); - final boolean doctype = request.getParameter("doctype") != null; - if (doctype) { - writer.write(XHTML_DOCTYPE); - } - writer.write("foo"); } - writer.write(">foo"); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/DocumentationTests.java b/src/test/java/com/gargoylesoftware/htmlunit/DocumentationTests.java new file mode 100644 index 00000000000..beb928156bb --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/DocumentationTests.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +/** + * Tests for code from the documentation. + * + * @author Ronald Brill + */ +public class DocumentationTests { + + /** + * See {@link BrowserVersion} class comment. + * @throws Exception if the test fails + */ + @Test + public void binary() throws Exception { + final String applicationName = "APPNAME"; + final String applicationVersion = "APPVERSION"; + final String userAgent = "USERAGENT"; + + final BrowserVersion browser = + new BrowserVersion.BrowserVersionBuilder(BrowserVersion.FIREFOX_68) + .setApplicationName(applicationName) + .setApplicationVersion(applicationVersion) + .setUserAgent(userAgent) + .build(); + + assertEquals(applicationName, browser.getApplicationName()); + assertEquals(applicationVersion, browser.getApplicationVersion()); + assertEquals(userAgent, browser.getUserAgent()); + } +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java b/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java index ac8f424a73b..7d9d645bfc1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import java.io.PrintStream; import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; @@ -37,27 +38,48 @@ public class ErrorOutputChecker implements TestRule { private PrintStream originalErr_; private final ByteArrayOutputStream baos_ = new ByteArrayOutputStream(); private static final Pattern[] PATTERNS = { - Pattern.compile("Starting ChromeDriver " + ExternalTest.CHROME_DRIVER_.replace(".", "\\.") - + "\\.[0-9]+ ?\\(?[0-9a-f]*\\)? on port \\d*\r?\n" - + "Only local connections are allowed\\.\r?\n"), - Pattern.compile(".*Unable to retrieve document state unexpected alert open\r?\n"), - Pattern.compile(".*FirefoxOptions toCapabilities\r?\n"), - Pattern.compile(".*Preferring the firefox binary in these options \\(.*\\)\r?\n"), - Pattern.compile(".*geckodriver.*\r?\n"), - Pattern.compile(".*mozprofile.*\r?\n"), - Pattern.compile(".*Marionette.*\r?\n"), - Pattern.compile(".*\tDEBUG\t.*\r?\n"), - Pattern.compile(".*\taddons\\..*\r?\n"), - Pattern.compile("\\*\\*\\* Blocklist::.*\r?\n"), + // chrome + Pattern.compile("Starting ChromeDriver " + + ExternalTest.CHROME_DRIVER_.replace(".", "\\.") + + " \\(.*\\) on port \\d*\r?\n" + + "Only local connections are allowed\\.\r?\n" + + "Please protect ports used by ChromeDriver and related test " + + "frameworks to prevent access by malicious code\\.\r?\n"), + Pattern.compile(".*\\sorg.openqa.selenium.remote.ProtocolHandshake createSession\r?\n"), + Pattern.compile("INFO(RMATION)?: Detected dialect: W3C\r?\n"), + + // FF68 + Pattern.compile("[0-9]*\\smozrunner::runner\\sINFO\\sRunning command:" + + ".*\\n" + + ".*\\r\\n" + + ".*\\r\\n" + + ".*\\r\\n" + + ".*\\r\\n" + + ".*\\r\\n" + + ".*\\r\\n" + + ".*TLS certificate errors will be ignored for this session\\r\\n"), + + // FF60 + Pattern.compile("[0-9]*\\smozrunner::runner\\sINFO\\sRunning command:" + + ".*\\n.*\\r\\n.*TLS certificate errors will be ignored for this session\\r\\n"), + + Pattern.compile("Unable to read VR Path Registry from .*\\r\\n" + + ".*\\r\\n"), + Pattern.compile("JavaScript warning: .*\\r\\n"), + + // ie Pattern.compile("Started InternetExplorerDriver server \\(\\d\\d\\-bit\\)\r?\n" - + "3\\.8\\.0\\.0\r?\n" + + ExternalTest.IE_DRIVER_.replace(".", "\\.") + "\r?\n" + "Listening on port \\d*\r?\n" + "Only local connections are allowed\r?\n"), - // edge - Pattern.compile(".*Listening on http://localhost:\\d*/ \r\r?\n"), - // edge - Pattern.compile(".*Stopping server.\r\r?\n"), - Pattern.compile(".*ProtocolHandshake createSession\r?\n(INFO|INFORMATION): Detected dialect: .*\r?\n") + + // jetty + Pattern.compile(".*Logging initialized .* to org.eclipse.jetty.util.log.StdErrLog.*\r?\n"), + + // Quercus + Pattern.compile(".*com.caucho.quercus.servlet.QuercusServlet initImpl\r?\n"), + Pattern.compile(".*QuercusServlet starting as QuercusServletImpl\r?\n"), + Pattern.compile(".*Quercus finished initialization in \\d*ms\r?\n") }; /** @@ -92,8 +114,12 @@ private void verifyNoOutput() { if (!output.isEmpty()) { if (output.contains("ChromeDriver")) { - throw new RuntimeException("Outdated ChromeDriver version: " + output); + throw new RuntimeException("Outdated Chrome driver version: " + output); + } + if (output.contains("geckodriver")) { + throw new RuntimeException("Outdated Gecko driver version: " + output); } + output = StringUtils.replaceEach(output, new String[] {"\n", "\r"}, new String[]{"\\n", "\\r"}); throw new RuntimeException("Test has produced output to System.err: " + output); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputCheckerTest.java b/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputCheckerTest.java index ff17e85d07f..54ebd7fd9c7 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputCheckerTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputCheckerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java b/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java index a301b19129d..07d97196244 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,29 +18,30 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeNotNull; import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.Calendar; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; +import org.junit.Assert; import org.junit.Test; +import com.gargoylesoftware.htmlunit.html.DomNode; +import com.gargoylesoftware.htmlunit.html.DomNodeList; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlTable; -import com.gargoylesoftware.htmlunit.html.HtmlTableCell; import com.gargoylesoftware.htmlunit.xml.XmlPage; /** - * Tests against external websites, this should be done once every while. + * Tests against external web sites, this should be done once every while. * * @author Ahmed Ashour * @author Ronald Brill @@ -48,7 +49,22 @@ public class ExternalTest { /** Chrome driver. */ - static String CHROME_DRIVER_ = "2.38"; + static String CHROME_DRIVER_ = "79.0.3945.36"; + static String CHROME_DRIVER_URL_ = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_79"; + + /** Gecko driver. */ + static String GECKO_DRIVER_ = "0.26.0"; + /** IE driver. */ + static String IE_DRIVER_ = "3.14.0.0"; + + /** + * Tests the current environment matches the expected setup. + * @throws Exception if an error occurs + */ + @Test + public void testEnvironment() throws Exception { + assertEquals("en_US", Locale.getDefault().toString()); + } /** * Tests that POM dependencies are the latest. @@ -59,35 +75,44 @@ public class ExternalTest { */ @Test public void pom() throws Exception { - if (isDifferentWeek()) { - final Map properties = new HashMap<>(); - final List lines = FileUtils.readLines(new File("pom.xml"), ISO_8859_1); - for (int i = 0; i < lines.size(); i++) { - final String line = lines.get(i); - if (line.trim().equals("")) { - processProperties(lines, i + 1, properties); - } - if (line.contains("artifactId") && !line.contains(">htmlunit<")) { - final String artifactId = getValue(line); - final String groupId = getValue(lines.get(i - 1)); - if (!lines.get(i + 1).contains("")) { - String version = getValue(lines.get(i + 1)); - if (version.startsWith("${")) { - version = properties.get(version.substring(2, version.length() - 1)); - } + final Map properties = new HashMap<>(); + final List lines = FileUtils.readLines(new File("pom.xml"), ISO_8859_1); + + final List wrongVersions = new LinkedList(); + for (int i = 0; i < lines.size(); i++) { + final String line = lines.get(i); + if (line.trim().equals("")) { + processProperties(lines, i + 1, properties); + } + if (line.contains("artifactId") && !line.contains(">htmlunit<")) { + final String artifactId = getValue(line); + final String groupId = getValue(lines.get(i - 1)); + if (!lines.get(i + 1).contains("")) { + String version = getValue(lines.get(i + 1)); + if (version.startsWith("${")) { + version = properties.get(version.substring(2, version.length() - 1)); + } + try { assertVersion(groupId, artifactId, version); } + catch (final AssertionError e) { + wrongVersions.add(e.getMessage()); + } } } - assertVersion("org.sonatype.oss", "oss-parent", "9"); - assertChromeDriver(); } + + if (wrongVersions.size() > 0) { + Assert.fail(String.join("\n ", wrongVersions)); + } + + assertVersion("org.sonatype.oss", "oss-parent", "9"); } private static void processProperties(final List lines, int i, final Map map) { for ( ; i < lines.size(); i++) { final String line = lines.get(i).trim(); - if (!line.startsWith("", "", "", "", ""}) + IE = {"", "", "", "", ""}) public void xml() throws Exception { final String test = // empty - "alert(comment.xml);\n" + "var txt = comment.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" // blank + "comment = root.childNodes[1];\n" - + "alert(comment.xml);\n" + + "txt = comment.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" // normal + "comment = root.childNodes[2];\n" - + "alert(comment.xml);\n" + + "txt = comment.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" // linebreak + "comment = root.childNodes[3];\n" - + "alert(comment.xml);\n" + + "txt = comment.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" // space + "comment = root.childNodes[4];\n" - + "alert(comment.xml);\n"; + + "txt = comment.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n"; final String xml = "" + "" @@ -711,7 +727,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument2Test.java index 550f40be0c8..78b4598371d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import java.net.URL; @@ -31,6 +31,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMDocument}. @@ -91,7 +92,7 @@ public void load() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -125,7 +126,7 @@ public void load_relativeURL() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -195,7 +196,7 @@ public void selectNodes() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -225,7 +226,7 @@ public void selectNodes_caseSensitive() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -262,7 +263,7 @@ public void selectNodes_namespace() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -296,7 +297,7 @@ public void selectNodes_nextNodeAndReset() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -329,7 +330,7 @@ public void selectNodes_fromRoot() throws Exception { final String xml = "ImmortalityJohn Smith"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -447,7 +448,7 @@ public void moveChildBetweenDocuments() throws Exception { final String xml = "</book><cd/><dvd/></order>"; - getMockWebConnection().setResponse(new URL(URL_FIRST, "foo.xml"), xml, "text/xml"); + getMockWebConnection().setResponse(new URL(URL_FIRST, "foo.xml"), xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -480,7 +481,7 @@ public void getElementsByTagName() throws Exception { + " </books>\n" + "</soap:Envelope>"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -513,7 +514,7 @@ public void getElementsByTagNameWithNamespace() throws Exception { + " </books>\n" + "</soap:Envelope>"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -547,7 +548,7 @@ public void xpathWithNamespaces() throws Exception { + " </books>\n" + "</soap:Envelope>"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -586,7 +587,7 @@ public void selectionNamespaces() throws Exception { + " </books>\n" + "</soap:Envelope>"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -613,7 +614,7 @@ public void nodeFromID() throws Exception { + " </body>\n" + "</html>"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument3Test.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument3Test.java index 4260270683d..b823acb1000 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument3Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocument3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.SERIALIZE_XMLDOMDOCUMENT_TO_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callSerializeXMLDOMDocumentToString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.SERIALIZE_XMLDOMDOCUMENT_TO_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callSerializeXMLDOMDocumentToString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragmentTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragmentTest.java index f805e0c270a..d86a8d0b570 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragmentTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentFragmentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,12 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +27,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMDocumentFragment}. @@ -393,12 +394,15 @@ public void xml() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = "child-text\r\n") + IE = "child-text\\r\\n") public void xml_lineBreak() throws Exception { final String test = "var text = doc.createTextNode('child-text\\n');\n" + "fragment.appendChild(text);\n" - + "alert(fragment.xml);\n"; + + "var txt = fragment.xml;\n" + + "txt = txt.replace('\\r', '\\\\r');\n" + + "txt = txt.replace('\\n', '\\\\n');\n" + + "alert(txt);\n"; tester(test); } @@ -452,7 +456,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTest.java index 7ce31dc4991..f0713154eb1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +15,15 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION_NAME; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION_NAME; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +32,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMDocument}. @@ -290,7 +291,7 @@ public void documentElement() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"true", "<new/>\r\n"}) + IE = {"true", "<new/>\\r\\n"}) public void documentElement_replaceExisting() throws Exception { final String test = "" + "doc.documentElement = doc.createElement('foo');\n" @@ -298,7 +299,10 @@ public void documentElement_replaceExisting() throws Exception { + "var element = doc.createElement('new');\n" + "doc.documentElement = element;\n" + "alert(doc.documentElement === element);\n" - + "alert(doc.xml);\n"; + + "var txt = doc.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n"; tester_create(test); } @@ -792,8 +796,8 @@ public void prefix() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"false", "<root><test><element/></test></root>\r\n", - "true", "<root><test><element/></test></root>\r\n"}) + IE = {"false", "<root><test><element/></test></root>\\r\\n", + "true", "<root><test><element/></test></root>\\r\\n"}) public void preserveWhiteSpace() throws Exception { final String test = "" + "doc.documentElement = doc.createElement('root');\n" @@ -803,12 +807,18 @@ public void preserveWhiteSpace() throws Exception { + "test.appendChild(element);\n" + "try {\n" + " alert(doc.preserveWhiteSpace);\n" - + " alert(doc.xml);\n" + + " var txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception1'); }\n" + "try {\n" + " doc.preserveWhiteSpace = true;\n" + " alert(doc.preserveWhiteSpace);\n" - + " alert(doc.xml);\n" + + " txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception2'); }\n"; tester_create(test); @@ -819,10 +829,10 @@ public void preserveWhiteSpace() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"false", "false", "<root>\r\n\t<test>\r\n\t\t<element/>\r\n\t</test>\r\nA B C\tD\r\n</root>\r\n", - "false", "true", "<root>\r\n\t<test>\r\n\t\t<element/>\r\n\t</test>\r\nA B C\tD\r\n</root>\r\n", - "true", "false", "<root>\r\n<test>\r\n <element/>\r\n</test>\r\nA B C\tD\r\n</root>\r\n", - "true", "true", "<root>\r\n<test>\r\n <element/>\r\n</test>\r\nA B C\tD\r\n</root>\r\n"}) + IE = {"false", "false", "<root>\\r\\n\t<test>\\r\\n\t\t<element/>\\r\\n\t</test>\\r\\nA B C\tD\\r\\n</root>\\r\\n", + "false", "true", "<root>\\r\\n\t<test>\\r\\n\t\t<element/>\\r\\n\t</test>\\r\\nA B C\tD\\r\\n</root>\\r\\n", + "true", "false", "<root>\\r\\n<test>\\r\\n <element/>\\r\\n</test>\\r\\nA B C\tD\\r\\n</root>\\r\\n", + "true", "true", "<root>\\r\\n<test>\\r\\n <element/>\\r\\n</test>\\r\\nA B C\tD\\r\\n</root>\\r\\n"}) public void preserveWhiteSpace_load() throws Exception { final String test = "" + "doc.async = false;\n" @@ -831,7 +841,10 @@ public void preserveWhiteSpace_load() throws Exception { + " alert(doc.preserveWhiteSpace);\n" + " doc.load('" + URL_SECOND + "');\n" + " alert(doc.preserveWhiteSpace);\n" - + " alert(doc.xml);\n" + + " var txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception1'); }\n" // read false, write true + "try {\n" @@ -839,7 +852,10 @@ public void preserveWhiteSpace_load() throws Exception { + " doc.load('" + URL_SECOND + "');\n" + " doc.preserveWhiteSpace = true;\n" + " alert(doc.preserveWhiteSpace);\n" - + " alert(doc.xml);\n" + + " txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception2'); }\n" // read true, write false + "try {\n" @@ -847,7 +863,10 @@ public void preserveWhiteSpace_load() throws Exception { + " doc.load('" + URL_SECOND + "');\n" + " doc.preserveWhiteSpace = false;\n" + " alert(doc.preserveWhiteSpace);\n" - + " alert(doc.xml);\n" + + " txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception2'); }\n" // read true, write true + "try {\n" @@ -855,7 +874,10 @@ public void preserveWhiteSpace_load() throws Exception { + " alert(doc.preserveWhiteSpace);\n" + " doc.load('" + URL_SECOND + "');\n" + " alert(doc.preserveWhiteSpace);\n" - + " alert(doc.xml);\n" + + " txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception2'); }\n"; final String xml @@ -866,7 +888,7 @@ public void preserveWhiteSpace_load() throws Exception { + "A B C\tD\n" + "</root>"; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); tester_create(test); } @@ -979,7 +1001,7 @@ public void url_relative() throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse("<root/>", "text/xml"); + getMockWebConnection().setDefaultResponse("<root/>", MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -1009,12 +1031,19 @@ public void url_created() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"", "<foo/>\r\n"}) + IE = {"", "<foo/>\\r\\n"}) public void xml() throws Exception { final String test = "" - + "alert(doc.xml);\n" + + "var txt = doc.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" + + "doc.documentElement = doc.createElement('foo');\n" - + "alert(doc.xml);\n"; + + "txt = doc.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n"; tester_create(test); } @@ -1817,14 +1846,17 @@ public void insertBefore_xmlDeclaration() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"", "<foo><bar/></foo>\r\n", "foo"}) + IE = {"", "<foo><bar/></foo>\\r\\n", "foo"}) public void loadXML() throws Exception { final String test = "" + "var text='<foo><bar/></foo>';\n" + "doc.async = false;\n" + "alert(doc.xml);\n" + "doc.loadXML(text);\n" - + "alert(doc.xml);\n" + + "var txt = doc.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" + "alert(doc.documentElement.nodeName);\n"; tester_create(test); @@ -1835,15 +1867,23 @@ public void loadXML() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"<myns:foo xmlns:myns=\"http://myNS\"/>\r\n", "myns:foo"}) + IE = {"<myns:foo xmlns:myns=\"http://myNS\"/>\\r\\n", "myns:foo"}) public void loadXML_namespace() throws Exception { final String html = "" + " function test() {\n" + ACTIVEX_CHECK + " var text='<myns:foo xmlns:myns=\"http://myNS\"/>';\n" + " var doc = " + callLoadXMLDOMDocumentFromString("text") + ";\n" - + " alert(doc.xml);\n" - + " alert(doc.documentElement.nodeName);\n" + + + " var txt = doc.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + + + " txt = doc.documentElement.nodeName;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; @@ -1893,7 +1933,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTypeTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTypeTest.java index 9350193c825..82c0c293c41 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTypeTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMDocumentTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,10 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +27,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMDocumentType}. @@ -302,7 +303,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElementTest.java index 632572de81c..e6c095e55ef 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,12 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +27,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMElement}. @@ -654,12 +655,12 @@ public void xml() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = "<root child-attribute=\"test\">\r\n" - + "\t<![CDATA[child-cdata]]>\r\n" - + "\t<!--child-comment-->\r\n" - + "\t<child-element/>\r\n" - + "\t<child-element2><grand-child-element/></child-element2>\r\n" - + "child-text\r\n" + IE = "<root child-attribute=\"test\">\\r\\n" + + "\t<![CDATA[child-cdata]]>\\r\\n" + + "\t<!--child-comment-->\\r\\n" + + "\t<child-element/>\\r\\n" + + "\t<child-element2><grand-child-element/></child-element2>\\r\\n" + + "child-text\\r\\n" + "</root>") public void xml_lineBreak() throws Exception { final String xml = "" @@ -671,7 +672,12 @@ public void xml_lineBreak() throws Exception { + "child-text\n" + "</root>"; - tester("alert(root.xml);\n", xml); + final String tester = + "var txt = root.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n"; + tester(tester, xml); } /** @@ -1391,7 +1397,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -1415,7 +1421,7 @@ public void removeChild() throws Exception { final String xml = "<books><book><title>ImmortalityJohn Smith"; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -1441,7 +1447,7 @@ public void selectNode_root() throws Exception { final String xml = "ImmortalityJohn Smith"; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } @@ -1472,7 +1478,7 @@ public void selectNodes() throws Exception { + " \n" + ""; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementationTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementationTest.java index a1c438627ea..232be2e91d7 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementationTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMImplementationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMapTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMapTest.java index 79fdea09cf2..d7b4077c261 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMapTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNamedNodeMapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -25,6 +25,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMNamedNodeMap}. @@ -323,7 +324,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeListTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeListTest.java index 06cbfbee92a..1929cdd3c46 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeListTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMNodeListTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -24,6 +24,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMNodeList}. @@ -238,7 +239,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseErrorTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseErrorTest.java index ae95224492b..7308c83b417 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseErrorTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMParseErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ */ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +29,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMParseError}. @@ -161,7 +162,7 @@ public void parseError_load() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstructionTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstructionTest.java index 0d0032edad1..fd617b7399a 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstructionTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMProcessingInstructionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,12 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +29,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMProcessingInstruction}. @@ -757,7 +758,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMTextTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMTextTest.java index ee50807d618..f040c548754 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMTextTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLDOMTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,12 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +29,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XMLDOMText}. @@ -433,17 +434,26 @@ public void text() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"text", "text\r\ntext", " text text "}) + IE = {"text", "text\\r\\ntext", " text text "}) public void xml() throws Exception { final String test = // text - "alert(text.firstChild.xml);\n" + "var txt = text.firstChild.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" // linebreak + "text = text.nextSibling;\n" - + "alert(text.firstChild.xml);\n" + + "txt = text.firstChild.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n" // space + "text = text.nextSibling;\n" - + "alert(text.firstChild.xml);\n"; + + "var txt = text.firstChild.xml;\n" + + "txt = txt.replace(/\\r/g, '\\\\r');\n" + + "txt = txt.replace(/\\n/g, '\\\\n');\n" + + "alert(txt);\n"; final String xml = "" + "" @@ -766,7 +776,7 @@ private void tester(final String test, final String xml) throws Exception { + " }\n" + LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequestTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequestTest.java index 250afb2d0c3..7e1397a2765 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequestTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLHTTPRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,11 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLHTTPREQUEST_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLHTTPREQUEST_FUNCTION_NAME; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLHTTPRequest; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLHTTPREQUEST_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLHTTPREQUEST_FUNCTION_NAME; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLHTTPRequest; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import static java.nio.charset.StandardCharsets.UTF_8; import java.io.IOException; @@ -35,16 +35,18 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; -import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; +import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.WebDriverTestCase; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequestTest.BasicAuthenticationServlet; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -56,6 +58,14 @@ @RunWith(BrowserRunner.class) public class XMLHTTPRequestTest extends WebDriverTestCase { + /** + * Closes the real IE; otherwise tests are failing because of cached responses. + */ + @After + public void shutDownRealBrowsersAfter() { + shutDownRealIE(); + } + /** * @throws Exception if the test fails */ @@ -106,6 +116,7 @@ private void createRequest(final String activeXName) throws Exception { + " function " + CREATE_XMLHTTPREQUEST_FUNCTION_NAME + "() {\n" + " return new ActiveXObject('" + activeXName + "');\n" + " }\n"; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPageWithAlerts2(createTestHTML(html)); } @@ -187,6 +198,7 @@ public void onreadystatechange_async() throws Exception { // send + "xhr.send();\n" + "alert('sent 1');\n"; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); tester(test); } @@ -287,7 +299,7 @@ public void responseText_contentTypeText() throws Exception { + " }\n" + CREATE_XMLHTTPREQUEST_FUNCTION; - getMockWebConnection().setResponse(URL_SECOND, "", "text/plain"); + getMockWebConnection().setResponse(URL_SECOND, "", MimeType.TEXT_PLAIN); loadPageWithAlerts2(createTestHTML(html)); } @@ -343,7 +355,7 @@ public void responseText_defaultEncodingIsUTF8() throws Exception { final String response = "ol\u00E9"; final byte[] responseBytes = response.getBytes(UTF_8); - getMockWebConnection().setResponse(URL_SECOND, responseBytes, 200, "OK", "text/plain", + getMockWebConnection().setResponse(URL_SECOND, responseBytes, 200, "OK", MimeType.TEXT_PLAIN, new ArrayList()); loadPageWithAlerts2(createTestHTML(html)); } @@ -355,9 +367,9 @@ public void responseText_defaultEncodingIsUTF8() throws Exception { @Alerts(DEFAULT = "no ActiveX", IE = {"exception-created", "", - "\r\n", + "\\r\\n", "", - "\r\n"}) + "\\r\\n"}) public void responseXML_sync() throws Exception { property_lifecycleSync("responseXML.xml"); } @@ -367,7 +379,7 @@ public void responseXML_sync() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"1:", "1:", "2:", "3:", "4:\r\n"}) + IE = {"1:", "1:", "2:", "3:", "4:\\r\\n"}) public void responseXML_async() throws Exception { property_lifecycleAsync("responseXML.xml"); } @@ -420,7 +432,7 @@ public void responseXML_contentTypeText() throws Exception { + " }\n" + CREATE_XMLHTTPREQUEST_FUNCTION; - getMockWebConnection().setResponse(URL_SECOND, "", "text/plain"); + getMockWebConnection().setResponse(URL_SECOND, "", MimeType.TEXT_PLAIN); loadPageWithAlerts2(createTestHTML(html)); } @@ -429,7 +441,7 @@ public void responseXML_contentTypeText() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = "\r\n") + IE = "\\r\\n") public void responseXML_contentTypeApplicationXML() throws Exception { final String html = "" + " var xhr;\n" @@ -440,7 +452,10 @@ public void responseXML_contentTypeApplicationXML() throws Exception { + " xhr.open(\"GET\", \"" + URL_SECOND + "\", false);\n" + " xhr.send();\n" + " try {\n" - + " alert(xhr.responseXML.xml);\n" + + " var txt = xhr.responseXML.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + " } catch(e) { alert('exception-xml'); }\n" + " } catch(e) { alert('exception'); }\n" + " }\n" @@ -456,7 +471,7 @@ public void responseXML_contentTypeApplicationXML() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = "ol\u00E9\r\n") + IE = "ol\u00E9\\r\\n") public void responseXML_defaultEncodingIsUTF8() throws Exception { final String html = "" + " var xhr;\n" @@ -467,7 +482,10 @@ public void responseXML_defaultEncodingIsUTF8() throws Exception { + " xhr.open('GET', '" + URL_SECOND + "', false);\n" + " xhr.send();\n" + " try {\n" - + " alert(xhr.responseXML.xml);\n" + + " var txt = xhr.responseXML.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + " } catch(e) { alert('exception-xml'); }\n" + " } catch(e) { alert('exception'); }\n" + " }\n" @@ -476,7 +494,7 @@ public void responseXML_defaultEncodingIsUTF8() throws Exception { final String response = "ol\u00E9"; final byte[] responseBytes = response.getBytes(UTF_8); - getMockWebConnection().setResponse(URL_SECOND, responseBytes, 200, "OK", "text/xml", + getMockWebConnection().setResponse(URL_SECOND, responseBytes, 200, "OK", MimeType.TEXT_XML, new ArrayList()); loadPageWithAlerts2(createTestHTML(html)); } @@ -579,7 +597,7 @@ public void abort_opened() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"4:200 \r\n", + IE = {"4:200 \\r\\n", "0:ex status ex text ex xml"}) public void abort_sentSync() throws Exception { final String test = "" @@ -626,9 +644,9 @@ public void abort_sentAsync() throws Exception { @Alerts(DEFAULT = "no ActiveX", IE = {"exception-created", "exception-opened", - "Date XYZ GMT\r\n" - + "Content-Type: text/xml;charset=iso-8859-1\r\n" - + "Transfer-Encoding: chunked\r\nServer: Jetty(XXX)\r\n\r\n"}) + "Date XYZ GMT\\r\\n" + + "Content-Type: text/xml;charset=iso-8859-1\\r\\n" + + "Transfer-Encoding: chunked\\r\\nServer: Jetty(XXX)\\r\\n\\r\\n"}) public void getAllResponseHeaders() throws Exception { final String test = "" // create @@ -643,8 +661,12 @@ public void getAllResponseHeaders() throws Exception { // send + "xhr.send();\n" + "try {\n" - + " alert(xhr.getAllResponseHeaders().replace(/Jetty\\(.*\\)/, 'Jetty(XXX)')" - + ".replace(/Date.*GMT/, 'Date XYZ GMT'));\n" + + " var txt = xhr.getAllResponseHeaders();\n" + + " txt = txt.replace(/Jetty\\(.*\\)/, 'Jetty(XXX)');\n" + + " txt = txt.replace(/Date.*GMT/, 'Date XYZ GMT');\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception-sent'); }\n"; tester(test, ""); @@ -1227,7 +1249,8 @@ public void send_headersDefaultBody() throws Exception { @Test @Alerts(DEFAULT = {"null", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "null", "null", "no ActiveX"}, - CHROME = {"null", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", + CHROME = {"null", "text/html,application/xhtml+xml,application/xml;" + + "q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "null", "null", "no ActiveX"}, IE = {"bar", "application/javascript", @@ -1331,27 +1354,42 @@ private void property_lifecycleSync(final String property) throws Exception { final String test = "" // create + "try {\n" - + " alert(xhr." + property + ");\n" + + " var txt = '' + xhr." + property + ";\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception-created'); }\n" // open + "xhr.open(\"GET\", \"" + URL_SECOND + "\", false);\n" + "try {\n" - + " alert(xhr." + property + ");\n" + + " txt = '' + xhr." + property + ";\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception-opened'); }\n" // send + "xhr.send();\n" + "try {\n" - + " alert(xhr." + property + ");\n" + + " txt = '' + xhr." + property + ";\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception-sent'); }\n" // re-open + "xhr.open(\"GET\", \"" + URL_SECOND + "\", false);\n" + "try {\n" - + " alert(xhr." + property + ");\n" + + " txt = '' + xhr." + property + ";\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception-reopened'); }\n" // send + "xhr.send();\n" + "try {\n" - + " alert(xhr." + property + ");\n" + + " txt = '' + xhr." + property + ";\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + "} catch(e) { alert('exception-sent'); }\n"; tester(test); @@ -1361,7 +1399,10 @@ private void property_lifecycleAsync(final String property) throws Exception { final String test = "" + "xhr.onreadystatechange = function() {\n" + " try {\n" - + " alert(xhr.readyState + ':' + xhr." + property + ");\n" + + " var txt = xhr.readyState + ':' + xhr." + property + ";\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " alert(txt);\n" + " } catch(e) { alert(xhr.readyState + ':exception-async'); }\n" + "};\n" // open @@ -1402,14 +1443,17 @@ private void tester(final String test, final String xml) throws Exception { + " msg += ' ' + r.responseText;\n" + " } catch(e) { msg += ' ex text'; }\n" + " try {\n" - + " msg += ' ' + r.responseXML.xml;\n" + + " var txt = r.responseXML.xml;\n" + + " txt = txt.replace(/\\r/g, '\\\\r');\n" + + " txt = txt.replace(/\\n/g, '\\\\n');\n" + + " msg += ' ' + txt;\n" + " } catch(e) { msg += ' ex xml'; }\n" + " alert(msg);\n" + " }\n" + CREATE_XMLHTTPREQUEST_FUNCTION; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); - loadPageWithAlerts2(createTestHTML(html), URL_FIRST, 6 * DEFAULT_WAIT_TIME); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); + loadPageWithAlerts2(createTestHTML(html), URL_FIRST, 10 * DEFAULT_WAIT_TIME); } private void tester_bounce(final String test) throws Exception { @@ -1443,7 +1487,7 @@ private void tester_bounce(final String test) throws Exception { final Map> servlets = new HashMap<>(); servlets.put("/bounce", BounceServlet.class); - loadPageWithAlerts2(createTestHTML(html), servlets); + loadPageWithAlerts2(createTestHTML(html), URL_FIRST, DEFAULT_WAIT_TIME * 2, servlets); } /** diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializerTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializerTest.java index cb5ceb1e6ec..343eb0be3ba 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializerTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XMLSerializerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,14 +15,14 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.CREATE_XMLDOMDOCUMENT_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.SERIALIZE_XMLDOMDOCUMENT_TO_STRING_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callCreateXMLDOMDocument; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callSerializeXMLDOMDocumentToString; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.CREATE_XMLDOMDOCUMENT_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.SERIALIZE_XMLDOMDOCUMENT_TO_STRING_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callCreateXMLDOMDocument; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callSerializeXMLDOMDocumentToString; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import org.junit.Test; import org.junit.runner.RunWith; @@ -54,8 +54,8 @@ public class XMLSerializerTest extends WebDriverTestCase { IE = {}) public void test() throws Exception { final String expectedString = getExpectedAlerts().length != 0 ? "" - : "13109Tove13109Jani13109Do32not32forget32me32this32weekend!" - + "13109131099Some32Value13101310"; + : "\\r\\n9Tove\\r\\n9Jani\\r\\n9Do32not32forget32me32this32weekend!" + + "\\r\\n9\\r\\n99Some32Value\\r\\n\\r\\n"; final String serializationText = " " @@ -79,7 +79,7 @@ public void test() throws Exception { @Alerts(DEFAULT = "no ActiveX", IE = {}) public void comment() throws Exception { - final String expectedString = getExpectedAlerts().length != 0 ? "" : "1310"; + final String expectedString = getExpectedAlerts().length != 0 ? "" : "\\r\\n"; final String serializationText = ""; final WebDriver driver = loadPageWithAlerts2(constructPageContent(serializationText)); @@ -94,7 +94,7 @@ public void comment() throws Exception { @Alerts(DEFAULT = "no ActiveX", IE = {}) public void xmlEntities() throws Exception { - final String expectedString = getExpectedAlerts().length != 0 ? "" : "<>&1310"; + final String expectedString = getExpectedAlerts().length != 0 ? "" : "<>&\\r\\n"; final String serializationText = "<>&"; final WebDriver driver = loadPageWithAlerts2(constructPageContent(serializationText)); final WebElement textArea = driver.findElement(By.id("myTextArea")); @@ -111,19 +111,19 @@ public void xmlEntities() throws Exception { // so far we are not able to add the XML header public void nameSpaces() throws Exception { final String expectedString = getExpectedAlerts().length != 0 ? "" - : "131013109131099" - + "131099913109991310991310913101310"; + : "\\r\\n\\r\\n9\\r\\n99" + + "\\r\\n999\\r\\n999\\r\\n99\\r\\n9\\r\\n\\r\\n"; final String serializationText = - "\\n" - + "\\n" - + " \\n" - + " \\n" - + " \\n" - + " \\n" - + " \\n" - + " \\n" + "\\r\\n" + + "\\r\\n" + + " \\r\\n" + + " \\r\\n" + + " \\r\\n" + + " \\r\\n" + + " \\r\\n" + + " \\r\\n" + ""; final WebDriver driver = loadPageWithAlerts2(constructPageContent(serializationText)); @@ -140,7 +140,7 @@ public void nameSpaces() throws Exception { public void attributes() throws Exception { final String expectedString = getExpectedAlerts().length != 0 ? "" : "" - + "1310"; + + "\\r\\n"; final String serializationText = "" + "" @@ -163,12 +163,12 @@ public void attributes() throws Exception { // so far we are not able to add the XML header public void htmlAttributes() throws Exception { final String expectedString = getExpectedAlerts().length != 0 ? "" - : "1310" + : "\\r\\n" + "html" + "" + "foo" + "" - + "1310"; + + "\\r\\n"; final String serializationText = "" + "" @@ -220,7 +220,7 @@ private static String constructPageContent(final String serializationText) { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = {"\r\n", ""}) + IE = {"\\r\\n", ""}) public void document() throws Exception { final String html = " function test() {\n" + ACTIVEX_CHECK @@ -268,7 +268,7 @@ public void xml() throws Exception { */ @Test @Alerts(DEFAULT = "no ActiveX", - IE = "\r\n") + IE = "\\r\\n") public void namespace() throws Exception { final String html = " function test() {\n" + ACTIVEX_CHECK diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor2Test.java index 978ce1da87f..dffcada96c9 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessor2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessorTest.java b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessorTest.java index df327a0b88c..bd29d46779c 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessorTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/activex/javascript/msxml/XSLProcessorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,10 @@ package com.gargoylesoftware.htmlunit.activex.javascript.msxml; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.ACTIVEX_CHECK; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.callLoadXMLDOMDocumentFromURL; -import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestUtil.createTestHTML; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.ACTIVEX_CHECK; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.LOAD_XMLDOMDOCUMENT_FROM_URL_FUNCTION; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromURL; +import static com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.createTestHTML; import java.net.URL; @@ -29,6 +29,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link XSLProcessor}. @@ -83,7 +84,7 @@ public void methods() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xsl, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xsl, MimeType.TEXT_XML); loadPageWithAlerts2(html); } @@ -149,8 +150,8 @@ public void transform() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_SECOND, xml, "text/xml"); - getMockWebConnection().setResponse(urlThird, xsl, "text/xml"); + getMockWebConnection().setResponse(URL_SECOND, xml, MimeType.TEXT_XML); + getMockWebConnection().setResponse(urlThird, xsl, MimeType.TEXT_XML); loadPageWithAlerts2(createTestHTML(html)); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/annotations/StandardsMode.java b/src/test/java/com/gargoylesoftware/htmlunit/annotations/StandardsMode.java index 4abfd9944c7..dcc018ad760 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/annotations/StandardsMode.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/annotations/StandardsMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/annotations/ToRunWithRealBrowsers.java b/src/test/java/com/gargoylesoftware/htmlunit/annotations/ToRunWithRealBrowsers.java index e142b7f8032..da0ab3cdf10 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/annotations/ToRunWithRealBrowsers.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/annotations/ToRunWithRealBrowsers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/archunit/ArchitectureTest.java b/src/test/java/com/gargoylesoftware/htmlunit/archunit/ArchitectureTest.java new file mode 100644 index 00000000000..b2f796b8fda --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/archunit/ArchitectureTest.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.archunit; + +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; + +import org.junit.runner.RunWith; + +import com.tngtech.archunit.junit.AnalyzeClasses; +import com.tngtech.archunit.junit.ArchTest; +import com.tngtech.archunit.junit.ArchUnitRunner; +import com.tngtech.archunit.lang.ArchRule; + +/** + * Architecture tests. + * + * @author Ronald Brill + */ +@RunWith(ArchUnitRunner.class) +@AnalyzeClasses(packages = "com.gargoylesoftware.htmlunit") +public class ArchitectureTest { + + /** + * Utility classes should be placed in 'com.gargoylesoftware.htmlunit.util'. + */ + @ArchTest + public static final ArchRule utilsPackageRule = classes() + .that().haveNameMatching(".*Util.?") + .should().resideInAPackage("com.gargoylesoftware.htmlunit.util"); +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java b/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java index cd8397f6cb6..c3473c215b2 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/attachment/AttachmentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -69,7 +70,7 @@ public void basic() throws Exception { final MockWebConnection conn = new MockWebConnection(); conn.setResponse(URL_FIRST, content1); - conn.setResponse(URL_SECOND, content2, 200, "OK", "text/html", headers); + conn.setResponse(URL_SECOND, content2, 200, "OK", MimeType.TEXT_HTML, headers); client.setWebConnection(conn); assertTrue(attachments.isEmpty()); @@ -85,7 +86,7 @@ public void basic() throws Exception { final WebResponse attachmentResponse = attachedPage.getWebResponse(); final InputStream attachmentStream = attachmentResponse.getContentAsStream(); HttpWebConnectionTest.assertEquals(new ByteArrayInputStream(content2.getBytes()), attachmentStream); - assertEquals("text/html", attachmentResponse.getContentType()); + assertEquals(MimeType.TEXT_HTML, attachmentResponse.getContentType()); assertEquals(200, attachmentResponse.getStatusCode()); assertEquals(URL_SECOND, attachmentResponse.getWebRequest().getUrl()); } @@ -106,7 +107,7 @@ public void filename() throws Exception { final List headers1 = new ArrayList<>(); headers1.add(new NameValuePair("Content-Disposition", "attachment;filename=\"hello.html\"")); - conn.setResponse(URL_FIRST, content, 200, "OK", "text/html", headers1); + conn.setResponse(URL_FIRST, content, 200, "OK", MimeType.TEXT_HTML, headers1); client.getPage(URL_FIRST); final Attachment result = attachments.get(0); assertEquals(result.getSuggestedFilename(), "hello.html"); @@ -114,7 +115,7 @@ public void filename() throws Exception { final List headers2 = new ArrayList<>(); headers2.add(new NameValuePair("Content-Disposition", "attachment; filename=hello2.html; something=else")); - conn.setResponse(URL_SECOND, content, 200, "OK", "text/plain", headers2); + conn.setResponse(URL_SECOND, content, 200, "OK", MimeType.TEXT_PLAIN, headers2); client.getPage(URL_SECOND); final Attachment result2 = attachments.get(0); assertEquals(result2.getSuggestedFilename(), "hello2.html"); @@ -123,7 +124,7 @@ public void filename() throws Exception { final List headers3 = new ArrayList<>(); headers3.add(new NameValuePair("Content-Disposition", "attachment; filename=")); - conn.setResponse(URL_SECOND, content, 200, "OK", "text/plain", headers3); + conn.setResponse(URL_SECOND, content, 200, "OK", MimeType.TEXT_PLAIN, headers3); client.getPage(URL_SECOND); final Attachment result3 = attachments.get(0); assertNull(result3.getSuggestedFilename()); @@ -166,7 +167,7 @@ public void jsChangeLocationAfterReceptionOfAttachment() throws Exception { final MockWebConnection conn = getMockWebConnection(); conn.setDefaultResponse(""); - conn.setResponse(URL_SECOND, "some text", 200, "OK", "text/plain", headers); + conn.setResponse(URL_SECOND, "some text", 200, "OK", MimeType.TEXT_PLAIN, headers); final HtmlPage page = loadPage(html); // download text attachment diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java index fc88491af56..d19600f8994 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementChildNodesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +14,14 @@ */ package com.gargoylesoftware.htmlunit.general; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; + import org.junit.Test; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -413,7 +416,9 @@ public void details() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"3", "2", "2", "3", "2", "2"}) + @Alerts(DEFAULT = {"3", "2", "2", "3", "2", "2"}, + FF = {"1", "0", "1", "1", "0", "1"}) + @NotYetImplemented(FF) public void dialog() throws Exception { loadPageWithAlerts2(test("dialog")); } @@ -733,7 +738,8 @@ public void ins() throws Exception { */ @Test @Alerts(DEFAULT = {"1", "0", "1", "1", "0", "1"}, - CHROME = {"3", "2", "2", "3", "2", "2"}) + CHROME = {"3", "2", "2", "3", "2", "2"}, + FF = {"3", "2", "2", "3", "2", "2"}) public void isindex() throws Exception { loadPageWithAlerts2(test("isindex")); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementClosesItselfTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementClosesItselfTest.java index 47daaee2163..bcf6a3a29ef 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementClosesItselfTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementClosesItselfTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +14,14 @@ */ package com.gargoylesoftware.htmlunit.general; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; + import org.junit.Test; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -807,7 +810,8 @@ public void ins() throws Exception { */ @Test @Alerts(DEFAULT = "0", - CHROME = "1") + CHROME = "1", + FF = "1") public void isindex() throws Exception { loadPageWithAlerts2(test("isindex")); } @@ -1673,7 +1677,9 @@ public void picture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("0") + @Alerts(DEFAULT = "0", + IE = "1") + @NotYetImplemented(IE) public void template() throws Exception { loadPageWithAlerts2(test("template")); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementCreationTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementCreationTest.java index a3ce47bbe7e..75d478c421f 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementCreationTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementCreationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,8 +97,8 @@ public void a() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "[object HTMLAppletElement]", - CHROME = "[object HTMLUnknownElement]") + @Alerts(DEFAULT = "[object HTMLUnknownElement]", + IE = "[object HTMLAppletElement]") public void applet() throws Exception { test("applet"); } @@ -189,7 +189,8 @@ public void basefont() throws Exception { */ @Test @Alerts(DEFAULT = "[object HTMLUnknownElement]", - CHROME = "[object HTMLElement]") + CHROME = "[object HTMLElement]", + FF68 = "[object HTMLElement]") public void bdi() throws Exception { test("bdi"); } @@ -465,9 +466,7 @@ public void em() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "[object HTMLElement]", - CHROME = "[object HTMLPreElement]", - FF52 = "[object HTMLPreElement]", + @Alerts(DEFAULT = "[object HTMLPreElement]", IE = "[object HTMLBlockElement]") public void xmp() throws Exception { test("xmp"); @@ -825,9 +824,7 @@ public void link() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "[object HTMLElement]", - CHROME = "[object HTMLPreElement]", - FF52 = "[object HTMLPreElement]", + @Alerts(DEFAULT = "[object HTMLPreElement]", IE = "[object HTMLBlockElement]") public void listing() throws Exception { test("listing"); @@ -885,7 +882,7 @@ public void mark() throws Exception { */ @Test @Alerts(DEFAULT = "[object HTMLMarqueeElement]", - FF = "[object HTMLDivElement]") + FF60 = "[object HTMLDivElement]") public void marquee() throws Exception { test("marquee"); } @@ -1307,9 +1304,8 @@ public void sub() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "[object HTMLUnknownElement]", - CHROME = "[object HTMLElement]", - FF52 = "[object HTMLElement]") + @Alerts(DEFAULT = "[object HTMLElement]", + IE = "[object HTMLUnknownElement]") public void summary() throws Exception { test("summary"); } @@ -1657,9 +1653,8 @@ public void defaults() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "[object HTMLUnknownElement]", - CHROME = "[object HTMLDetailsElement]", - FF52 = "[object HTMLDetailsElement]") + @Alerts(DEFAULT = "[object HTMLDetailsElement]", + IE = "[object HTMLUnknownElement]") public void details() throws Exception { test("details"); } @@ -1690,7 +1685,7 @@ public void document() throws Exception { */ @Test @Alerts("[object HTMLUnknownElement]") - public void DocumentCompatibleInfo() throws Exception { + public void documentCompatibleInfo() throws Exception { test("DocumentCompatibleInfo"); } @@ -1920,7 +1915,7 @@ public void spacer() throws Exception { */ @Test @Alerts("[object HTMLUnknownElement]") - public void Storage() throws Exception { + public void storage() throws Exception { test("Storage"); } @@ -1938,7 +1933,7 @@ public void styleSheet() throws Exception { */ @Test @Alerts("[object HTMLUnknownElement]") - public void TextNode() throws Exception { + public void textNode() throws Exception { test("TextNode"); } @@ -1947,7 +1942,7 @@ public void TextNode() throws Exception { */ @Test @Alerts("[object HTMLUnknownElement]") - public void TextRange() throws Exception { + public void textRange() throws Exception { test("TextRange"); } @@ -1956,7 +1951,7 @@ public void TextRange() throws Exception { */ @Test @Alerts("[object HTMLUnknownElement]") - public void TextRectangle() throws Exception { + public void textRectangle() throws Exception { test("TextRectangle"); } @@ -2023,9 +2018,8 @@ public void data() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "[object HTMLContentElement]", - FF52 = "[object HTMLUnknownElement]", - IE = "[object HTMLUnknownElement]") + @Alerts(DEFAULT = "[object HTMLUnknownElement]", + CHROME = "[object HTMLContentElement]") public void content() throws Exception { test("content"); } @@ -2061,7 +2055,8 @@ public void template() throws Exception { */ @Test @Alerts(DEFAULT = "[object HTMLUnknownElement]", - CHROME = "[object HTMLSlotElement]") + CHROME = "[object HTMLSlotElement]", + FF68 = "[object HTMLSlotElement]") public void slot() throws Exception { test("slot"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementDefaultStyleDisplayTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementDefaultStyleDisplayTest.java index 87bf5090aea..af74b6a8c91 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementDefaultStyleDisplayTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementDefaultStyleDisplayTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ * Tests the result of the default 'display' style of an element. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) @StandardsMode @@ -51,7 +52,7 @@ private static String test(final String tagName) { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void abbr() throws Exception { loadPageWithAlerts2(test("abbr")); @@ -64,7 +65,7 @@ public void abbr() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void acronym() throws Exception { loadPageWithAlerts2(test("acronym")); @@ -77,7 +78,7 @@ public void acronym() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void a() throws Exception { loadPageWithAlerts2(test("a")); @@ -90,7 +91,8 @@ public void a() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void address() throws Exception { loadPageWithAlerts2(test("address")); } @@ -102,8 +104,7 @@ public void address() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF45 = {"block", "inline-block"}, - FF52 = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void applet() throws Exception { loadPageWithAlerts2(test("applet")); @@ -116,7 +117,8 @@ public void applet() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"none", "none"}, + FF60 = {"none", "none"}, + FF68 = {"", "none"}, IE = {"inline", "inline"}) public void area() throws Exception { loadPageWithAlerts2(test("area")); @@ -129,7 +131,8 @@ public void area() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void article() throws Exception { loadPageWithAlerts2(test("article")); } @@ -141,7 +144,8 @@ public void article() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void aside() throws Exception { loadPageWithAlerts2(test("aside")); } @@ -153,7 +157,8 @@ public void aside() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void audio() throws Exception { loadPageWithAlerts2(test("audio")); } @@ -165,7 +170,7 @@ public void audio() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void bgsound() throws Exception { loadPageWithAlerts2(test("bgsound")); @@ -178,7 +183,8 @@ public void bgsound() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"none", "none"}, + FF60 = {"none", "none"}, + FF68 = {"", "none"}, IE = {"inline", "inline"}) public void base() throws Exception { loadPageWithAlerts2(test("base")); @@ -191,7 +197,8 @@ public void base() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"none", "none"}, + FF60 = {"none", "none"}, + FF68 = {"", "none"}, IE = {"inline", "inline"}) public void basefont() throws Exception { loadPageWithAlerts2(test("basefont")); @@ -204,7 +211,7 @@ public void basefont() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void bdi() throws Exception { loadPageWithAlerts2(test("bdi")); @@ -217,7 +224,7 @@ public void bdi() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void bdo() throws Exception { loadPageWithAlerts2(test("bdo")); @@ -230,7 +237,7 @@ public void bdo() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void big() throws Exception { loadPageWithAlerts2(test("big")); @@ -243,7 +250,7 @@ public void big() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void blink() throws Exception { loadPageWithAlerts2(test("blink")); @@ -256,7 +263,8 @@ public void blink() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void blockquote() throws Exception { loadPageWithAlerts2(test("blockquote")); } @@ -268,7 +276,8 @@ public void blockquote() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void body() throws Exception { loadPageWithAlerts2(test("body")); } @@ -280,7 +289,7 @@ public void body() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void b() throws Exception { loadPageWithAlerts2(test("b")); @@ -293,7 +302,7 @@ public void b() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void br() throws Exception { loadPageWithAlerts2(test("br")); @@ -306,7 +315,7 @@ public void br() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline-block"}, + FF60 = {"inline-block", "inline-block"}, IE = {"inline-block", "inline-block"}) public void button() throws Exception { loadPageWithAlerts2(test("button")); @@ -319,7 +328,7 @@ public void button() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void canvas() throws Exception { loadPageWithAlerts2(test("canvas")); @@ -332,7 +341,7 @@ public void canvas() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-caption"}, - FF = {"block", "table-caption"}, + FF60 = {"table-caption", "table-caption"}, IE = {"table-caption", "table-caption"}) public void caption() throws Exception { loadPageWithAlerts2(test("caption")); @@ -345,7 +354,8 @@ public void caption() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void center() throws Exception { loadPageWithAlerts2(test("center")); } @@ -357,7 +367,7 @@ public void center() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void cite() throws Exception { loadPageWithAlerts2(test("cite")); @@ -370,7 +380,7 @@ public void cite() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void code() throws Exception { loadPageWithAlerts2(test("code")); @@ -383,7 +393,7 @@ public void code() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void command() throws Exception { loadPageWithAlerts2(test("command")); @@ -396,7 +406,8 @@ public void command() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void datalist() throws Exception { loadPageWithAlerts2(test("datalist")); } @@ -408,7 +419,7 @@ public void datalist() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void dfn() throws Exception { loadPageWithAlerts2(test("dfn")); @@ -422,9 +433,11 @@ public void dfn() throws Exception { @Test @Alerts(DEFAULT = {"", "block"}, FF = {"block", "inline"}, + FF68 = {"", "inline"}, IE = {"block", "block"}) @AlertsStandards(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void dd() throws Exception { loadPageWithAlerts2(test("dd")); } @@ -436,7 +449,7 @@ public void dd() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void del() throws Exception { loadPageWithAlerts2(test("del")); @@ -449,8 +462,7 @@ public void del() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF45 = {"block", "inline"}, - FF52 = {"block", "block"}, + FF60 = {"block", "block"}, IE = {"inline", "inline"}) public void details() throws Exception { loadPageWithAlerts2(test("details")); @@ -463,7 +475,7 @@ public void details() throws Exception { */ @Test @Alerts(DEFAULT = {"", "none"}, - FF = {"block", "inline"}, + FF60 = {"none", "none"}, IE = {"inline", "inline"}) public void dialog() throws Exception { loadPageWithAlerts2(test("dialog")); @@ -476,7 +488,8 @@ public void dialog() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void dir() throws Exception { loadPageWithAlerts2(test("dir")); } @@ -488,7 +501,8 @@ public void dir() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void div() throws Exception { loadPageWithAlerts2(test("div")); } @@ -500,7 +514,8 @@ public void div() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void dl() throws Exception { loadPageWithAlerts2(test("dl")); } @@ -512,7 +527,8 @@ public void dl() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void dt() throws Exception { loadPageWithAlerts2(test("dt")); } @@ -524,7 +540,7 @@ public void dt() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void embed() throws Exception { loadPageWithAlerts2(test("embed")); @@ -537,7 +553,7 @@ public void embed() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void em() throws Exception { loadPageWithAlerts2(test("em")); @@ -550,7 +566,8 @@ public void em() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void fieldset() throws Exception { loadPageWithAlerts2(test("fieldset")); } @@ -562,7 +579,8 @@ public void fieldset() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void figcaption() throws Exception { loadPageWithAlerts2(test("figcaption")); } @@ -574,7 +592,8 @@ public void figcaption() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void figure() throws Exception { loadPageWithAlerts2(test("figure")); } @@ -586,7 +605,7 @@ public void figure() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void font() throws Exception { loadPageWithAlerts2(test("font")); @@ -599,7 +618,8 @@ public void font() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void form() throws Exception { loadPageWithAlerts2(test("form")); } @@ -611,7 +631,8 @@ public void form() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void footer() throws Exception { loadPageWithAlerts2(test("footer")); } @@ -623,7 +644,8 @@ public void footer() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, + FF68 = {"", "inline"}, IE = {"block", "block"}) public void frame() throws Exception { loadPageWithAlerts2(test("frame")); @@ -636,7 +658,8 @@ public void frame() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void frameset() throws Exception { loadPageWithAlerts2(test("frameset")); } @@ -648,7 +671,8 @@ public void frameset() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void head() throws Exception { loadPageWithAlerts2(test("head")); } @@ -660,7 +684,8 @@ public void head() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void header() throws Exception { loadPageWithAlerts2(test("header")); } @@ -672,7 +697,8 @@ public void header() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void h1() throws Exception { loadPageWithAlerts2(test("h1")); } @@ -684,7 +710,8 @@ public void h1() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void h2() throws Exception { loadPageWithAlerts2(test("h2")); } @@ -696,7 +723,8 @@ public void h2() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void h3() throws Exception { loadPageWithAlerts2(test("h3")); } @@ -708,7 +736,8 @@ public void h3() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void h4() throws Exception { loadPageWithAlerts2(test("h4")); } @@ -720,7 +749,8 @@ public void h4() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void h5() throws Exception { loadPageWithAlerts2(test("h5")); } @@ -732,7 +762,8 @@ public void h5() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void h6() throws Exception { loadPageWithAlerts2(test("h6")); } @@ -744,7 +775,8 @@ public void h6() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void hr() throws Exception { loadPageWithAlerts2(test("hr")); } @@ -756,7 +788,8 @@ public void hr() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void html() throws Exception { loadPageWithAlerts2(test("html")); } @@ -768,7 +801,7 @@ public void html() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void iframe() throws Exception { loadPageWithAlerts2(test("iframe")); @@ -781,7 +814,7 @@ public void iframe() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void q() throws Exception { loadPageWithAlerts2(test("q")); @@ -794,7 +827,7 @@ public void q() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void img() throws Exception { loadPageWithAlerts2(test("img")); @@ -807,7 +840,7 @@ public void img() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void image() throws Exception { loadPageWithAlerts2(test("image")); @@ -820,7 +853,7 @@ public void image() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void ins() throws Exception { loadPageWithAlerts2(test("ins")); @@ -833,7 +866,7 @@ public void ins() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void isindex() throws Exception { loadPageWithAlerts2(test("isindex")); @@ -846,7 +879,7 @@ public void isindex() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void i() throws Exception { loadPageWithAlerts2(test("i")); @@ -859,7 +892,7 @@ public void i() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void kbd() throws Exception { loadPageWithAlerts2(test("kbd")); @@ -870,7 +903,7 @@ public void kbd() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void keygen() throws Exception { loadPageWithAlerts2(test("keygen")); @@ -883,7 +916,7 @@ public void keygen() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void label() throws Exception { loadPageWithAlerts2(test("label")); @@ -896,7 +929,8 @@ public void label() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, + FF68 = {"", "inline"}, IE = {"inline", "inline"}) public void layer() throws Exception { loadPageWithAlerts2(test("layer")); @@ -909,7 +943,7 @@ public void layer() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF = {"block", "block"}, + FF60 = {"block", "block"}, IE = {"inline", "inline"}) public void legend() throws Exception { loadPageWithAlerts2(test("legend")); @@ -922,7 +956,8 @@ public void legend() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void listing() throws Exception { loadPageWithAlerts2(test("listing")); } @@ -934,7 +969,7 @@ public void listing() throws Exception { */ @Test @Alerts(DEFAULT = {"", "list-item"}, - FF = {"block", "list-item"}, + FF60 = {"list-item", "list-item"}, IE = {"list-item", "list-item"}) public void li() throws Exception { loadPageWithAlerts2(test("li")); @@ -947,7 +982,7 @@ public void li() throws Exception { */ @Test @Alerts(DEFAULT = {"", "none"}, - FF = {"none", "none"}, + FF60 = {"none", "none"}, IE = {"inline", "inline"}) public void link() throws Exception { loadPageWithAlerts2(test("link")); @@ -960,7 +995,7 @@ public void link() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF = {"block", "block"}, + FF60 = {"block", "block"}, IE = {"inline", "inline"}) public void main() throws Exception { loadPageWithAlerts2(test("main")); @@ -973,7 +1008,7 @@ public void main() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void map() throws Exception { loadPageWithAlerts2(test("map")); @@ -986,7 +1021,7 @@ public void map() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void mark() throws Exception { loadPageWithAlerts2(test("mark")); @@ -999,7 +1034,7 @@ public void mark() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline-block"}, + FF60 = {"inline-block", "inline-block"}, IE = {"block", "block"}) public void marquee() throws Exception { loadPageWithAlerts2(test("marquee")); @@ -1012,7 +1047,8 @@ public void marquee() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void menu() throws Exception { loadPageWithAlerts2(test("menu")); } @@ -1024,7 +1060,7 @@ public void menu() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void menuitem() throws Exception { loadPageWithAlerts2(test("menuitem")); @@ -1037,7 +1073,8 @@ public void menuitem() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void meta() throws Exception { loadPageWithAlerts2(test("meta")); } @@ -1049,7 +1086,7 @@ public void meta() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline-block"}, + FF60 = {"inline-block", "inline-block"}, IE = {"inline", "inline"}) public void meter() throws Exception { loadPageWithAlerts2(test("meter")); @@ -1062,7 +1099,8 @@ public void meter() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "block"}, + FF60 = {"block", "block"}, + FF68 = {"", "block"}, IE = {"inline", "inline"}) public void multicol() throws Exception { loadPageWithAlerts2(test("multicol")); @@ -1075,7 +1113,8 @@ public void multicol() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void nav() throws Exception { loadPageWithAlerts2(test("nav")); } @@ -1087,7 +1126,7 @@ public void nav() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void nextid() throws Exception { loadPageWithAlerts2(test("nextid")); @@ -1100,7 +1139,7 @@ public void nextid() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void nobr() throws Exception { loadPageWithAlerts2(test("nobr")); @@ -1113,7 +1152,8 @@ public void nobr() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "inline"}) + CHROME = {"", "inline"}, + FF68 = {"", "none"}) public void noembed() throws Exception { loadPageWithAlerts2(test("noembed")); } @@ -1125,7 +1165,8 @@ public void noembed() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void noframes() throws Exception { loadPageWithAlerts2(test("noframes")); } @@ -1137,7 +1178,7 @@ public void noframes() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void nolayer() throws Exception { loadPageWithAlerts2(test("nolayer")); @@ -1150,7 +1191,8 @@ public void nolayer() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "inline"}) + CHROME = {"", "inline"}, + FF68 = {"", "none"}) public void noscript() throws Exception { loadPageWithAlerts2(test("noscript")); } @@ -1162,7 +1204,7 @@ public void noscript() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void object() throws Exception { loadPageWithAlerts2(test("object")); @@ -1175,7 +1217,8 @@ public void object() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void ol() throws Exception { loadPageWithAlerts2(test("ol")); } @@ -1187,7 +1230,7 @@ public void ol() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF = {"block", "block"}, + FF60 = {"block", "block"}, IE = {"inline", "inline"}) public void optgroup() throws Exception { loadPageWithAlerts2(test("optgroup")); @@ -1200,7 +1243,7 @@ public void optgroup() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF = {"block", "block"}, + FF60 = {"block", "block"}, IE = {"inline", "inline"}) public void option() throws Exception { loadPageWithAlerts2(test("option")); @@ -1213,7 +1256,7 @@ public void option() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void output() throws Exception { loadPageWithAlerts2(test("output")); @@ -1226,7 +1269,8 @@ public void output() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void p() throws Exception { loadPageWithAlerts2(test("p")); } @@ -1238,7 +1282,7 @@ public void p() throws Exception { */ @Test @Alerts(DEFAULT = {"", "none"}, - FF = {"none", "none"}, + FF60 = {"none", "none"}, IE = {"inline", "inline"}) public void param() throws Exception { loadPageWithAlerts2(test("param")); @@ -1251,7 +1295,8 @@ public void param() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void plaintext() throws Exception { loadPageWithAlerts2(test("plaintext")); } @@ -1263,7 +1308,8 @@ public void plaintext() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void pre() throws Exception { loadPageWithAlerts2(test("pre")); } @@ -1275,7 +1321,7 @@ public void pre() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline-block"}, + FF60 = {"inline-block", "inline-block"}, IE = {"inline", "inline"}) public void progress() throws Exception { loadPageWithAlerts2(test("progress")); @@ -1287,8 +1333,8 @@ public void progress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"", "inline"}, - FF = {"none", "none"}, + @Alerts(DEFAULT = {"", "none"}, + FF60 = {"none", "none"}, IE = {"inline", "inline"}) public void rp() throws Exception { loadPageWithAlerts2(test("rp")); @@ -1301,7 +1347,8 @@ public void rp() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "ruby-text"}, + FF60 = {"ruby-text", "ruby-text"}, + FF68 = {"", "ruby-text"}, IE = {"ruby-text", "ruby-text"}) public void rt() throws Exception { loadPageWithAlerts2(test("rt")); @@ -1314,7 +1361,8 @@ public void rt() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "ruby"}, + FF60 = {"ruby", "ruby"}, + FF68 = {"", "ruby"}, IE = {"ruby", "ruby"}) public void ruby() throws Exception { loadPageWithAlerts2(test("ruby")); @@ -1327,7 +1375,7 @@ public void ruby() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void s() throws Exception { loadPageWithAlerts2(test("s")); @@ -1340,7 +1388,7 @@ public void s() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void samp() throws Exception { loadPageWithAlerts2(test("samp")); @@ -1353,7 +1401,8 @@ public void samp() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void script() throws Exception { loadPageWithAlerts2(test("script")); } @@ -1365,7 +1414,8 @@ public void script() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void section() throws Exception { loadPageWithAlerts2(test("section")); } @@ -1377,7 +1427,7 @@ public void section() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline-block"}, + FF60 = {"inline-block", "inline-block"}, IE = {"inline-block", "inline-block"}) public void select() throws Exception { loadPageWithAlerts2(test("select")); @@ -1390,7 +1440,7 @@ public void select() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void small() throws Exception { loadPageWithAlerts2(test("small")); @@ -1403,7 +1453,7 @@ public void small() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void source() throws Exception { loadPageWithAlerts2(test("source")); @@ -1416,7 +1466,7 @@ public void source() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void span() throws Exception { loadPageWithAlerts2(test("span")); @@ -1429,7 +1479,7 @@ public void span() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void strike() throws Exception { loadPageWithAlerts2(test("strike")); @@ -1442,7 +1492,7 @@ public void strike() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void strong() throws Exception { loadPageWithAlerts2(test("strong")); @@ -1455,7 +1505,8 @@ public void strong() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void style() throws Exception { loadPageWithAlerts2(test("style")); } @@ -1467,7 +1518,7 @@ public void style() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void sub() throws Exception { loadPageWithAlerts2(test("sub")); @@ -1480,8 +1531,7 @@ public void sub() throws Exception { */ @Test @Alerts(DEFAULT = {"", "block"}, - FF45 = {"block", "inline"}, - FF52 = {"block", "block"}, + FF60 = {"block", "block"}, IE = {"inline", "inline"}) public void summary() throws Exception { loadPageWithAlerts2(test("summary")); @@ -1494,7 +1544,7 @@ public void summary() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void sup() throws Exception { loadPageWithAlerts2(test("sup")); @@ -1507,7 +1557,7 @@ public void sup() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void svg() throws Exception { loadPageWithAlerts2(test("svg")); @@ -1520,7 +1570,8 @@ public void svg() throws Exception { */ @Test @Alerts(DEFAULT = {"table", "table"}, - CHROME = {"", "table"}) + CHROME = {"", "table"}, + FF68 = {"", "table"}) public void table() throws Exception { loadPageWithAlerts2(test("table")); } @@ -1532,7 +1583,7 @@ public void table() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-column"}, - FF = {"block", "table-column"}, + FF60 = {"table-column", "table-column"}, IE = {"table-column", "table-column"}) public void col() throws Exception { loadPageWithAlerts2(test("col")); @@ -1545,7 +1596,7 @@ public void col() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-column-group"}, - FF = {"block", "table-column-group"}, + FF60 = {"table-column-group", "table-column-group"}, IE = {"table-column-group", "table-column-group"}) public void colgroup() throws Exception { loadPageWithAlerts2(test("colgroup")); @@ -1558,7 +1609,7 @@ public void colgroup() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-row-group"}, - FF = {"block", "table-row-group"}, + FF60 = {"table-row-group", "table-row-group"}, IE = {"table-row-group", "table-row-group"}) public void tbody() throws Exception { loadPageWithAlerts2(test("tbody")); @@ -1571,7 +1622,7 @@ public void tbody() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-cell"}, - FF = {"block", "table-cell"}, + FF60 = {"table-cell", "table-cell"}, IE = {"table-cell", "table-cell"}) public void td() throws Exception { loadPageWithAlerts2(test("td")); @@ -1584,7 +1635,7 @@ public void td() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-cell"}, - FF = {"block", "table-cell"}, + FF60 = {"table-cell", "table-cell"}, IE = {"table-cell", "table-cell"}) public void th() throws Exception { loadPageWithAlerts2(test("th")); @@ -1597,7 +1648,7 @@ public void th() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-row"}, - FF = {"block", "table-row"}, + FF60 = {"table-row", "table-row"}, IE = {"table-row", "table-row"}) public void tr() throws Exception { loadPageWithAlerts2(test("tr")); @@ -1610,7 +1661,8 @@ public void tr() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, + FF68 = {"", "inline"}, IE = {"inline-block", "inline-block"}) public void textarea() throws Exception { loadPageWithAlerts2(test("textarea")); @@ -1623,7 +1675,7 @@ public void textarea() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-footer-group"}, - FF = {"block", "table-footer-group"}, + FF60 = {"table-footer-group", "table-footer-group"}, IE = {"table-footer-group", "table-footer-group"}) public void tfoot() throws Exception { loadPageWithAlerts2(test("tfoot")); @@ -1636,7 +1688,7 @@ public void tfoot() throws Exception { */ @Test @Alerts(DEFAULT = {"", "table-header-group"}, - FF = {"block", "table-header-group"}, + FF60 = {"table-header-group", "table-header-group"}, IE = {"table-header-group", "table-header-group"}) public void thead() throws Exception { loadPageWithAlerts2(test("thead")); @@ -1649,7 +1701,7 @@ public void thead() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void tt() throws Exception { loadPageWithAlerts2(test("tt")); @@ -1662,7 +1714,7 @@ public void tt() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void time() throws Exception { loadPageWithAlerts2(test("time")); @@ -1675,7 +1727,8 @@ public void time() throws Exception { */ @Test @Alerts(DEFAULT = {"none", "none"}, - CHROME = {"", "none"}) + CHROME = {"", "none"}, + FF68 = {"", "none"}) public void title() throws Exception { loadPageWithAlerts2(test("title")); } @@ -1687,7 +1740,7 @@ public void title() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void track() throws Exception { loadPageWithAlerts2(test("track")); @@ -1700,7 +1753,7 @@ public void track() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void u() throws Exception { loadPageWithAlerts2(test("u")); @@ -1713,7 +1766,8 @@ public void u() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void ul() throws Exception { loadPageWithAlerts2(test("ul")); } @@ -1725,7 +1779,7 @@ public void ul() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void var() throws Exception { loadPageWithAlerts2(test("var")); @@ -1738,7 +1792,7 @@ public void var() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void video() throws Exception { loadPageWithAlerts2(test("video")); @@ -1751,7 +1805,7 @@ public void video() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void wbr() throws Exception { loadPageWithAlerts2(test("wbr")); @@ -1764,7 +1818,8 @@ public void wbr() throws Exception { */ @Test @Alerts(DEFAULT = {"block", "block"}, - CHROME = {"", "block"}) + CHROME = {"", "block"}, + FF68 = {"", "block"}) public void xmp() throws Exception { loadPageWithAlerts2(test("xmp")); } @@ -1776,7 +1831,8 @@ public void xmp() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline-block"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, + FF68 = {"", "inline"}, IE = {"inline-block", "inline-block"}) public void input() throws Exception { loadPageWithAlerts2(test("input")); @@ -1789,7 +1845,7 @@ public void input() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void data() throws Exception { loadPageWithAlerts2(test("data")); @@ -1802,7 +1858,7 @@ public void data() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void content() throws Exception { loadPageWithAlerts2(test("content")); @@ -1815,7 +1871,7 @@ public void content() throws Exception { */ @Test @Alerts(DEFAULT = {"", "inline"}, - FF = {"block", "inline"}, + FF60 = {"inline", "inline"}, IE = {"inline", "inline"}) public void picture() throws Exception { loadPageWithAlerts2(test("picture")); @@ -1828,7 +1884,7 @@ public void picture() throws Exception { */ @Test @Alerts(DEFAULT = {"", "none"}, - FF = {"none", "none"}, + FF60 = {"none", "none"}, IE = {"inline", "inline"}) public void template() throws Exception { loadPageWithAlerts2(test("template")); @@ -1841,7 +1897,7 @@ public void template() throws Exception { */ @Test @Alerts(DEFAULT = {"", "contents"}, - FF = {"block", "inline"}, + FF60 = {"contents", "contents"}, IE = {"inline", "inline"}) public void slot() throws Exception { loadPageWithAlerts2(test("slot")); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOuterHtmlTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOuterHtmlTest.java index 222bde1ec77..a37e5d8a17d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOuterHtmlTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOuterHtmlTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOwnPropertiesTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOwnPropertiesTest.java new file mode 100644 index 00000000000..9ec6832b447 --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementOwnPropertiesTest.java @@ -0,0 +1,7742 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.general; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.HtmlUnitNYI; +import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.html.HtmlPageTest; + +/** + * Tests own properties of an object. + * + * @author Ronald Brill + */ +@RunWith(BrowserRunner.class) +public class ElementOwnPropertiesTest extends WebDriverTestCase { + + private void test(final String tagName) throws Exception { + testString("document.createElement('" + tagName + "')"); + } + + private void testString(final String string) throws Exception { + final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "assignedSlot,constructor(),getDestinationInsertionPoints(),splitText(),wholeText", + FF60 = "constructor(),splitText(),wholeText", + FF68 = "assignedSlot,constructor(),splitText(),wholeText", + IE = "constructor,removeNode(),replaceNode(),replaceWholeText(),splitText(),swapNode(),wholeText") + @HtmlUnitNYI(CHROME = "constructor(),splitText(),wholeText", + FF68 = "constructor(),splitText(),wholeText", + IE = "constructor,splitText(),text,wholeText") + public void text() throws Exception { + testString("document.createTextNode('some text')"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),localName,name,namespaceURI,ownerElement,prefix,specified,value", + FF60 = "constructor(),localName,name,namespaceURI,ownerElement,prefix,specified,value", + FF68 = "constructor(),localName,name,namespaceURI,ownerElement,prefix,specified,value", + IE = "constructor,expando,name,ownerElement,specified,value") + @HtmlUnitNYI(IE = "constructor,expando,localName,name,namespaceURI,ownerElement,prefix," + + "specified,value") + public void attr() throws Exception { + testString("document.createAttribute('some_attrib')"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,text") + @HtmlUnitNYI(IE = "constructor,getAttribute(),getAttributeNode(),text") + public void comment() throws Exception { + testString("document.createComment('come_comment')"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void unknown() throws Exception { + testString("unknown"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void htmlElement() throws Exception { + testString("unknown"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.Element}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "after(),animate(),append(),assignedSlot,attachShadow(),attributes,attributeStyleMap,before()," + + "childElementCount,children,classList,className,clientHeight,clientLeft,clientTop,clientWidth," + + "closest(),computedStyleMap(),constructor(),createShadowRoot(),elementTiming,firstElementChild," + + "getAttribute(),getAttributeNames(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS()," + + "getBoundingClientRect(),getClientRects(),getDestinationInsertionPoints()," + + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," + + "hasAttributeNS(),hasAttributes(),hasPointerCapture(),id,innerHTML,insertAdjacentElement()," + + "insertAdjacentHTML(),insertAdjacentText(),lastElementChild,localName,matches(),namespaceURI," + + "nextElementSibling,onbeforecopy,onbeforecut,onbeforepaste,onfullscreenchange,onfullscreenerror," + + "onsearch,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,part,prefix,prepend()," + + "previousElementSibling,querySelector(),querySelectorAll(),releasePointerCapture(),remove()," + + "removeAttribute(),removeAttributeNode(),removeAttributeNS(),replaceWith(),requestFullscreen()," + + "requestPointerLock(),scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollIntoViewIfNeeded()," + + "scrollLeft,scrollTo(),scrollTop,scrollWidth,setAttribute(),setAttributeNode()," + + "setAttributeNodeNS(),setAttributeNS(),setPointerCapture(),shadowRoot,slot,tagName," + + "toggleAttribute(),webkitMatchesSelector(),webkitRequestFullscreen()," + + "webkitRequestFullScreen()", + FF60 = "after(),animate(),append(),attributes,before(),childElementCount,children,classList,className," + + "clientHeight,clientLeft,clientTop,clientWidth,closest(),constructor(),firstElementChild," + + "getAttribute(),getAttributeNames(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS()," + + "getBoundingClientRect(),getClientRects(),getElementsByClassName(),getElementsByTagName()," + + "getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes(),hasPointerCapture(),id," + + "innerHTML,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),lastElementChild," + + "localName,matches(),mozMatchesSelector(),mozRequestFullScreen(),namespaceURI,nextElementSibling," + + "outerHTML,prefix,prepend(),previousElementSibling,querySelector(),querySelectorAll()," + + "releaseCapture(),releasePointerCapture(),remove(),removeAttribute(),removeAttributeNode()," + + "removeAttributeNS(),replaceWith(),requestPointerLock(),scroll(),scrollBy(),scrollHeight," + + "scrollIntoView(),scrollLeft,scrollLeftMax,scrollTo(),scrollTop,scrollTopMax,scrollWidth," + + "setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS(),setCapture()," + + "setPointerCapture(),tagName," + + "webkitMatchesSelector()", + FF68 = "after(),animate(),append(),assignedSlot,attachShadow(),attributes,before(),childElementCount," + + "children,classList,className,clientHeight,clientLeft,clientTop,clientWidth,closest()," + + "constructor(),firstElementChild,getAttribute(),getAttributeNames(),getAttributeNode()," + + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," + + "hasAttributeNS(),hasAttributes(),hasPointerCapture(),id,innerHTML,insertAdjacentElement()," + + "insertAdjacentHTML(),insertAdjacentText(),lastElementChild,localName,matches()," + + "mozMatchesSelector(),mozRequestFullScreen(),namespaceURI,nextElementSibling,onfullscreenchange," + + "onfullscreenerror,outerHTML,prefix,prepend(),previousElementSibling,querySelector()," + + "querySelectorAll(),releaseCapture(),releasePointerCapture(),remove(),removeAttribute()," + + "removeAttributeNode(),removeAttributeNS(),replaceWith(),requestFullscreen(),requestPointerLock()," + + "scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollLeft,scrollLeftMax,scrollTo(),scrollTop," + + "scrollTopMax,scrollWidth,setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS()," + + "setCapture(),setPointerCapture(),shadowRoot,slot,tagName,toggleAttribute()," + + "webkitMatchesSelector()", + IE = "childElementCount,clientHeight,clientLeft,clientTop,clientWidth,constructor,firstElementChild," + + "getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect()," + + "getClientRects(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS()," + + "lastElementChild,msContentZoomFactor,msGetRegionContent(),msGetUntransformedBounds()," + + "msMatchesSelector(),msRegionOverflow,msReleasePointerCapture(),msRequestFullscreen()," + + "msSetPointerCapture(),nextElementSibling,ongotpointercapture,onlostpointercapture," + + "onmsgesturechange,onmsgesturedoubletap,onmsgestureend,onmsgesturehold,onmsgesturestart," + + "onmsgesturetap,onmsgotpointercapture,onmsinertiastart,onmslostpointercapture,onmspointercancel," + + "onmspointerdown,onmspointerenter,onmspointerleave,onmspointermove,onmspointerout,onmspointerover," + + "onmspointerup,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,previousElementSibling,querySelector(),querySelectorAll()," + + "releasePointerCapture(),removeAttribute(),removeAttributeNode(),removeAttributeNS(),scrollHeight," + + "scrollLeft,scrollTop,scrollWidth,setAttribute(),setAttributeNode(),setAttributeNodeNS()," + + "setAttributeNS(),setPointerCapture()," + + "tagName") + @HtmlUnitNYI(CHROME = "after(),attributes,before(),childElementCount,children,classList,className,clientHeight," + + "clientLeft,clientTop,clientWidth,constructor(),firstElementChild,getAttribute(),getAttributeNode()," + + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + + "getElementsByClassName()," + + "getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes(),id," + + "innerHTML,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),lastElementChild," + + "localName," + + "matches(),namespaceURI,nextElementSibling,onbeforecopy,onbeforecut,onbeforepaste,oncopy,oncut," + + "onpaste," + + "onsearch,onselectstart,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix," + + "previousElementSibling,querySelector(),querySelectorAll(),remove(),removeAttribute()," + + "removeAttributeNode(),removeAttributeNS(),replaceWith(),scrollHeight,scrollIntoView()," + + "scrollIntoViewIfNeeded(),scrollLeft,scrollTop,scrollWidth,setAttribute(),setAttributeNode()," + + "setAttributeNS(),tagName,webkitMatchesSelector()", + FF60 = "after(),attributes,before(),childElementCount,children,classList,className,clientHeight,clientLeft," + + "clientTop,clientWidth,constructor(),firstElementChild,getAttribute(),getAttributeNode()," + + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," + + "hasAttributeNS(),hasAttributes(),id,innerHTML,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),lastElementChild,localName,matches(),mozMatchesSelector(),namespaceURI," + + "nextElementSibling,outerHTML,prefix,previousElementSibling,querySelector(),querySelectorAll()," + + "releaseCapture(),remove(),removeAttribute(),removeAttributeNode(),removeAttributeNS()," + + "replaceWith(),scrollHeight,scrollIntoView(),scrollLeft,scrollTop,scrollWidth,setAttribute()," + + "setAttributeNode(),setAttributeNS(),setCapture(),tagName,webkitMatchesSelector()", + FF68 = "after(),attributes,before(),childElementCount,children,classList,className,clientHeight,clientLeft," + + "clientTop,clientWidth,constructor(),firstElementChild,getAttribute(),getAttributeNode()," + + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," + + "hasAttributeNS(),hasAttributes(),id,innerHTML,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),lastElementChild,localName,matches(),mozMatchesSelector(),namespaceURI," + + "nextElementSibling,outerHTML,prefix,previousElementSibling,querySelector(),querySelectorAll()," + + "releaseCapture(),remove(),removeAttribute(),removeAttributeNode(),removeAttributeNS(),replaceWith()," + + "scrollHeight,scrollIntoView(),scrollLeft,scrollTop,scrollWidth,setAttribute(),setAttributeNode()," + + "setAttributeNS(),setCapture(),tagName,webkitMatchesSelector()", + IE = "attributes,childElementCount,clientHeight,clientLeft,clientTop,clientWidth,constructor," + + "firstElementChild,getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS()," + + "getBoundingClientRect(),getClientRects(),getElementsByTagName(),getElementsByTagNameNS()," + + "hasAttribute(),hasAttributeNS(),lastElementChild,msMatchesSelector(),nextElementSibling," + + "ongotpointercapture,onlostpointercapture,onmsgesturechange,onmsgesturedoubletap,onmsgestureend," + + "onmsgesturehold,onmsgesturestart,onmsgesturetap,onmsgotpointercapture,onmsinertiastart," + + "onmslostpointercapture,onmspointercancel,onmspointerdown,onmspointerenter,onmspointerleave," + + "onmspointermove,onmspointerout,onmspointerover,onmspointerup,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup," + + "previousElementSibling,querySelector(),querySelectorAll(),removeAttribute(),removeAttributeNode()," + + "removeAttributeNS(),scrollHeight,scrollLeft,scrollTop,scrollWidth,setAttribute()," + + "setAttributeNode(),setAttributeNS(),tagName") + public void element() throws Exception { + testString("element"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "exception", + FF60 = "exception", + FF68 = "exception", + IE = "blockDirection,clipBottom,clipLeft,clipRight,clipTop,constructor,hasLayout") + @HtmlUnitNYI(IE = "accelerator,backgroundAttachment,backgroundColor,backgroundImage,backgroundPosition," + + "backgroundRepeat,borderBottomColor,borderBottomStyle,borderBottomWidth,borderLeftColor," + + "borderLeftStyle,borderLeftWidth,borderRightColor,borderRightStyle,borderRightWidth," + + "borderTopColor,borderTopStyle,borderTopWidth,bottom,color,constructor,cssFloat,cssText," + + "display,font,fontFamily,fontSize,getAttribute(),getPropertyPriority(),getPropertyValue()," + + "height,left,length,letterSpacing,lineHeight,margin,marginBottom,marginLeft,marginRight,marginTop," + + "maxHeight,maxWidth,minHeight,minWidth,opacity,orphans,outline,outlineWidth,padding," + + "paddingBottom,paddingLeft,paddingRight,paddingTop,pixelBottom,pixelHeight,pixelLeft," + + "pixelRight,pixelTop,pixelWidth,posBottom,posHeight,position,posLeft,posRight,posTop," + + "posWidth,removeAttribute(),removeProperty(),right,rubyAlign,setAttribute(),setProperty()," + + "textDecorationBlink,textDecorationLineThrough,textDecorationNone,textDecorationOverline," + + "textDecorationUnderline,textIndent,top,verticalAlign,widows,width,wordSpacing,zIndex") + public void currentStyle() throws Exception { + testString("document.body.currentStyle"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,composed,composedPath()," + + "constructor(),currentTarget,defaultPrevented,eventPhase,initEvent(),NONE,path,preventDefault()," + + "returnValue,srcElement,stopImmediatePropagation(),stopPropagation(),target,timeStamp," + + "type", + FF60 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,composed," + + "composedPath(),constructor(),CONTROL_MASK,currentTarget,defaultPrevented,eventPhase," + + "explicitOriginalTarget,initEvent(),META_MASK,NONE,originalTarget,preventDefault(),SHIFT_MASK," + + "stopImmediatePropagation(),stopPropagation(),target,timeStamp," + + "type", + FF68 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,composed," + + "composedPath(),constructor(),CONTROL_MASK,currentTarget,defaultPrevented,eventPhase," + + "explicitOriginalTarget,initEvent(),META_MASK,NONE,originalTarget,preventDefault(),returnValue," + + "SHIFT_MASK,srcElement,stopImmediatePropagation(),stopPropagation(),target,timeStamp," + + "type", + IE = "AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,constructor," + + "currentTarget,defaultPrevented,eventPhase,initEvent(),isTrusted,preventDefault(),srcElement," + + "stopImmediatePropagation(),stopPropagation(),target,timeStamp," + + "type") + @HtmlUnitNYI(CHROME = "AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,constructor()," + + "currentTarget,defaultPrevented,eventPhase,initEvent(),NONE,preventDefault(),returnValue," + + "srcElement,stopImmediatePropagation(),stopPropagation(),target,timeStamp,type", + FF60 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,constructor()," + + "CONTROL_MASK,currentTarget,defaultPrevented,eventPhase,initEvent(),META_MASK,NONE," + + "preventDefault(),SHIFT_MASK,stopImmediatePropagation(),stopPropagation(),target,timeStamp,type", + FF68 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,constructor()," + + "CONTROL_MASK,currentTarget,defaultPrevented,eventPhase,initEvent(),META_MASK,NONE,preventDefault()," + + "returnValue,SHIFT_MASK,srcElement,stopImmediatePropagation(),stopPropagation(),target," + + "timeStamp,type", + IE = "AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,constructor,currentTarget," + + "defaultPrevented,eventPhase,initEvent(),preventDefault(),srcElement,stopImmediatePropagation()," + + "stopPropagation(),target,timeStamp,type") + public void event() throws Exception { + testString("event ? event : window.event"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),PERSISTENT,TEMPORARY", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "addEventListener(),alert(),animationStartTime,applicationCache,atob(),blur(),btoa()," + + "cancelAnimationFrame(),captureEvents(),clearImmediate(),clearInterval(),clearTimeout()," + + "clientInformation,clipboardData,close(),closed,confirm(),console,constructor,defaultStatus," + + "devicePixelRatio,dispatchEvent(),document,doNotTrack,event,external,focus(),frameElement,frames," + + "getComputedStyle(),getSelection(),history,indexedDB,innerHeight,innerWidth,item(),length," + + "localStorage,location,matchMedia(),maxConnectionsPerServer,moveBy(),moveTo()," + + "msAnimationStartTime,msCancelRequestAnimationFrame(),msClearImmediate(),msCrypto,msIndexedDB," + + "msIsStaticHTML(),msMatchMedia(),msRequestAnimationFrame(),msSetImmediate(),msWriteProfilerMark()," + + "name,navigate(),navigator,offscreenBuffering,onabort,onafterprint,onbeforeprint,onbeforeunload," + + "onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,ondblclick,ondrag,ondragend," + + "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,onfocusin,onfocusout,onhashchange,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload()," + + "onloadeddata,onloadedmetadata,onloadstart,onmessage,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onmsgesturechange,onmsgesturedoubletap," + + "onmsgestureend,onmsgesturehold,onmsgesturestart,onmsgesturetap,onmsinertiastart," + + "onmspointercancel,onmspointerdown,onmspointerenter,onmspointerleave,onmspointermove," + + "onmspointerout,onmspointerover,onmspointerup,onoffline,ononline,onpagehide,onpageshow,onpause," + + "onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,onpopstate,onprogress,onratechange,onreadystatechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onstalled,onstorage,onsubmit,onsuspend," + + "ontimeupdate,onunload,onvolumechange,onwaiting,open(),opener,outerHeight,outerWidth,pageXOffset," + + "pageYOffset,parent,performance,postMessage(),print(),prompt(),releaseEvents()," + + "removeEv\u2026") + @HtmlUnitNYI(CHROME = "alert(),applicationCache,atob(),blur(),btoa(),cancelAnimationFrame(),captureEvents()," + + "clearInterval(),clearTimeout(),clientInformation,close(),closed,confirm(),console,constructor()," + + "crypto,devicePixelRatio,document,event,external,find(),focus(),frameElement,frames," + + "getComputedStyle()," + + "getSelection(),history,innerHeight,innerWidth,length,localStorage,location,matchMedia()," + + "moveBy(),moveTo()," + + "name,navigator,offscreenBuffering,onabort,onanimationend,onanimationiteration,onanimationstart," + + "onauxclick,onbeforeunload,onblur,oncancel,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncuechange,ondblclick,ondevicemotion,ondeviceorientation,ondeviceorientationabsolute," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied," + + "onended,onerror,onfocus,ongotpointercapture,onhashchange,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onlanguagechange,onload(),onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmessage,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmousewheel,onoffline,ononline,onpagehide,onpageshow,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerup,onpopstate,onprogress,onratechange,onrejectionhandled,onreset,onresize,onscroll," + + "onsearch,onseeked,onseeking,onselect,onshow,onstalled,onstorage,onsubmit,onsuspend,ontimeupdate," + + "ontoggle,ontransitionend,onunhandledrejection,onunload,onvolumechange,onwaiting," + + "onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend," + + "onwheel,open(),opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance," + + "PERSISTENT,postMessage(),print(),prompt(),releaseEvents(),requestAnimationFrame(),resizeBy()," + + "resizeTo(),screen,scroll(),scrollBy(),scrollTo(),scrollX,scrollY,self,sessionStorage,setInterval()," + + "setTimeout(),speechSynthesis,status,stop(),styleMedia,TEMPORARY,top,window", + FF60 = "alert(),applicationCache,atob(),blur(),btoa(),cancelAnimationFrame(),captureEvents()," + + "clearInterval()," + + "clearTimeout(),close(),closed,confirm(),console,constructor(),controllers,crypto,devicePixelRatio," + + "document,dump(),external,find(),focus(),frameElement,frames,getComputedStyle(),getSelection()," + + "history,innerHeight,innerWidth,length,localStorage,location,matchMedia(),moveBy(),moveTo()," + + "mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,netscape,onabort,onafterprint," + + "onbeforeprint,onbeforeunload,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "ondblclick,ondevicelight,ondevicemotion,ondeviceorientation,ondeviceproximity,ondrag,ondragend," + + "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,onhashchange,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onlanguagechange,onload()," + + "onloadeddata,onloadedmetadata,onloadstart,onmessage,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onoffline,ononline,onpagehide,onpageshow,onpause,onplay,onplaying,onpopstate,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onstorage," + + "onsubmit,onsuspend,ontimeupdate,onunload,onuserproximity,onvolumechange,onwaiting,onwheel,open()," + + "opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,postMessage(),print()," + + "prompt(),releaseEvents(),requestAnimationFrame(),resizeBy(),resizeTo(),screen,scroll(),scrollBy()," + + "scrollByLines(),scrollByPages(),scrollTo(),scrollX,scrollY,self,sessionStorage,setInterval()," + + "setTimeout(),status,stop(),top,window", + FF68 = "alert(),applicationCache,atob(),blur(),btoa(),cancelAnimationFrame(),captureEvents()," + + "clearInterval(),clearTimeout(),close(),closed,confirm(),console,constructor(),controllers," + + "crypto,devicePixelRatio,document,dump(),event,external,find(),focus(),frameElement,frames," + + "getComputedStyle(),getSelection(),history,innerHeight,innerWidth,length,localStorage,location," + + "matchMedia(),moveBy(),moveTo(),mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator," + + "netscape,onabort,onafterprint,onbeforeprint,onbeforeunload,onblur,oncanplay,oncanplaythrough," + + "onchange,onclick,oncontextmenu,ondblclick,ondevicelight,ondevicemotion,ondeviceorientation," + + "ondeviceproximity,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,onhashchange,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onlanguagechange,onload(),onloadeddata,onloadedmetadata,onloadstart," + + "onmessage,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmozfullscreenchange,onmozfullscreenerror,onoffline,ononline,onpagehide,onpageshow,onpause," + + "onplay,onplaying,onpopstate,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onstorage,onsubmit,onsuspend,ontimeupdate,onunload,onuserproximity," + + "onvolumechange,onwaiting,onwheel,open(),opener,outerHeight,outerWidth,pageXOffset,pageYOffset," + + "parent,performance,postMessage(),print(),prompt(),releaseEvents(),requestAnimationFrame()," + + "resizeBy(),resizeTo(),screen,scroll(),scrollBy(),scrollByLines(),scrollByPages(),scrollTo()," + + "scrollX,scrollY,self,sessionStorage,setInterval(),setTimeout(),status,stop(),top,window", + IE = "ActiveXObject,alert(),ANGLE_instanced_arrays,AnimationEvent,applicationCache,ApplicationCache," + + "Array(),ArrayBuffer(),atob(),Attr,Audio(),BeforeUnloadEvent,Blob(),blur(),Boolean()," + + "btoa(),Call(),CallSite(),cancelAnimationFrame(),CanvasGradient,CanvasPattern," + + "CanvasRenderingContext2D,captureEvents(),CDATASection,CharacterData,clearInterval()," + + "clearTimeout(),clientInformation,ClientRect,ClientRectList,clipboardData,close()," + + "closed,CloseEvent,CollectGarbage(),Comment,CompositionEvent,confirm(),console,Console," + + "constructor,Coordinates,Crypto,CSSFontFaceRule,CSSImportRule,CSSKeyframeRule," + + "CSSKeyframesRule,CSSMediaRule,CSSNamespaceRule,CSSPageRule,CSSRule,CSSRuleList," + + "CSSStyleDeclaration,CSSStyleRule,CSSStyleSheet,CustomEvent,DataTransfer,DataView()," + + "Date(),decodeURI(),decodeURIComponent(),devicePixelRatio,document,Document,DocumentFragment," + + "DocumentType,DOMError,DOMException,DOMImplementation,DOMParser(),DOMSettableTokenList," + + "DOMStringList,DOMStringMap,DOMTokenList,doNotTrack,DragEvent,Element,encodeURI()," + + "encodeURIComponent(),Enumerator(),Error(),ErrorEvent,escape(),eval(),EvalError(),event," + + "Event,EXT_texture_filter_anisotropic,external,File,FileList,FileReader(),Float32Array()," + + "Float64Array(),focus(),FocusEvent,FormData(),frameElement,frames,Function(),Geolocation," + + "getComputedStyle(),getSelection(),History,history,HTMLAllCollection,HTMLAnchorElement," + + "HTMLAppletElement,HTMLAreaElement,HTMLAudioElement,HTMLBaseElement,HTMLBaseFontElement," + + "HTMLBGSoundElement,HTMLBlockElement,HTMLBodyElement,HTMLBRElement,HTMLButtonElement," + + "HTMLCanvasElement,HTMLCollection,HTMLDataListElement,HTMLDDElement,HTMLDirectoryElement," + + "HTMLDivElement,HTMLDListElement,HTMLDocument,HTMLDTElement,HTMLElement,HTMLEmbedElement," + + "HTMLFieldSetElement,HTMLFontElement,HTMLFormElement,HTMLFrameElement,HTMLFrameSetElement," + + "HTMLHeadElement,HTMLHeadingElement,HTMLHRElement,HTMLHtmlElement,HTMLIFrameElement," + + "HTMLImageElement,HTMLInputElement,HTMLIsIndexElement,HTMLLabelElement,HTMLLegendElement," + + "HTMLLIElement,HTMLLinkElement,HTMLMapElement,HTMLMarqueeElement,HTMLMediaElement," + + "HTMLMenuElement,HTMLMetaElement,HTMLModElement,HTMLNextIdElement,HTMLObjectElement," + + "HTMLOListElement,HTMLOptGroupElement,HTMLOptionElement,HTMLParagraphElement,HTMLParamElement," + + "HTMLPhraseElement,HTMLPreElement,HTMLProgressElement,HTMLQuoteElement,HTMLScriptElement," + + "HTMLSelectElement,HTMLSourceElement,HTMLSpanElement,HTMLStyleElement,HTMLTableCaptionElement," + + "HTMLTableCellElement,HTMLTableColElement,HTMLTableDataCellElement,HTMLTableElement," + + "HTMLTableHeaderCellElement,HTMLTableRowElement,HTMLTableSectionElement,HTMLTextAreaElement," + + "HTMLTitleElement,HTMLTrackElement,HTMLUListElement,HTMLUnknownElement,HTMLVideoElement," + + "IDBCursor,IDBCursorWithValue,IDBDatabase,IDBFactory,IDBIndex,IDBKeyRange,IDBObjectStore," + + "IDBOpenDBRequest,IDBRequest,IDBTransaction,IDBVersionChangeEvent,Image(),ImageData,Infinity," + + "innerHeight,innerWidth,Int16Array(),Int32Array(),Int8Array(),InternalError(),Intl,isFinite()," + + "isNaN(),JavaException(),JSON,KeyboardEvent,length,localStorage,location,Location,Map()," + + "matchMedia(),Math,MediaError,MediaList,MediaQueryList,MessageChannel(),MessageEvent,MessagePort," + + "MimeType,MimeTypeArray,MouseEvent,MouseWheelEvent,moveBy(),moveTo(),MSGestureEvent,MutationEvent," + + "MutationObserver(),MutationRecord,name,NamedNodeMap,NaN,navigate(),navigator,Navigator,Node," + + "NodeFilter,NodeIterator,NodeList,Number(),Object(),OES_element_index_uint,OES_standard_derivatives," + + "OES_texture_float,OES_texture_float_linear,offscreenBuffering,onabort,onafterprint," + + "onbeforeprint,onbeforeunload,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout," + + "onhashchange,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload(),onloadeddata," + + "onloadedmetadata,onloadstart,onmessage,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onmsgesturechange," + + "onmsgesturedoubletap,onmsgestureend,onmsgesturehold,onmsgesturestart,onmsgesturetap," + + "onmsinertiastart,onmspointercancel,onmspointerdown,onmspointerenter,onmspointerleave," + + "onmspointermove,onmspointerout,onmspointerover,onmspointerup,onoffline,ononline,onpagehide," + + "onpageshow,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerup,onpopstate,onprogress,onratechange," + + "onreadystatechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onstalled,onstorage," + + "onsubmit,onsuspend,ontimeupdate,onunload,onvolumechange,onwaiting,open(),opener,Option()," + + "outerHeight,outerWidth,PageTransitionEvent,pageXOffset,pageYOffset,parent,parseFloat()," + + "parseInt(),performance,Performance,PerformanceEntry,PerformanceMark,PerformanceMeasure," + + "PerformanceNavigation,PerformanceNavigationTiming,PerformanceResourceTiming,PerformanceTiming," + + "Plugin,PluginArray,PointerEvent,PopStateEvent,Position,PositionError,postMessage(),print()," + + "process(),ProcessingInstruction,ProgressEvent,prompt(),Range,RangeError(),ReferenceError()," + + "RegExp(),releaseEvents(),requestAnimationFrame(),resizeBy(),resizeTo(),screen,Screen,Script()," + + "ScriptEngine(),ScriptEngineBuildVersion(),ScriptEngineMajorVersion(),ScriptEngineMinorVersion()," + + "scroll(),scrollBy(),scrollTo(),Selection,self,sessionStorage,Set(),setInterval(),setTimeout()," + + "showModalDialog(),showModelessDialog(),sortFunction(),status,Storage,StorageEvent,String()," + + "StyleMedia,styleMedia,StyleSheet,StyleSheetList,SubtleCrypto,SVGAElement,SVGAngle,SVGAnimatedAngle," + + "SVGAnimatedBoolean,SVGAnimatedEnumeration,SVGAnimatedInteger,SVGAnimatedLength," + + "SVGAnimatedLengthList," + + "SVGAnimatedNumber,SVGAnimatedNumberList,SVGAnimatedPreserveAspectRatio,SVGAnimatedRect," + + "SVGAnimatedString,SVGAnimatedTransformList,SVGCircleElement,SVGClipPathElement," + + "SVGComponentTransferFunctionElement,SVGDefsElement,SVGDescElement,SVGElement,SVGEllipseElement," + + "SVGFEBlendElement,SVGFEColorMatrixElement,SVGFEComponentTransferElement,SVGFECompositeElement," + + "SVGFEConvolveMatrixElement,SVGFEDiffuseLightingElement,SVGFEDisplacementMapElement," + + "SVGFEDistantLightElement,SVGFEFloodElement,SVGFEFuncAElement,SVGFEFuncBElement,SVGFEFuncGElement," + + "SVGFEFuncRElement,SVGFEGaussianBlurElement,SVGFEImageElement,SVGFEMergeElement," + + "SVGFEMergeNodeElement," + + "SVGFEMorphologyElement,SVGFEOffsetElement,SVGFEPointLightElement,SVGFESpecularLightingElement," + + "SVGFESpotLightElement,SVGFETileElement,SVGFETurbulenceElement,SVGFilterElement,SVGGElement," + + "SVGGradientElement,SVGImageElement,SVGLength,SVGLengthList,SVGLinearGradientElement,SVGLineElement," + + "SVGMarkerElement,SVGMaskElement,SVGMatrix,SVGMetadataElement,SVGNumber,SVGNumberList,SVGPathElement," + + "SVGPathSeg,SVGPathSegArcAbs,SVGPathSegArcRel,SVGPathSegClosePath,SVGPathSegCurvetoCubicAbs," + + "SVGPathSegCurvetoCubicRel,SVGPathSegCurvetoCubicSmoothAbs,SVGPathSegCurvetoCubicSmoothRel," + + "SVGPathSegCurvetoQuadraticAbs,SVGPathSegCurvetoQuadraticRel,SVGPathSegCurvetoQuadraticSmoothAbs," + + "SVGPathSegCurvetoQuadraticSmoothRel,SVGPathSegLinetoAbs,SVGPathSegLinetoHorizontalAbs," + + "SVGPathSegLinetoHorizontalRel,SVGPathSegLinetoRel,SVGPathSegLinetoVerticalAbs," + + "SVGPathSegLinetoVerticalRel,SVGPathSegList,SVGPathSegMovetoAbs,SVGPathSegMovetoRel," + + "SVGPatternElement,SVGPoint,SVGPointList,SVGPolygonElement,SVGPolylineElement," + + "SVGPreserveAspectRatio,SVGRadialGradientElement,SVGRect,SVGRectElement,SVGScriptElement," + + "SVGStopElement,SVGStringList,SVGStyleElement,SVGSVGElement,SVGSwitchElement,SVGSymbolElement," + + "SVGTextContentElement,SVGTextElement,SVGTextPathElement,SVGTextPositioningElement," + + "SVGTitleElement,SVGTransform,SVGTransformList,SVGTSpanElement,SVGUnitTypes,SVGUseElement," + + "SVGViewElement,SVGZoomEvent,SyntaxError(),test(),Text,TextEvent,TextMetrics,TextRange,TextTrack," + + "TextTrackCue(),TextTrackCueList,TextTrackList,TimeRanges,top,TrackEvent,TransitionEvent," + + "TreeWalker,TypeError(),UIEvent,Uint16Array(),Uint32Array(),Uint8Array(),Uint8ClampedArray()," + + "undefined,unescape(),URIError(),URL,ValidityState,WeakMap(),WEBGL_compressed_texture_s3tc," + + "WEBGL_debug_renderer_info,WebGLActiveInfo,WebGLBuffer,WebGLContextEvent(),WebGLFramebuffer," + + "WebGLProgram,WebGLRenderbuffer,WebGLRenderingContext,WebGLShader,WebGLShaderPrecisionFormat," + + "WebGLTexture,WebGLUniformLocation,WebSocket(),WheelEvent,window,Window,With(),Worker()," + + "XMLDocument,XMLHttpRequest(),XMLHttpRequestEventTarget,XMLSerializer()") + public void window() throws Exception { + testString("window"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlAbbreviated}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void abbr() throws Exception { + test("abbr"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlAcronym}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "constructor") + public void acronym() throws Exception { + test("acronym"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlAnchor}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "charset,constructor(),coords,download,hash,host,hostname,href,hreflang,name,origin,password," + + "pathname,ping,port,protocol,referrerPolicy,rel,relList,rev,search,shape,target,text,toString()," + + "type," + + "username", + FF60 = "charset,constructor(),coords,download,hash,host,hostname,href,hreflang,name,origin,password," + + "pathname,ping,port,protocol,referrerPolicy,rel,relList,rev,search,shape,target,text,toString()," + + "type," + + "username", + FF68 = "charset,constructor(),coords,download,hash,host,hostname,href,hreflang,name,origin,password," + + "pathname,ping,port,protocol,referrerPolicy,rel,relList,rev,search,shape,target,text,toString()," + + "type," + + "username", + IE = "charset,constructor,coords,hash,host,hostname,href,hreflang,Methods,mimeType,name,nameProp," + + "pathname,port,protocol,protocolLong,rel,rev,search,shape,target,text,toString(),type," + + "urn") + @HtmlUnitNYI(CHROME = "exception", + FF60 = "exception", + FF68 = "exception", + IE = "exception") + public void a() throws Exception { + test("a"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlAddress}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata," + + "onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit," + + "onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style," + + "tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange," + + "onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "clear,constructor,width") + public void address() throws Exception { + test("address"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlApplet}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor()", + IE = "align,alt,altHtml,archive,BaseHref,border,classid,code,codeBase,codeType,constructor," + + "contentDocument,data,declare,form,height,hspace,name,namedRecordset(),object,recordset,standby," + + "type,useMap,vspace," + + "width") + @HtmlUnitNYI(IE = "align,alt,border,classid,constructor,height,width") + public void applet() throws Exception { + test("applet"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlArea}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "alt,constructor(),coords,download,hash,host,hostname,href,noHref,origin,password,pathname,ping," + + "port,protocol,referrerPolicy,rel,relList,search,shape,target,toString()," + + "username", + FF60 = "alt,constructor(),coords,download,hash,host,hostname,href,noHref,origin,password,pathname,ping," + + "port,protocol,referrerPolicy,rel,relList,search,shape,target,toString()," + + "username", + FF68 = "alt,constructor(),coords,download,hash,host,hostname,href,noHref,origin,password,pathname,ping," + + "port,protocol,referrerPolicy,rel,relList,search,shape,target,toString()," + + "username", + IE = "alt,constructor,coords,hash,host,hostname,href,noHref,pathname,port,protocol,rel,search,shape," + + "target," + + "toString()") + @HtmlUnitNYI(CHROME = "alt,constructor(),coords", + FF60 = "exception", + FF68 = "exception", + IE = "alt,constructor,coords") + public void area() throws Exception { + test("area"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlArticle}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup," + + "onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement," + + "style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement," + + "spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout,onhelp," + + "oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onmscontentzoom," + + "onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture(),removeNode(),runtimeStyle," + + "scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void article() throws Exception { + test("article"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlAside}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag," + + "ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange," + + "onclick,oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend," + + "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended," + + "onerror,onfocus,onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload," + + "onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking," + + "onselect,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "outerHTML,parentElement,releaseCapture(),removeNode(),runtimeStyle,scrollIntoView(),setActive()," + + "setCapture(),style,tabIndex,title,uniqueID") + public void aside() throws Exception { + test("aside"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlAudio}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + @HtmlUnitNYI(CHROME = "constructor(),nodeName,nodeType", + FF60 = "constructor(),nodeName,nodeType", + FF68 = "constructor(),nodeName,nodeType", + IE = "constructor,nodeName,nodeType") + public void audio() throws Exception { + test("audio"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBackgroundSound}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "balance,constructor,loop,src,volume") + @HtmlUnitNYI(FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement," + + "spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title", + IE = "constructor") + public void bgsound() throws Exception { + test("bgsound"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBase}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),href,target", + FF60 = "constructor(),href,target", + FF68 = "constructor(),href,target", + IE = "constructor,href,target") + public void base() throws Exception { + test("base"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBaseFont}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "color,constructor,face,size") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel," + + "parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "parentElement,spellcheck,style,tabIndex,title") + public void basefont() throws Exception { + test("basefont"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBidirectionalIsolation}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "constructor()", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick," + + "onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture,oninput," + + "oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void bdi() throws Exception { + test("bdi"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBidirectionalOverride}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void bdo() throws Exception { + test("bdo"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBig}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void big() throws Exception { + test("big"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBlink}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(IE = "constructor") + public void blink() throws Exception { + test("blink"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBlockQuote}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "cite,constructor()", + FF60 = "cite,constructor()", + FF68 = "cite,constructor()", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(IE = "clear,constructor,width") + public void blockquote() throws Exception { + test("blockquote"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBody}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "aLink,background,bgColor,constructor(),link,onafterprint,onbeforeprint,onbeforeunload,onblur," + + "onerror,onfocus,onhashchange,onlanguagechange,onload(),onmessage,onmessageerror,onoffline," + + "ononline,onpagehide,onpageshow,onpopstate,onrejectionhandled,onresize,onscroll,onstorage," + + "onunhandledrejection,onunload,text," + + "vLink", + FF60 = "aLink,background,bgColor,constructor(),link,onafterprint,onbeforeprint,onbeforeunload," + + "onhashchange,onlanguagechange,onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow," + + "onpopstate,onstorage,onunload,text," + + "vLink", + FF68 = "aLink,background,bgColor,constructor(),link,onafterprint,onbeforeprint,onbeforeunload," + + "onhashchange,onlanguagechange,onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow," + + "onpopstate,onstorage,onunload,text," + + "vLink", + IE = "aLink,background,bgColor,bgProperties,bottomMargin,constructor,createTextRange(),leftMargin,link," + + "noWrap,onafterprint,onbeforeprint,onbeforeunload,onblur,onerror,onfocus,onhashchange,onload," + + "onmessage,onoffline,ononline,onpagehide,onpageshow,onpopstate,onresize,onstorage,onunload," + + "rightMargin,scroll,text,topMargin," + + "vLink") + @HtmlUnitNYI(CHROME = "aLink,background,bgColor,constructor(),link,onafterprint,onbeforeprint,onbeforeunload," + + "onhashchange,onlanguagechange,onmessage,onmessageerror,onoffline,ononline,onpagehide," + + "onpageshow,onpopstate,onrejectionhandled,onstorage,onunhandledrejection,onunload,text,vLink", + IE = "aLink,background,bgColor,constructor,createTextRange(),link,onafterprint,onbeforeprint," + + "onbeforeunload,onhashchange,onmessage,onoffline,ononline,onpagehide,onpageshow,onpopstate," + + "onresize,onstorage,onunload,text,vLink") + public void body() throws Exception { + test("body"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBold}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting," + + "onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void b() throws Exception { + test("b"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlBreak}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "clear,constructor()", + IE = "clear,constructor") + public void br() throws Exception { + test("br"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlButton}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "checkValidity(),constructor(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," + + "formTarget,labels,name,reportValidity(),setCustomValidity(),type,validationMessage,validity," + + "value,willValidate", + FF60 = "autofocus,checkValidity(),constructor(),disabled,form,formAction,formEnctype,formMethod," + + "formNoValidate,formTarget,labels,name,reportValidity(),setCustomValidity(),type," + + "validationMessage,validity,value,willValidate", + FF68 = "autofocus,checkValidity(),constructor(),disabled,form,formAction,formEnctype,formMethod," + + "formNoValidate,formTarget,labels,name,reportValidity(),setCustomValidity(),type," + + "validationMessage,validity,value,willValidate", + IE = "autofocus,checkValidity(),constructor,createTextRange(),form,formAction,formEnctype,formMethod," + + "formNoValidate,formTarget,name,setCustomValidity(),status,type,validationMessage,validity,value," + + "willValidate") + @HtmlUnitNYI(CHROME = "checkValidity(),constructor(),disabled,form,labels,name,type,value", + FF60 = "checkValidity(),constructor(),disabled,form,labels,name,type,value", + FF68 = "checkValidity(),constructor(),disabled,form,labels,name,type,value", + IE = "checkValidity(),constructor,createTextRange(),form,name,type,value") + public void button() throws Exception { + test("button"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlCanvas}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "captureStream(),constructor(),getContext(),height,toBlob()," + + "toDataURL(),transferControlToOffscreen(),width", + FF = "captureStream(),constructor(),getContext(),height," + + "mozGetAsFile(),mozOpaque,mozPrintCallback,toBlob(),toDataURL(),width") + @HtmlUnitNYI(CHROME = "constructor(),getContext(),height,toDataURL(),width", + FF60 = "constructor(),getContext(),height,toDataURL(),width", + FF68 = "constructor(),getContext(),height,toDataURL(),width", + IE = "constructor,getContext(),height,toDataURL(),width") + public void canvas() throws Exception { + test("canvas"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlCaption}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,constructor()", + FF60 = "align,constructor()", + FF68 = "align,constructor()", + IE = "align,constructor,vAlign") + public void caption() throws Exception { + test("caption"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlCenter}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "parentElement,spellcheck,style,tabIndex,title", + IE = "clear,constructor,width") + public void center() throws Exception { + test("center"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlCitation}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck," + + "style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style," + + "tabIndex,title", + IE = "constructor") + public void cite() throws Exception { + test("cite"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlCode}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "parentElement,spellcheck,style,tabIndex,title", + IE = "constructor") + public void code() throws Exception { + test("code"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlCommand}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void command() throws Exception { + test("command"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDataList}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),options", + FF60 = "constructor(),options", + FF68 = "constructor(),options", + IE = "constructor,options") + public void datalist() throws Exception { + test("datalist"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDefinition}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick," + + "onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture,oninput," + + "oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck," + + "style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style," + + "tabIndex,title", + IE = "constructor") + public void dfn() throws Exception { + test("dfn"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDefinitionDescription}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "constructor,noWrap") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting," + + "onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title") + public void dd() throws Exception { + test("dd"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDeletedText}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "cite,constructor(),dateTime", + FF60 = "cite,constructor(),dateTime", + FF68 = "cite,constructor(),dateTime", + IE = "cite,constructor,dateTime") + public void del() throws Exception { + test("del"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDetails}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),open", + FF60 = "constructor(),open", + FF68 = "constructor(),open", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void details() throws Exception { + test("details"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDialog}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "close(),constructor(),open,returnValue,show(),showModal()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "constructor()", + IE = "constructor") + public void dialog() throws Exception { + test("dialog"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDirectory}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "compact,constructor()", + FF60 = "compact,constructor()", + FF68 = "compact,constructor()", + IE = "compact,constructor,type") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void dir() throws Exception { + test("dir"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDivision}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,constructor()", + FF60 = "align,constructor()", + FF68 = "align,constructor()", + IE = "align,constructor,noWrap") + public void div() throws Exception { + test("div"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDefinitionList}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "compact,constructor()", + IE = "compact,constructor") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void dl() throws Exception { + test("dl"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlDefinitionTerm}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "constructor,noWrap") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize," + + "onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title") + public void dt() throws Exception { + test("dt"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlEmbed}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,constructor(),getSVGDocument(),height,name,src,type,width", + FF60 = "align,constructor(),getSVGDocument(),height,name,src,type,width", + FF68 = "align,constructor(),getSVGDocument(),height,name,src,type,width", + IE = "constructor,getSVGDocument(),height,hidden,msPlayToDisabled,msPlayToPreferredSourceUri," + + "msPlayToPrimary,name,palette,pluginspage,readyState,src,units," + + "width") + @HtmlUnitNYI(CHROME = "align,constructor(),height,name,width", + FF60 = "align,constructor(),height,name,width", + FF68 = "align,constructor(),height,name,width", + IE = "constructor,height,name,width") + public void embed() throws Exception { + test("embed"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlEmphasis}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void em() throws Exception { + test("em"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFieldSet}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "checkValidity(),constructor(),disabled,elements,form,name,reportValidity(),setCustomValidity()," + + "type,validationMessage,validity," + + "willValidate", + FF60 = "checkValidity(),constructor(),disabled,elements,form,name,reportValidity(),setCustomValidity()," + + "type,validationMessage,validity," + + "willValidate", + FF68 = "checkValidity(),constructor(),disabled,elements,form,name,reportValidity(),setCustomValidity()," + + "type,validationMessage,validity," + + "willValidate", + IE = "align,checkValidity(),constructor,form,setCustomValidity(),validationMessage,validity," + + "willValidate") + @HtmlUnitNYI(CHROME = "checkValidity(),constructor(),disabled,form,name", + FF60 = "checkValidity(),constructor(),disabled,form,name", + FF68 = "checkValidity(),constructor(),disabled,form,name", + IE = "align,checkValidity(),constructor,disabled,form") + public void fieldset() throws Exception { + test("fieldset"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFigureCaption}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting," + + "onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "parentElement,releaseCapture(),removeNode(),runtimeStyle,scrollIntoView(),setActive()," + + "setCapture(),style,tabIndex,title,uniqueID") + public void figcaption() throws Exception { + test("figcaption"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFigure}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName(),hasAttribute()," + + "hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText()," + + "isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft,offsetParent,offsetTop," + + "offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut,onbeforedeactivate," + + "onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncuechange," + + "oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout,onhelp,oninput," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onmscontentzoom," + + "onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture(),removeNode(),runtimeStyle," + + "scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void figure() throws Exception { + test("figure"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFont}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "color,constructor(),face,size", + FF60 = "color,constructor(),face,size", + FF68 = "color,constructor(),face,size", + IE = "color,constructor,face,size") + public void font() throws Exception { + test("font"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlForm}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "acceptCharset,action,autocomplete,checkValidity(),constructor(),elements,encoding,enctype,length," + + "method,name,noValidate,reportValidity(),requestSubmit(),reset(),submit()," + + "target", + FF60 = "acceptCharset,action,autocomplete,checkValidity(),constructor(),elements,encoding,enctype,length," + + "method,name,noValidate,reportValidity(),reset(),submit()," + + "target", + FF68 = "acceptCharset,action,autocomplete,checkValidity(),constructor(),elements,encoding,enctype,length," + + "method,name,noValidate,reportValidity(),reset(),submit()," + + "target", + IE = "acceptCharset,action,autocomplete,checkValidity(),constructor,elements,encoding,enctype,item()," + + "length,method,name,namedItem(),noValidate,reset(),submit(),tags(),target," + + "urns()") + @HtmlUnitNYI(CHROME = "action,checkValidity(),constructor(),elements,encoding,enctype,length,method," + + "name,reset(),submit(),target", + FF60 = "action,checkValidity(),constructor(),elements,encoding,enctype,length,method,name," + + "reset(),submit(),target", + FF68 = "action,checkValidity(),constructor(),elements,encoding,enctype,length,method,name," + + "reset(),submit(),target", + IE = "action,checkValidity(),constructor,elements,encoding,enctype,item(),length,method,name," + + "reset(),submit(),target") + public void form() throws Exception { + test("form"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFooter}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup," + + "onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement," + + "style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout,onhelp," + + "oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onmscontentzoom," + + "onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture(),removeNode(),runtimeStyle," + + "scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void footer() throws Exception { + test("footer"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFrame}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),contentDocument,contentWindow,frameBorder,longDesc,marginHeight,marginWidth,name," + + "noResize,scrolling," + + "src", + FF60 = "constructor(),contentDocument,contentWindow,frameBorder,longDesc,marginHeight,marginWidth,name," + + "noResize,scrolling," + + "src", + FF68 = "constructor(),contentDocument,contentWindow,frameBorder,longDesc,marginHeight,marginWidth,name," + + "noResize,scrolling," + + "src", + IE = "border,borderColor,constructor,contentDocument,contentWindow,frameBorder,frameSpacing," + + "getSVGDocument(),height,longDesc,marginHeight,marginWidth,name,noResize,onload,scrolling," + + "security,src," + + "width") + @HtmlUnitNYI(CHROME = "constructor(),contentDocument,contentWindow,name,src", + FF60 = "constructor(),contentDocument,contentWindow,name,src", + FF68 = "constructor(),contentDocument,contentWindow,name,src", + IE = "border,constructor,contentDocument,contentWindow,name,src") + public void frame() throws Exception { + test("frame"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlFrameSet}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "cols,constructor(),onafterprint,onbeforeprint,onbeforeunload,onblur,onerror,onfocus,onhashchange," + + "onlanguagechange,onload(),onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow," + + "onpopstate,onrejectionhandled,onresize,onscroll,onstorage,onunhandledrejection,onunload," + + "rows", + FF60 = "cols,constructor(),onafterprint,onbeforeprint,onbeforeunload,onhashchange,onlanguagechange," + + "onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow,onpopstate,onstorage,onunload," + + "rows", + FF68 = "cols,constructor(),onafterprint,onbeforeprint,onbeforeunload,onhashchange,onlanguagechange," + + "onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow,onpopstate,onstorage,onunload," + + "rows", + IE = "border,borderColor,cols,constructor,frameBorder,frameSpacing,name,onafterprint,onbeforeprint," + + "onbeforeunload,onblur,onerror,onfocus,onhashchange,onload,onmessage,onoffline,ononline," + + "onpagehide,onpageshow,onresize,onstorage,onunload," + + "rows") + @HtmlUnitNYI(CHROME = "cols,constructor(),onafterprint,onbeforeprint,onbeforeunload,onhashchange," + + "onlanguagechange,onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow,onpopstate," + + "onrejectionhandled,onstorage,onunhandledrejection,onunload,rows", + IE = "border,cols,constructor,onafterprint,onbeforeprint,onbeforeunload,onhashchange,onmessage," + + "onoffline,ononline,onpagehide,onpageshow,onresize,onstorage,onunload,rows") + public void frameset() throws Exception { + test("frameset"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHead}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,profile") + @HtmlUnitNYI(IE = "constructor") + public void head() throws Exception { + test("head"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeader}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel," + + "parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement," + + "spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin," + + "onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata," + + "onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying," + + "onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture()," + + "removeNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void header() throws Exception { + test("header"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeading1}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void h1() throws Exception { + test("h1"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeading2}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void h2() throws Exception { + test("h2"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeading3}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void h3() throws Exception { + test("h3"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeading4}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void h4() throws Exception { + test("h4"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeading5}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void h5() throws Exception { + test("h5"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHeading6}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void h6() throws Exception { + test("h6"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHorizontalRule}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,color,constructor(),noShade,size,width", + IE = "align,color,constructor,noShade,size,width") + @HtmlUnitNYI(CHROME = "align,color,constructor(),width", + FF60 = "align,color,constructor(),width", + FF68 = "align,color,constructor(),width", + IE = "align,color,constructor,width") + public void hr() throws Exception { + test("hr"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlHtml}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),version", + FF60 = "constructor(),version", + FF68 = "constructor(),version", + IE = "constructor,version") + public void html() throws Exception { + test("html"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlInlineFrame}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,allow,allowFullscreen,allowPaymentRequest,constructor(),contentDocument,contentWindow," + + "csp,featurePolicy,frameBorder,getSVGDocument(),height," + + "loading,longDesc,marginHeight,marginWidth,name," + + "referrerPolicy,sandbox,scrolling,src,srcdoc," + + "width", + FF60 = "align,allowFullscreen,allowPaymentRequest,constructor(),contentDocument,contentWindow," + + "frameBorder,getSVGDocument(),height,longDesc,marginHeight,marginWidth,name,referrerPolicy," + + "sandbox,scrolling,src,srcdoc," + + "width", + FF68 = "align,allowFullscreen,allowPaymentRequest,constructor(),contentDocument,contentWindow," + + "frameBorder,getSVGDocument(),height,longDesc,marginHeight,marginWidth,name,referrerPolicy," + + "sandbox,scrolling,src,srcdoc," + + "width", + IE = "align,border,constructor,contentDocument,contentWindow,frameBorder,frameSpacing,getSVGDocument()," + + "height,hspace,longDesc,marginHeight,marginWidth,name,noResize,onload,sandbox,scrolling,security," + + "src,vspace," + + "width") + @HtmlUnitNYI(CHROME = "align,constructor(),contentDocument,contentWindow,height,name,src,width", + FF60 = "align,constructor(),contentDocument,contentWindow,height,name,src,width", + FF68 = "align,constructor(),contentDocument,contentWindow,height,name,src,width", + IE = "align,border,constructor,contentDocument,contentWindow,height,name,src,width") + public void iframe() throws Exception { + test("iframe"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlInlineQuotation}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "cite,constructor()", + IE = "cite,constructor,dateTime") + public void q() throws Exception { + test("q"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlImage}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,alt,border,complete,constructor(),crossOrigin,currentSrc,decode(),decoding,height,hspace," + + "isMap,loading,longDesc,lowsrc,name,naturalHeight,naturalWidth,referrerPolicy,sizes,src,srcset," + + "useMap,vspace,width,x," + + "y", + FF60 = "align,alt,border,complete,constructor(),crossOrigin,currentSrc,height,hspace,isMap,longDesc," + + "lowsrc,name,naturalHeight,naturalWidth,referrerPolicy,sizes,src,srcset,useMap,vspace,width,x," + + "y", + FF68 = "align,alt,border,complete,constructor(),crossOrigin,currentSrc,decode(),decoding,height,hspace," + + "isMap,longDesc,lowsrc,name,naturalHeight,naturalWidth,referrerPolicy,sizes,src,srcset,useMap," + + "vspace,width,x," + + "y") + @HtmlUnitNYI(CHROME = "align,alt,border,complete,constructor(),height,name,naturalHeight,naturalWidth,src,width", + FF60 = "align,alt,border,complete,constructor(),height,name,naturalHeight,naturalWidth,src,width", + FF68 = "align,alt,border,complete,constructor(),height,name,naturalHeight,naturalWidth,src,width", + IE = "align,alt,border,complete,constructor(),height,name,naturalHeight,naturalWidth,src,width") + public void img() throws Exception { + test("img"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlImage}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "align,alt,border,complete,constructor,crossOrigin,dynsrc,fileCreatedDate,fileModifiedDate," + + "fileUpdatedDate,height,href,hspace,isMap,longDesc,loop,lowsrc,mimeType,msPlayToDisabled," + + "msPlayToPreferredSourceUri,msPlayToPrimary,name,nameProp,naturalHeight,naturalWidth,protocol,src," + + "start,useMap,vrml,vspace," + + "width") + @HtmlUnitNYI(FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "align,alt,border,complete,constructor(),height,name,naturalHeight,naturalWidth,src,width") + public void image() throws Exception { + test("image"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlInsertedText}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "cite,constructor(),dateTime", + FF60 = "cite,constructor(),dateTime", + FF68 = "cite,constructor(),dateTime") + @HtmlUnitNYI(IE = "cite,constructor,dateTime") + public void ins() throws Exception { + test("ins"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlIsIndex}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "action,constructor,form,prompt") + @HtmlUnitNYI(IE = "constructor") + public void isindex() throws Exception { + test("isindex"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlItalic}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void i() throws Exception { + test("i"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlKeyboard}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void kbd() throws Exception { + test("kbd"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor()", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(IE = "clear,constructor,width") + public void keygen() throws Exception { + test("keygen"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlLabel}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),control,form,htmlFor", + FF60 = "constructor(),control,form,htmlFor", + FF68 = "constructor(),control,form,htmlFor", + IE = "constructor,form,htmlFor") + public void label() throws Exception { + test("label"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlLayer}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup," + + "onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset,onresize," + + "onscroll," + + "onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle," + + "onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + IE = "constructor") + public void layer() throws Exception { + test("layer"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlLegend}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor(),form", + IE = "align,constructor,form") + public void legend() throws Exception { + test("legend"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlListing}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),width", + FF60 = "constructor(),width", + FF68 = "constructor(),width", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(IE = "clear,constructor,width") + public void listing() throws Exception { + test("listing"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlListItem}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),type,value", + FF60 = "constructor(),type,value", + FF68 = "constructor(),type,value", + IE = "constructor,type,value") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void li() throws Exception { + test("li"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlLink}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "as,charset,constructor(),crossOrigin,disabled,href,hreflang,imageSizes,imageSrcset,import," + + "integrity,media,referrerPolicy,rel,relList,rev,sheet,sizes,target,type", + FF60 = "as,charset,constructor(),crossOrigin,disabled,href,hreflang,integrity,media,referrerPolicy,rel," + + "relList,rev,sheet,sizes,target,type", + FF68 = "as,charset,constructor(),crossOrigin,disabled,href,hreflang,integrity,media,referrerPolicy,rel," + + "relList,rev,sheet,sizes,target,type", + IE = "charset,constructor,href,hreflang,media,rel,rev,sheet,target,type") + @HtmlUnitNYI(CHROME = "constructor(),disabled,href,rel,rev,type", + FF60 = "exception", + FF68 = "exception", + IE = "constructor,disabled,href,rel,rev,type") + public void link() throws Exception { + test("link"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMain}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting," + + "onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck," + + "style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style," + + "tabIndex,title", + IE = "constructor") + public void main() throws Exception { + test("main"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMap}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "areas,constructor(),name", + FF60 = "areas,constructor(),name", + FF68 = "areas,constructor(),name", + IE = "areas,constructor,name") + public void map() throws Exception { + test("map"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMark}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting," + + "onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin," + + "onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata," + + "onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying," + + "onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture()," + + "removeNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void mark() throws Exception { + test("mark"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMarquee}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "behavior,bgColor,constructor(),direction,height,hspace,loop,scrollAmount,scrollDelay,start()," + + "stop(),trueSpeed,vspace," + + "width", + FF60 = "align,constructor()", + FF68 = "behavior,bgColor,constructor(),direction,height,hspace,loop,onbounce,onfinish,onstart," + + "scrollAmount,scrollDelay,start(),stop(),trueSpeed,vspace," + + "width", + IE = "behavior,bgColor,constructor,direction,height,hspace,loop,onbounce,onfinish,onstart,scrollAmount," + + "scrollDelay,start(),stop(),trueSpeed,vspace," + + "width") + @HtmlUnitNYI(CHROME = "bgColor,constructor(),height,width", + FF68 = "constructor()", + IE = "bgColor,constructor,height,width") + public void marquee() throws Exception { + test("marquee"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMenu}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "compact,constructor()", + FF = "compact,constructor(),label,type", + IE = "compact,constructor,type") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor(),label,type", + FF68 = "constructor(),label,type", + IE = "constructor,type") + public void menu() throws Exception { + test("menu"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMenuItem}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "checked,constructor(),defaultChecked,disabled,icon,label,radiogroup,type", + FF68 = "checked,constructor(),defaultChecked,disabled,icon,label,radiogroup,type", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void menuitem() throws Exception { + test("menuitem"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMeta}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor(),content,httpEquiv,name,scheme", + IE = "charset,constructor,content,httpEquiv,name,scheme,url") + public void meta() throws Exception { + test("meta"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMeter}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),high,labels,low,max,min,optimum,value", + FF60 = "constructor(),high,labels,low,max,min,optimum,value", + FF68 = "constructor(),high,labels,low,max,min,optimum,value", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void meter() throws Exception { + test("meter"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlMultiColumn}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void multicol() throws Exception { + test("multicol"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNav}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting," + + "onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute()," + + "hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent,offsetTop," + + "offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy," + + "oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName(),hasAttribute()," + + "hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText()," + + "isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft,offsetParent,offsetTop," + + "offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut,onbeforedeactivate," + + "onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncuechange," + + "oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout,onhelp,oninput," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress," + + "onratechange,onreset,onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit," + + "onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture()," + + "removeNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void nav() throws Exception { + test("nav"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNextId}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor()", + IE = "constructor,n") + @HtmlUnitNYI(IE = "constructor") + public void nextid() throws Exception { + test("nextid"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNoBreak}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick," + + "onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture,oninput," + + "oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck," + + "style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled," + + "onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex," + + "title", + IE = "constructor") + public void nobr() throws Exception { + test("nobr"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNoEmbed}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload," + + "onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay," + + "onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll," + + "onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle," + + "onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "parentElement,spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking," + + "onselect,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "outerHTML,parentElement,releaseCapture(),removeNode(),runtimeStyle,scrollIntoView()," + + "setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void noembed() throws Exception { + test("noembed"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNoFrames}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style," + + "tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute()," + + "hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText()," + + "isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft,offsetParent,offsetTop," + + "offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut,onbeforedeactivate," + + "onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncuechange," + + "oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout,onhelp,oninput," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onmscontentzoom," + + "onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture(),removeNode(),runtimeStyle," + + "scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void noframes() throws Exception { + test("noframes"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNoLayer}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + IE = "constructor") + public void nolayer() throws Exception { + test("nolayer"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlNoScript}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel," + + "parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize," + + "onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut," + + "onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "parentElement,releaseCapture(),removeNode(),runtimeStyle,scrollIntoView(),setActive()," + + "setCapture(),style,tabIndex,title,uniqueID") + public void noscript() throws Exception { + test("noscript"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlObject}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,archive,border,checkValidity(),code,codeBase,codeType,constructor(),contentDocument," + + "contentWindow,data,declare,form,getSVGDocument(),height,hspace,name,reportValidity()," + + "setCustomValidity(),standby,type,useMap,validationMessage,validity,vspace,width," + + "willValidate", + FF60 = "align,archive,border,checkValidity(),code,codeBase,codeType,constructor(),contentDocument," + + "contentWindow,data,declare,form,getSVGDocument(),height,hspace,name,reportValidity()," + + "setCustomValidity(),standby,type,typeMustMatch,useMap,validationMessage,validity,vspace,width," + + "willValidate", + FF68 = "align,archive,border,checkValidity(),code,codeBase,codeType,constructor(),contentDocument," + + "contentWindow,data,declare,form,getSVGDocument(),height,hspace,name,reportValidity()," + + "setCustomValidity(),standby,type,useMap,validationMessage,validity,vspace,width," + + "willValidate", + IE = "align,alt,altHtml,archive,BaseHref,border,checkValidity(),classid,code,codeBase,codeType," + + "constructor,contentDocument,data,declare,form,getSVGDocument(),height,hspace,msPlayToDisabled," + + "msPlayToPreferredSourceUri,msPlayToPrimary,name,namedRecordset(),object,readyState,recordset," + + "setCustomValidity(),standby,type,useMap,validationMessage,validity,vspace,width," + + "willValidate") + @HtmlUnitNYI(CHROME = "align,border,checkValidity(),constructor(),form,height,name,width", + FF60 = "align,border,checkValidity(),constructor(),form,height,name,width", + FF68 = "align,border,checkValidity(),constructor(),form,height,name,width", + IE = "align,alt,border,checkValidity(),classid,constructor,form,height,name,width") + public void object() throws Exception { + test("object"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlOrderedList}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "compact,constructor(),reversed,start,type", + IE = "compact,constructor,start,type") + @HtmlUnitNYI(CHROME = "constructor(),type", + FF60 = "constructor(),type", + FF68 = "constructor(),type", + IE = "constructor,type") + public void ol() throws Exception { + test("ol"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlOptionGroup}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),disabled,label", + FF60 = "constructor(),disabled,label", + FF68 = "constructor(),disabled,label", + IE = "constructor,defaultSelected,form,index,label,selected,text,value") + @HtmlUnitNYI(IE = "constructor,disabled,label") + public void optgroup() throws Exception { + test("optgroup"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlOption}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor(),defaultSelected,disabled,form,index,label,selected,text,value", + IE = "constructor,defaultSelected,form,index,label,selected,text,value") + @HtmlUnitNYI(IE = "constructor,defaultSelected,disabled,form,index,label,selected,text,value") + public void option() throws Exception { + test("option"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlOutput}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "checkValidity(),constructor(),defaultValue,form,htmlFor,labels,name,reportValidity()," + + "setCustomValidity(),type,validationMessage,validity,value," + + "willValidate", + FF60 = "checkValidity(),constructor(),defaultValue,form,htmlFor,labels,name,reportValidity()," + + "setCustomValidity(),type,validationMessage,validity,value," + + "willValidate", + FF68 = "checkValidity(),constructor(),defaultValue,form,htmlFor,labels,name,reportValidity()," + + "setCustomValidity(),type,validationMessage,validity,value," + + "willValidate", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "checkValidity(),constructor(),labels,name", + FF60 = "checkValidity(),constructor(),labels,name", + FF68 = "checkValidity(),constructor(),labels,name", + IE = "constructor") + public void output() throws Exception { + test("output"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlParagraph}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "align,constructor()", + IE = "align,clear,constructor") + public void p() throws Exception { + test("p"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlParameter}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),name,type,value,valueType", + FF60 = "constructor(),name,type,value,valueType", + FF68 = "constructor(),name,type,value,valueType", + IE = "constructor,name,type,value,valueType") + public void param() throws Exception { + test("param"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlPlainText}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel," + + "parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement," + + "spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title", + IE = "clear,constructor,width") + public void plaintext() throws Exception { + test("plaintext"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlPreformattedText}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),width", + FF60 = "constructor(),width", + FF68 = "constructor(),width", + IE = "cite,clear,constructor,width") + public void pre() throws Exception { + test("pre"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlProgress}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor(),labels,max,position,value", + IE = "constructor,form,max,position,value") + @HtmlUnitNYI(CHROME = "constructor(),labels,max,value", + FF60 = "constructor(),labels,max,value", + FF68 = "constructor(),labels,max,value", + IE = "constructor,max,value") + public void progress() throws Exception { + test("progress"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlRp}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void rp() throws Exception { + test("rp"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlRt}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void rt() throws Exception { + test("rt"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlRuby}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel," + + "parentElement,style,tabIndex,title", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void ruby() throws Exception { + test("ruby"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlS}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void s() throws Exception { + test("s"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSample}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay," + + "onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement," + + "spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void samp() throws Exception { + test("samp"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlScript}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "async,charset,constructor(),crossOrigin,defer,event,htmlFor," + + "integrity,noModule,referrerPolicy,src,text,type", + FF60 = "async,charset,constructor(),crossOrigin,defer,event,htmlFor," + + "integrity,noModule,src,text,type", + FF68 = "async,charset,constructor(),crossOrigin,defer,event,htmlFor," + + "integrity,noModule,referrerPolicy,src,text,type", + IE = "async,charset,constructor,defer,event,htmlFor,src,text,type") + @HtmlUnitNYI(CHROME = "async,constructor(),src,text,type", + FF60 = "async,constructor(),src,text,type", + FF68 = "async,constructor(),src,text,type", + IE = "async,constructor,onreadystatechange,readyState,src,text,type") + public void script() throws Exception { + test("script"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSection}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag," + + "ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit," + + "onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement," + + "style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange," + + "onclick,oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput," + + "oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled," + + "onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement," + + "spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft," + + "offsetParent,offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange," + + "onclick,oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput," + + "oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled," + + "onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck," + + "style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName()," + + "hasAttribute(),hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML()," + + "insertAdjacentText(),isContentEditable,lang,language,mergeAttributes(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate," + + "onbeforecopy,onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay," + + "oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondeactivate,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout,onhelp,oninput," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress," + + "onratechange,onreset,onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit," + + "onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture()," + + "removeNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture(),style,tabIndex,title," + + "uniqueID") + public void section() throws Exception { + test("section"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSelect}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "add(),autocomplete,checkValidity(),constructor(),disabled,form,item(),labels,length,multiple," + + "name,namedItem(),options,remove(),reportValidity(),required,selectedIndex,selectedOptions," + + "setCustomValidity(),size,type,validationMessage,validity,value,willValidate", + FF60 = "add(),autocomplete,autofocus,checkValidity(),constructor(),disabled,form,item(),labels,length," + + "multiple,name,namedItem(),options,remove(),reportValidity(),required,selectedIndex," + + "selectedOptions,setCustomValidity(),size,type,validationMessage,validity,value," + + "willValidate", + FF68 = "add(),autocomplete,autofocus,checkValidity(),constructor(),disabled,form,item(),labels,length," + + "multiple,name,namedItem(),options,remove(),reportValidity(),required,selectedIndex," + + "selectedOptions,setCustomValidity(),size,type,validationMessage,validity,value," + + "willValidate", + IE = "add(),autofocus,checkValidity(),constructor,form,item(),length,multiple,name,namedItem(),options," + + "remove(),required,selectedIndex,setCustomValidity(),size,tags(),type,urns(),validationMessage," + + "validity,value,willValidate") + @HtmlUnitNYI(CHROME = "add(),checkValidity(),constructor(),disabled,form,item(),labels,length,multiple," + + "name,options,remove(),required,selectedIndex,size,type,value", + FF60 = "add(),checkValidity(),constructor(),disabled,form,item(),labels,length,multiple," + + "name,options,remove(),required,selectedIndex,size,type,value", + FF68 = "add(),checkValidity(),constructor(),disabled,form,item(),labels,length,multiple," + + "name,options,remove(),required,selectedIndex,size,type,value", + IE = "add(),checkValidity(),constructor,form,item(),length,multiple," + + "name,options,remove(),required,selectedIndex,size,type,value") + public void select() throws Exception { + test("select"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSmall}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "constructor") + public void small() throws Exception { + test("small"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSource}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),media,sizes,src,srcset,type", + FF60 = "constructor(),media,sizes,src,srcset,type", + FF68 = "constructor(),media,sizes,src,srcset,type", + IE = "constructor,media,src,type") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void source() throws Exception { + test("source"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSpan}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor()", + IE = "constructor") + public void span() throws Exception { + test("span"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlStrike}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void strike() throws Exception { + test("strike"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlStrong}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void strong() throws Exception { + test("strong"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlStyle}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),disabled,media,sheet,type", + FF60 = "constructor(),disabled,media,sheet,type", + FF68 = "constructor(),disabled,media,sheet,type", + IE = "constructor,media,sheet,type") + @HtmlUnitNYI(IE = "constructor,disabled,media,sheet,type") + public void style() throws Exception { + test("style"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSubscript}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void sub() throws Exception { + test("sub"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSummary}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "constructor") + public void summary() throws Exception { + test("summary"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSuperscript}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void sup() throws Exception { + test("sup"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSvg}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void svg() throws Exception { + test("svg"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTable}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,bgColor,border,caption,cellPadding,cellSpacing,constructor(),createCaption(),createTBody()," + + "createTFoot(),createTHead(),deleteCaption(),deleteRow(),deleteTFoot(),deleteTHead(),frame," + + "insertRow(),rows,rules,summary,tBodies,tFoot,tHead," + + "width", + FF60 = "align,bgColor,border,caption,cellPadding,cellSpacing,constructor(),createCaption(),createTBody()," + + "createTFoot(),createTHead(),deleteCaption(),deleteRow(),deleteTFoot(),deleteTHead(),frame," + + "insertRow(),rows,rules,summary,tBodies,tFoot,tHead," + + "width", + FF68 = "align,bgColor,border,caption,cellPadding,cellSpacing,constructor(),createCaption(),createTBody()," + + "createTFoot(),createTHead(),deleteCaption(),deleteRow(),deleteTFoot(),deleteTHead(),frame," + + "insertRow(),rows,rules,summary,tBodies,tFoot,tHead," + + "width", + IE = "align,background,bgColor,border,borderColor,borderColorDark,borderColorLight,caption,cellPadding," + + "cells,cellSpacing,cols,constructor,createCaption(),createTBody(),createTFoot(),createTHead()," + + "deleteCaption(),deleteRow(),deleteTFoot(),deleteTHead(),frame,height,insertRow(),moveRow(),rows," + + "rules,summary,tBodies,tFoot,tHead," + + "width") + @HtmlUnitNYI(CHROME = "bgColor,border,caption,cellPadding,cellSpacing,constructor(),createCaption(),createTBody()," + + "createTFoot(),createTHead(),deleteCaption(),deleteTFoot(),deleteTHead(),rules,summary,tBodies," + + "tFoot,tHead,width", + FF60 = "bgColor,border,caption,cellPadding,cellSpacing,constructor(),createCaption(),createTBody()," + + "createTFoot(),createTHead(),deleteCaption(),deleteTFoot(),deleteTHead(),rules,summary," + + "tBodies,tFoot,tHead,width", + FF68 = "bgColor,border,caption,cellPadding,cellSpacing,constructor(),createCaption(),createTBody()," + + "createTFoot(),createTHead(),deleteCaption(),deleteTFoot(),deleteTHead(),rules,summary," + + "tBodies,tFoot,tHead,width", + IE = "bgColor,border,borderColor,borderColorDark,borderColorLight,caption,cellPadding,cellSpacing," + + "constructor,createCaption(),createTBody(),createTFoot(),createTHead(),deleteCaption()," + + "deleteTFoot(),deleteTHead(),rules,summary,tBodies,tFoot,tHead,width") + public void table() throws Exception { + test("table"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableColumn}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,ch,chOff,constructor(),span,vAlign,width", + FF60 = "align,ch,chOff,constructor(),span,vAlign,width", + FF68 = "align,ch,chOff,constructor(),span,vAlign,width", + IE = "align,ch,chOff,constructor,span,vAlign,width") + @HtmlUnitNYI(CHROME = "constructor(),span,width", + FF60 = "constructor(),span,width", + FF68 = "constructor(),span,width", + IE = "constructor,span,width") + public void col() throws Exception { + test("col"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableColumnGroup}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,ch,chOff,constructor(),span,vAlign,width", + FF60 = "align,ch,chOff,constructor(),span,vAlign,width", + FF68 = "align,ch,chOff,constructor(),span,vAlign,width", + IE = "align,ch,chOff,constructor,span,vAlign,width") + @HtmlUnitNYI(CHROME = "constructor(),span,width", + FF60 = "constructor(),span,width", + FF68 = "constructor(),span,width", + IE = "constructor,span,width") + public void colgroup() throws Exception { + test("colgroup"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableBody}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + FF60 = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + FF68 = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + IE = "align,bgColor,ch,chOff,constructor,deleteRow(),insertRow(),moveRow(),rows,vAlign") + @HtmlUnitNYI(CHROME = "ch,chOff,constructor(),vAlign", + FF60 = "ch,chOff,constructor(),vAlign", + FF68 = "ch,chOff,constructor(),vAlign", + IE = "bgColor,ch,chOff,constructor,vAlign") + public void tbody() throws Exception { + test("tbody"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableDataCell}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "abbr,align,axis,bgColor,cellIndex,ch,chOff,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,vAlign," + + "width", + FF60 = "abbr,align,axis,bgColor,cellIndex,ch,chOff,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,vAlign," + + "width", + FF68 = "abbr,align,axis,bgColor,cellIndex,ch,chOff,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,vAlign," + + "width", + IE = "constructor") + @HtmlUnitNYI(CHROME = "abbr,axis,bgColor,cellIndex,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,width", + FF60 = "abbr,axis,bgColor,cellIndex,colSpan,constructor(),headers,height,noWrap,rowSpan,scope,width", + FF68 = "abbr,axis,bgColor,cellIndex,colSpan,constructor(),headers,height,noWrap,rowSpan,scope,width") + public void td() throws Exception { + test("td"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableHeaderCell}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "abbr,align,axis,bgColor,cellIndex,ch,chOff,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,vAlign," + + "width", + FF60 = "abbr,align,axis,bgColor,cellIndex,ch,chOff,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,vAlign," + + "width", + FF68 = "abbr,align,axis,bgColor,cellIndex,ch,chOff,colSpan,constructor(),headers,height,noWrap,rowSpan," + + "scope,vAlign," + + "width", + IE = "constructor,scope") + @HtmlUnitNYI(CHROME = "abbr,axis,bgColor,cellIndex,colSpan,constructor(),headers,height,noWrap,rowSpan,scope,width", + FF60 = "abbr,axis,bgColor,cellIndex,colSpan,constructor(),headers,height,noWrap,rowSpan,scope,width", + FF68 = "abbr,axis,bgColor,cellIndex,colSpan,constructor(),headers,height,noWrap,rowSpan,scope,width", + IE = "constructor") + public void th() throws Exception { + test("th"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableRow}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,bgColor,cells,ch,chOff,constructor(),deleteCell(),insertCell(),rowIndex,sectionRowIndex," + + "vAlign", + FF60 = "align,bgColor,cells,ch,chOff,constructor(),deleteCell(),insertCell(),rowIndex,sectionRowIndex," + + "vAlign", + FF68 = "align,bgColor,cells,ch,chOff,constructor(),deleteCell(),insertCell(),rowIndex,sectionRowIndex," + + "vAlign", + IE = "align,bgColor,borderColor,borderColorDark,borderColorLight,cells,ch,chOff,constructor," + + "deleteCell(),height,insertCell(),rowIndex,sectionRowIndex," + + "vAlign") + @HtmlUnitNYI(CHROME = "bgColor,cells,constructor(),deleteCell(),insertCell(),rowIndex,sectionRowIndex", + FF60 = "bgColor,cells,constructor(),deleteCell(),insertCell(),rowIndex,sectionRowIndex", + FF68 = "bgColor,cells,constructor(),deleteCell(),insertCell(),rowIndex,sectionRowIndex", + IE = "bgColor,borderColor,borderColorDark,borderColorLight,cells,constructor," + + "deleteCell(),insertCell(),rowIndex,sectionRowIndex") + public void tr() throws Exception { + test("tr"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTextArea}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "autocomplete,checkValidity(),cols,constructor(),defaultValue,dirName,disabled,form,labels," + + "maxLength,minLength,name,placeholder,readOnly,reportValidity(),required,rows,select()," + + "selectionDirection,selectionEnd,selectionStart,setCustomValidity(),setRangeText()," + + "setSelectionRange(),textLength,type,validationMessage,validity,value,willValidate," + + "wrap", + FF68 = "autocomplete,autofocus,checkValidity(),cols,constructor(),defaultValue,disabled,form," + + "labels,maxLength,minLength,name,placeholder," + + "readOnly,reportValidity(),required,rows,select(),selectionDirection,selectionEnd," + + "selectionStart,setCustomValidity(),setRangeText(),setSelectionRange()," + + "textLength,type,validationMessage,validity,value,willValidate,wrap", + FF60 = "autocomplete,autofocus,checkValidity(),cols,constructor(),defaultValue,disabled,form,labels," + + "maxLength,minLength,name,placeholder,readOnly,reportValidity(),required,rows,select()," + + "selectionDirection,selectionEnd,selectionStart,setCustomValidity(),setRangeText()," + + "setSelectionRange(),textLength,type,validationMessage,validity,value,willValidate," + + "wrap", + IE = "autofocus,checkValidity(),cols,constructor,createTextRange(),defaultValue,form,maxLength,name," + + "placeholder,readOnly,required,rows,select(),selectionEnd,selectionStart,setCustomValidity()," + + "setSelectionRange(),status,type,validationMessage,validity,value,willValidate," + + "wrap") + @HtmlUnitNYI(CHROME = "checkValidity(),cols,constructor(),defaultValue,disabled,form,labels," + + "maxLength,minLength,name,placeholder,readOnly,required,rows,select(),selectionEnd," + + "selectionStart,setSelectionRange(),textLength,type,value", + FF60 = "checkValidity(),cols,constructor(),defaultValue,disabled,form,labels,maxLength,minLength,name," + + "placeholder,readOnly,required,rows,select(),selectionEnd,selectionStart,setSelectionRange()," + + "textLength,type,value", + FF68 = "checkValidity(),cols,constructor(),defaultValue,disabled,form,labels,maxLength,minLength,name," + + "placeholder,readOnly,required,rows,select(),selectionEnd,selectionStart,setSelectionRange()," + + "textLength,type,value", + IE = "checkValidity(),cols,constructor,createTextRange(),defaultValue,form,maxLength,name,placeholder," + + "readOnly,required,rows,select(),selectionEnd,selectionStart,setSelectionRange(),type,value") + public void textarea() throws Exception { + test("textarea"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableFooter}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + FF60 = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + FF68 = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + IE = "align,bgColor,ch,chOff,constructor,deleteRow(),insertRow(),moveRow(),rows,vAlign") + @HtmlUnitNYI(CHROME = "ch,chOff,constructor(),vAlign", + FF60 = "ch,chOff,constructor(),vAlign", + FF68 = "ch,chOff,constructor(),vAlign", + IE = "bgColor,ch,chOff,constructor,vAlign") + public void tfoot() throws Exception { + test("tfoot"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTableHeader}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + FF60 = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + FF68 = "align,ch,chOff,constructor(),deleteRow(),insertRow(),rows,vAlign", + IE = "align,bgColor,ch,chOff,constructor,deleteRow(),insertRow(),moveRow(),rows,vAlign") + @HtmlUnitNYI(CHROME = "ch,chOff,constructor(),vAlign", + FF60 = "ch,chOff,constructor(),vAlign", + FF68 = "ch,chOff,constructor(),vAlign", + IE = "bgColor,ch,chOff,constructor,vAlign") + public void thead() throws Exception { + test("thead"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTeletype}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "onwheel,parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," + + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "onvolumechange,onwaiting,parentElement,spellcheck,style,tabIndex,title", + IE = "constructor") + public void tt() throws Exception { + test("tt"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTime}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor(),dateTime", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void time() throws Exception { + test("time"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTitle}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),text", + FF60 = "constructor(),text", + FF68 = "constructor(),text", + IE = "constructor,text") + public void title() throws Exception { + test("title"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTrack}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),default,ERROR,kind,label,LOADED,LOADING,NONE,readyState,src,srclang,track", + FF60 = "constructor(),default,ERROR,kind,label,LOADED,LOADING,NONE,readyState,src,srclang,track", + FF68 = "constructor(),default,ERROR,kind,label,LOADED,LOADING,NONE,readyState,src,srclang,track", + IE = "constructor,default,ERROR,kind,label,LOADED,LOADING,NONE,readyState,src,srclang,track") + @HtmlUnitNYI(CHROME = "constructor(),ERROR,LOADED,LOADING,NONE", + FF60 = "constructor(),ERROR,LOADED,LOADING,NONE", + FF68 = "constructor(),ERROR,LOADED,LOADING,NONE", + IE = "constructor,ERROR,LOADED,LOADING,NONE") + public void track() throws Exception { + test("track"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlUnderlined}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,parentElement," + + "spellcheck,style,tabIndex,title", + IE = "constructor") + public void u() throws Exception { + test("u"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlUnorderedList}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "compact,constructor(),type", + FF60 = "compact,constructor(),type", + FF68 = "compact,constructor(),type", + IE = "compact,constructor,type") + @HtmlUnitNYI(CHROME = "constructor(),type", + FF60 = "constructor(),type", + FF68 = "constructor(),type", + IE = "constructor,type") + public void ul() throws Exception { + test("ul"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlVariable}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "cite,constructor,dateTime") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate," + + "ontoggle,onvolumechange,onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,onvolumechange,onwaiting,onwheel,parentElement,spellcheck,style,tabIndex," + + "title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "parentElement,spellcheck,style,tabIndex,title", + IE = "constructor") + public void var() throws Exception { + test("var"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlVideo}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),disablePictureInPicture,height,onenterpictureinpicture,onleavepictureinpicture," + + "playsInline,poster,requestPictureInPicture(),videoHeight,videoWidth,webkitDecodedFrameCount," + + "webkitDisplayingFullscreen,webkitDroppedFrameCount,webkitEnterFullScreen()," + + "webkitEnterFullscreen(),webkitExitFullScreen(),webkitExitFullscreen(),webkitSupportsFullscreen," + + "width", + FF60 = "constructor(),getVideoPlaybackQuality(),height,mozDecodedFrames,mozFrameDelay,mozHasAudio," + + "mozPaintedFrames,mozParsedFrames,mozPresentedFrames,poster,videoHeight,videoWidth," + + "width", + FF68 = "constructor(),getVideoPlaybackQuality(),height,mozDecodedFrames,mozFrameDelay,mozHasAudio," + + "mozPaintedFrames,mozParsedFrames,mozPresentedFrames,poster,videoHeight,videoWidth," + + "width", + IE = "constructor,height,msZoom,poster,videoHeight,videoWidth,width") + @HtmlUnitNYI(CHROME = "constructor(),height,width", + FF60 = "constructor(),height,width", + FF68 = "constructor(),height,width", + IE = "constructor,height,width") + public void video() throws Exception { + test("video"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlWordBreak}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus,blur(),click(),constructor()," + + "contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden,innerText,inputMode," + + "isContentEditable,lang,nonce,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown," + + "onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange," + + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + + "outerText,spellcheck,style,tabIndex,title," + + "translate", + FF60 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + FF68 = "accessKey,accessKeyLabel,blur(),click(),constructor(),contentEditable,contextMenu,dataset,dir," + + "draggable,focus(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,spellcheck,style," + + "tabIndex," + + "title", + IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + + "clearAttributes(),click(),componentFromPoint(),constructor,contains(),contentEditable," + + "createControlRange(),currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus()," + + "getAdjacentText(),getElementsByClassName(),hidden,hideFocus,id,innerHTML,innerText," + + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),isContentEditable,isDisabled," + + "isMultiLine,isTextEdit,lang,language,mergeAttributes(),msGetInputContext(),offsetHeight," + + "offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy," + + "onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfocusin,onfocusout,onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," + + "onmouseover,onmouseup,onmousewheel,onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause," + + "onplay,onplaying,onprogress,onratechange,onreset,onscroll,onseeked,onseeking,onselect," + + "onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML," + + "outerText,parentElement,parentTextEdit,recordNumber,releaseCapture(),removeNode()," + + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," + + "uniqueNumber") + @HtmlUnitNYI(CHROME = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,parentElement,style,tabIndex,title", + FF60 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel," + + "parentElement,spellcheck,style,tabIndex,title", + FF68 = "accessKey,blur(),classList,click(),constructor(),contentEditable,dataset,dir,focus()," + + "hasAttribute(),hidden,innerText,isContentEditable,lang,offsetHeight,offsetLeft,offsetParent," + + "offsetTop,offsetWidth,onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," + + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting," + + "parentElement,spellcheck,style,tabIndex,title", + IE = "accessKey,blur(),children,classList,className,clearAttributes(),click(),constructor,contains()," + + "contentEditable,currentStyle,dataset,dir,disabled,focus(),getElementsByClassName(),hasAttribute()," + + "hidden,id,innerHTML,innerText,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText()," + + "isContentEditable,lang,language,mergeAttributes(),offsetHeight,offsetLeft,offsetParent,offsetTop," + + "offsetWidth,onabort,onactivate,onbeforeactivate,onbeforecopy,onbeforecut,onbeforedeactivate," + + "onbeforepaste,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy," + + "oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onfocusin,onfocusout," + + "onhelp,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," + + "onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress," + + "onratechange,onreset,onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit," + + "onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML,parentElement,releaseCapture()," + + "removeNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture(),style,tabIndex,title,uniqueID") + public void wbr() throws Exception { + test("wbr"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlExample}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),width", + FF60 = "constructor(),width", + FF68 = "constructor(),width", + IE = "cite,clear,constructor,width") + @HtmlUnitNYI(IE = "clear,constructor,width") + public void xmp() throws Exception { + test("xmp"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlInput}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "accept,align,alt,autocomplete,checked,checkValidity(),constructor(),defaultChecked,defaultValue," + + "dirName,disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget,height," + + "incremental,indeterminate,labels,list,max,maxLength,min,minLength,multiple,name,pattern," + + "placeholder,readOnly,reportValidity(),required,select(),selectionDirection,selectionEnd," + + "selectionStart,setCustomValidity(),setRangeText(),setSelectionRange(),size,src,step,stepDown()," + + "stepUp(),type,useMap,validationMessage,validity,value,valueAsDate,valueAsNumber,webkitdirectory," + + "webkitEntries,width," + + "willValidate", + FF60 = "accept,align,alt,autocomplete,autofocus,checked,checkValidity(),constructor(),defaultChecked," + + "defaultValue,disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget," + + "height,indeterminate,labels,list,max,maxLength,min,minLength,mozIsTextField(),multiple,name," + + "pattern,placeholder,readOnly,reportValidity(),required,select(),selectionDirection,selectionEnd," + + "selectionStart,setCustomValidity(),setRangeText(),setSelectionRange(),size,src,step,stepDown()," + + "stepUp(),textLength,type,useMap,validationMessage,validity,value,valueAsDate,valueAsNumber," + + "webkitdirectory,webkitEntries,width," + + "willValidate", + FF68 = "accept,align,alt,autocomplete,autofocus,checked,checkValidity(),constructor(),defaultChecked," + + "defaultValue,disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget," + + "height,indeterminate,labels,list,max,maxLength,min,minLength,mozIsTextField(),multiple,name," + + "pattern,placeholder,readOnly,reportValidity(),required,select(),selectionDirection,selectionEnd," + + "selectionStart,setCustomValidity(),setRangeText(),setSelectionRange(),size,src,step,stepDown()," + + "stepUp(),textLength,type,useMap,validationMessage,validity,value,valueAsDate,valueAsNumber," + + "webkitdirectory,webkitEntries,width," + + "willValidate", + IE = "accept,align,alt,autocomplete,autofocus,border,checked,checkValidity(),complete,constructor," + + "createTextRange(),defaultChecked,defaultValue,dynsrc,files,form,formAction,formEnctype," + + "formMethod,formNoValidate,formTarget,height,hspace,indeterminate,list,loop,lowsrc,max,maxLength," + + "min,multiple,name,pattern,placeholder,readOnly,required,select(),selectionEnd,selectionStart," + + "setCustomValidity(),setSelectionRange(),size,src,start,status,step,stepDown(),stepUp(),type," + + "useMap,validationMessage,validity,value,valueAsNumber,vrml,vspace,width," + + "willValidate") + @HtmlUnitNYI(CHROME = "accept,align,alt,autocomplete,checked,checkValidity(),constructor(),defaultChecked," + + "defaultValue,disabled,files,form,height,labels,max,maxLength,min,minLength,name,placeholder," + + "readOnly,required," + + "select(),selectionEnd,selectionStart,setSelectionRange(),size,src,step,type,value,width", + FF60 = "accept,align,alt,autocomplete,checked,checkValidity(),constructor(),defaultChecked," + + "defaultValue,disabled,files,form,height,labels,max,maxLength,min,minLength,name,placeholder," + + "readOnly,required," + + "select(),selectionEnd,selectionStart,setSelectionRange(),size,src,step,textLength,type,value,width", + FF68 = "accept,align,alt,autocomplete,checked,checkValidity(),constructor(),defaultChecked," + + "defaultValue,disabled,files,form,height,labels,max,maxLength,min,minLength,name,placeholder," + + "readOnly,required," + + "select(),selectionEnd,selectionStart,setSelectionRange(),size,src,step,textLength,type,value,width", + IE = "accept,align,alt,autocomplete,border,checked,checkValidity(),constructor,createTextRange()," + + "defaultChecked,defaultValue,files,form,height,max,maxLength,min,name,placeholder,readOnly,required," + + "select(),selectionEnd,selectionStart,setSelectionRange(),size,src,step,type,value,width") + public void input() throws Exception { + test("input"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlData}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),value", + FF60 = "constructor(),value", + FF68 = "constructor(),value", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void data() throws Exception { + test("data"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlContent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),getDistributedNodes(),select", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "constructor()", + IE = "constructor") + public void content() throws Exception { + test("content"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlPicture}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(IE = "constructor") + public void picutre() throws Exception { + test("picture"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlTemplate}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "constructor(),content", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI( + CHROME = "constructor(),content,innerHTML", + FF60 = "constructor(),content,innerHTML", + FF68 = "constructor(),content,innerHTML", + IE = "constructor") + public void template() throws Exception { + test("template"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.KeyboardEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "altKey,charCode,code,constructor(),ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT," + + "DOM_KEY_LOCATION_STANDARD,getModifierState(),initKeyboardEvent(),isComposing," + + "key,keyCode,location,metaKey,repeat," + + "shiftKey", + FF68 = "altKey,charCode,code,constructor(),ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,DOM_VK_0,DOM_VK_1,DOM_VK_2,DOM_VK_3,DOM_VK_4," + + "DOM_VK_5,DOM_VK_6,DOM_VK_7,DOM_VK_8,DOM_VK_9,DOM_VK_A,DOM_VK_ACCEPT,DOM_VK_ADD,DOM_VK_ALT," + + "DOM_VK_ALTGR,DOM_VK_AMPERSAND,DOM_VK_ASTERISK,DOM_VK_AT,DOM_VK_ATTN,DOM_VK_B,DOM_VK_BACK_QUOTE," + + "DOM_VK_BACK_SLASH,DOM_VK_BACK_SPACE,DOM_VK_C,DOM_VK_CANCEL,DOM_VK_CAPS_LOCK,DOM_VK_CIRCUMFLEX," + + "DOM_VK_CLEAR,DOM_VK_CLOSE_BRACKET,DOM_VK_CLOSE_CURLY_BRACKET,DOM_VK_CLOSE_PAREN,DOM_VK_COLON," + + "DOM_VK_COMMA,DOM_VK_CONTEXT_MENU,DOM_VK_CONTROL,DOM_VK_CONVERT,DOM_VK_CRSEL,DOM_VK_D," + + "DOM_VK_DECIMAL,DOM_VK_DELETE,DOM_VK_DIVIDE,DOM_VK_DOLLAR,DOM_VK_DOUBLE_QUOTE,DOM_VK_DOWN," + + "DOM_VK_E,DOM_VK_EISU,DOM_VK_END,DOM_VK_EQUALS,DOM_VK_EREOF,DOM_VK_ESCAPE,DOM_VK_EXCLAMATION," + + "DOM_VK_EXECUTE,DOM_VK_EXSEL,DOM_VK_F,DOM_VK_F1,DOM_VK_F10,DOM_VK_F11,DOM_VK_F12,DOM_VK_F13," + + "DOM_VK_F14,DOM_VK_F15,DOM_VK_F16,DOM_VK_F17,DOM_VK_F18,DOM_VK_F19,DOM_VK_F2,DOM_VK_F20,DOM_VK_F21," + + "DOM_VK_F22,DOM_VK_F23,DOM_VK_F24,DOM_VK_F3,DOM_VK_F4,DOM_VK_F5,DOM_VK_F6,DOM_VK_F7,DOM_VK_F8," + + "DOM_VK_F9,DOM_VK_FINAL,DOM_VK_G,DOM_VK_GREATER_THAN,DOM_VK_H,DOM_VK_HANGUL,DOM_VK_HANJA," + + "DOM_VK_HASH,DOM_VK_HELP,DOM_VK_HOME,DOM_VK_HYPHEN_MINUS,DOM_VK_I,DOM_VK_INSERT,DOM_VK_J," + + "DOM_VK_JUNJA,DOM_VK_K,DOM_VK_KANA,DOM_VK_KANJI,DOM_VK_L,DOM_VK_LEFT,DOM_VK_LESS_THAN,DOM_VK_M," + + "DOM_VK_META,DOM_VK_MODECHANGE,DOM_VK_MULTIPLY,DOM_VK_N,DOM_VK_NONCONVERT,DOM_VK_NUM_LOCK," + + "DOM_VK_NUMPAD0,DOM_VK_NUMPAD1,DOM_VK_NUMPAD2,DOM_VK_NUMPAD3,DOM_VK_NUMPAD4,DOM_VK_NUMPAD5," + + "DOM_VK_NUMPAD6,DOM_VK_NUMPAD7,DOM_VK_NUMPAD8,DOM_VK_NUMPAD9,DOM_VK_O,DOM_VK_OPEN_BRACKET," + + "DOM_VK_OPEN_CURLY_BRACKET,DOM_VK_OPEN_PAREN,DOM_VK_P,DOM_VK_PA1,DOM_VK_PAGE_DOWN,DOM_VK_PAGE_UP," + + "DOM_VK_PAUSE,DOM_VK_PERCENT,DOM_VK_PERIOD,DOM_VK_PIPE,DOM_VK_PLAY,DOM_VK_PLUS,DOM_VK_PRINT," + + "DOM_VK_PRINTSCREEN,DOM_VK_PROCESSKEY,DOM_VK_Q,DOM_VK_QUESTION_MARK,DOM_VK_QUOTE,DOM_VK_R," + + "DOM_VK_RETURN,DOM_VK_RIGHT,DOM_VK_S,DOM_VK_SCROLL_LOCK,DOM_VK_SELECT,DOM_VK_SEMICOLON," + + "DOM_VK_SEPARATOR,DOM_VK_SHIFT,DOM_VK_SLASH,DOM_VK_SLEEP,DOM_VK_SPACE,DOM_VK_SUBTRACT,DOM_VK_T," + + "DOM_VK_TAB,DOM_VK_TILDE,DOM_VK_U,DOM_VK_UNDERSCORE,DOM_VK_UP,DOM_VK_V,DOM_VK_VOLUME_DOWN," + + "DOM_VK_VOLUME_MUTE,DOM_VK_VOLUME_UP,DOM_VK_W,DOM_VK_WIN,DOM_VK_WIN_ICO_00,DOM_VK_WIN_ICO_CLEAR," + + "DOM_VK_WIN_ICO_HELP,DOM_VK_WIN_OEM_ATTN,DOM_VK_WIN_OEM_AUTO,DOM_VK_WIN_OEM_BACKTAB," + + "DOM_VK_WIN_OEM_CLEAR,DOM_VK_WIN_OEM_COPY,DOM_VK_WIN_OEM_CUSEL,DOM_VK_WIN_OEM_ENLW," + + "DOM_VK_WIN_OEM_FINISH,DOM_VK_WIN_OEM_FJ_JISHO,DOM_VK_WIN_OEM_FJ_LOYA,DOM_VK_WIN_OEM_FJ_MASSHOU," + + "DOM_VK_WIN_OEM_FJ_ROYA,DOM_VK_WIN_OEM_FJ_TOUROKU,DOM_VK_WIN_OEM_JUMP,DOM_VK_WIN_OEM_PA1," + + "DOM_VK_WIN_OEM_PA2,DOM_VK_WIN_OEM_PA3,DOM_VK_WIN_OEM_RESET,DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X," + + "DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM," + + "getModifierState(),initKeyboardEvent(),initKeyEvent(),isComposing," + + "key,keyCode,location,metaKey,repeat,shiftKey", + FF60 = "altKey,charCode,code,constructor(),ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,DOM_VK_0,DOM_VK_1,DOM_VK_2,DOM_VK_3,DOM_VK_4," + + "DOM_VK_5,DOM_VK_6,DOM_VK_7,DOM_VK_8,DOM_VK_9,DOM_VK_A,DOM_VK_ACCEPT,DOM_VK_ADD,DOM_VK_ALT," + + "DOM_VK_ALTGR,DOM_VK_AMPERSAND,DOM_VK_ASTERISK,DOM_VK_AT,DOM_VK_ATTN,DOM_VK_B,DOM_VK_BACK_QUOTE," + + "DOM_VK_BACK_SLASH,DOM_VK_BACK_SPACE,DOM_VK_C,DOM_VK_CANCEL,DOM_VK_CAPS_LOCK,DOM_VK_CIRCUMFLEX," + + "DOM_VK_CLEAR,DOM_VK_CLOSE_BRACKET,DOM_VK_CLOSE_CURLY_BRACKET,DOM_VK_CLOSE_PAREN,DOM_VK_COLON," + + "DOM_VK_COMMA,DOM_VK_CONTEXT_MENU,DOM_VK_CONTROL,DOM_VK_CONVERT,DOM_VK_CRSEL,DOM_VK_D," + + "DOM_VK_DECIMAL,DOM_VK_DELETE,DOM_VK_DIVIDE,DOM_VK_DOLLAR,DOM_VK_DOUBLE_QUOTE,DOM_VK_DOWN," + + "DOM_VK_E,DOM_VK_EISU,DOM_VK_END,DOM_VK_EQUALS,DOM_VK_EREOF,DOM_VK_ESCAPE,DOM_VK_EXCLAMATION," + + "DOM_VK_EXECUTE,DOM_VK_EXSEL,DOM_VK_F,DOM_VK_F1,DOM_VK_F10,DOM_VK_F11,DOM_VK_F12,DOM_VK_F13," + + "DOM_VK_F14,DOM_VK_F15,DOM_VK_F16,DOM_VK_F17,DOM_VK_F18,DOM_VK_F19,DOM_VK_F2,DOM_VK_F20," + + "DOM_VK_F21,DOM_VK_F22,DOM_VK_F23,DOM_VK_F24,DOM_VK_F3,DOM_VK_F4,DOM_VK_F5,DOM_VK_F6,DOM_VK_F7," + + "DOM_VK_F8,DOM_VK_F9,DOM_VK_FINAL,DOM_VK_G,DOM_VK_GREATER_THAN,DOM_VK_H,DOM_VK_HANGUL," + + "DOM_VK_HANJA,DOM_VK_HASH,DOM_VK_HELP,DOM_VK_HOME,DOM_VK_HYPHEN_MINUS,DOM_VK_I,DOM_VK_INSERT," + + "DOM_VK_J,DOM_VK_JUNJA,DOM_VK_K,DOM_VK_KANA,DOM_VK_KANJI,DOM_VK_L,DOM_VK_LEFT,DOM_VK_LESS_THAN," + + "DOM_VK_M,DOM_VK_META,DOM_VK_MODECHANGE,DOM_VK_MULTIPLY,DOM_VK_N,DOM_VK_NONCONVERT," + + "DOM_VK_NUM_LOCK,DOM_VK_NUMPAD0,DOM_VK_NUMPAD1,DOM_VK_NUMPAD2,DOM_VK_NUMPAD3,DOM_VK_NUMPAD4," + + "DOM_VK_NUMPAD5,DOM_VK_NUMPAD6,DOM_VK_NUMPAD7,DOM_VK_NUMPAD8,DOM_VK_NUMPAD9,DOM_VK_O," + + "DOM_VK_OPEN_BRACKET,DOM_VK_OPEN_CURLY_BRACKET,DOM_VK_OPEN_PAREN,DOM_VK_P,DOM_VK_PA1," + + "DOM_VK_PAGE_DOWN,DOM_VK_PAGE_UP,DOM_VK_PAUSE,DOM_VK_PERCENT,DOM_VK_PERIOD,DOM_VK_PIPE," + + "DOM_VK_PLAY,DOM_VK_PLUS,DOM_VK_PRINT,DOM_VK_PRINTSCREEN,DOM_VK_Q,DOM_VK_QUESTION_MARK," + + "DOM_VK_QUOTE,DOM_VK_R,DOM_VK_RETURN,DOM_VK_RIGHT,DOM_VK_S,DOM_VK_SCROLL_LOCK,DOM_VK_SELECT," + + "DOM_VK_SEMICOLON,DOM_VK_SEPARATOR,DOM_VK_SHIFT,DOM_VK_SLASH,DOM_VK_SLEEP,DOM_VK_SPACE," + + "DOM_VK_SUBTRACT,DOM_VK_T,DOM_VK_TAB,DOM_VK_TILDE,DOM_VK_U,DOM_VK_UNDERSCORE,DOM_VK_UP,DOM_VK_V," + + "DOM_VK_VOLUME_DOWN,DOM_VK_VOLUME_MUTE,DOM_VK_VOLUME_UP,DOM_VK_W,DOM_VK_WIN,DOM_VK_WIN_ICO_00," + + "DOM_VK_WIN_ICO_CLEAR,DOM_VK_WIN_ICO_HELP,DOM_VK_WIN_OEM_ATTN,DOM_VK_WIN_OEM_AUTO," + + "DOM_VK_WIN_OEM_BACKTAB,DOM_VK_WIN_OEM_CLEAR,DOM_VK_WIN_OEM_COPY,DOM_VK_WIN_OEM_CUSEL," + + "DOM_VK_WIN_OEM_ENLW,DOM_VK_WIN_OEM_FINISH,DOM_VK_WIN_OEM_FJ_JISHO,DOM_VK_WIN_OEM_FJ_LOYA," + + "DOM_VK_WIN_OEM_FJ_MASSHOU,DOM_VK_WIN_OEM_FJ_ROYA,DOM_VK_WIN_OEM_FJ_TOUROKU,DOM_VK_WIN_OEM_JUMP," + + "DOM_VK_WIN_OEM_PA1,DOM_VK_WIN_OEM_PA2,DOM_VK_WIN_OEM_PA3,DOM_VK_WIN_OEM_RESET," + + "DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X,DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM,getModifierState()," + + "initKeyboardEvent(),initKeyEvent(),isComposing,key,keyCode,location,metaKey,repeat,shiftKey") + @HtmlUnitNYI(CHROME = "altKey,charCode,code,constructor(),ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,key,keyCode,metaKey,shiftKey,which", + FF60 = "altKey,charCode,code,constructor(),ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,DOM_VK_0,DOM_VK_1,DOM_VK_2,DOM_VK_3,DOM_VK_4," + + "DOM_VK_5,DOM_VK_6,DOM_VK_7,DOM_VK_8,DOM_VK_9,DOM_VK_A,DOM_VK_ACCEPT,DOM_VK_ADD,DOM_VK_ALT," + + "DOM_VK_ALTGR,DOM_VK_AMPERSAND,DOM_VK_ASTERISK,DOM_VK_AT,DOM_VK_ATTN,DOM_VK_B,DOM_VK_BACK_QUOTE," + + "DOM_VK_BACK_SLASH,DOM_VK_BACK_SPACE,DOM_VK_C,DOM_VK_CANCEL,DOM_VK_CAPS_LOCK,DOM_VK_CIRCUMFLEX," + + "DOM_VK_CLEAR,DOM_VK_CLOSE_BRACKET,DOM_VK_CLOSE_CURLY_BRACKET,DOM_VK_CLOSE_PAREN,DOM_VK_COLON," + + "DOM_VK_COMMA,DOM_VK_CONTEXT_MENU,DOM_VK_CONTROL,DOM_VK_CONVERT,DOM_VK_CRSEL,DOM_VK_D,DOM_VK_DECIMAL," + + "DOM_VK_DELETE,DOM_VK_DIVIDE,DOM_VK_DOLLAR,DOM_VK_DOUBLE_QUOTE,DOM_VK_DOWN,DOM_VK_E,DOM_VK_EISU," + + "DOM_VK_END,DOM_VK_EQUALS,DOM_VK_EREOF,DOM_VK_ESCAPE,DOM_VK_EXCLAMATION,DOM_VK_EXECUTE,DOM_VK_EXSEL," + + "DOM_VK_F,DOM_VK_F1,DOM_VK_F10,DOM_VK_F11,DOM_VK_F12,DOM_VK_F13,DOM_VK_F14,DOM_VK_F15,DOM_VK_F16," + + "DOM_VK_F17,DOM_VK_F18,DOM_VK_F19,DOM_VK_F2,DOM_VK_F20,DOM_VK_F21,DOM_VK_F22,DOM_VK_F23,DOM_VK_F24," + + "DOM_VK_F3,DOM_VK_F4,DOM_VK_F5,DOM_VK_F6,DOM_VK_F7,DOM_VK_F8,DOM_VK_F9,DOM_VK_FINAL,DOM_VK_G," + + "DOM_VK_GREATER_THAN,DOM_VK_H,DOM_VK_HANGUL,DOM_VK_HANJA,DOM_VK_HASH,DOM_VK_HELP,DOM_VK_HOME," + + "DOM_VK_HYPHEN_MINUS,DOM_VK_I,DOM_VK_INSERT,DOM_VK_J,DOM_VK_JUNJA,DOM_VK_K,DOM_VK_KANA,DOM_VK_KANJI," + + "DOM_VK_L,DOM_VK_LEFT,DOM_VK_LESS_THAN,DOM_VK_M,DOM_VK_META,DOM_VK_MODECHANGE,DOM_VK_MULTIPLY," + + "DOM_VK_N,DOM_VK_NONCONVERT,DOM_VK_NUM_LOCK,DOM_VK_NUMPAD0,DOM_VK_NUMPAD1,DOM_VK_NUMPAD2," + + "DOM_VK_NUMPAD3," + + "DOM_VK_NUMPAD4,DOM_VK_NUMPAD5,DOM_VK_NUMPAD6,DOM_VK_NUMPAD7,DOM_VK_NUMPAD8,DOM_VK_NUMPAD9," + + "DOM_VK_O,DOM_VK_OPEN_BRACKET,DOM_VK_OPEN_CURLY_BRACKET,DOM_VK_OPEN_PAREN,DOM_VK_P,DOM_VK_PA1," + + "DOM_VK_PAGE_DOWN,DOM_VK_PAGE_UP,DOM_VK_PAUSE,DOM_VK_PERCENT,DOM_VK_PERIOD,DOM_VK_PIPE,DOM_VK_PLAY," + + "DOM_VK_PLUS,DOM_VK_PRINT,DOM_VK_PRINTSCREEN,DOM_VK_Q,DOM_VK_QUESTION_MARK,DOM_VK_QUOTE,DOM_VK_R," + + "DOM_VK_RETURN,DOM_VK_RIGHT,DOM_VK_S,DOM_VK_SCROLL_LOCK,DOM_VK_SELECT,DOM_VK_SEMICOLON," + + "DOM_VK_SEPARATOR," + + "DOM_VK_SHIFT,DOM_VK_SLASH,DOM_VK_SLEEP,DOM_VK_SPACE,DOM_VK_SUBTRACT,DOM_VK_T,DOM_VK_TAB," + + "DOM_VK_TILDE,DOM_VK_U,DOM_VK_UNDERSCORE,DOM_VK_UP,DOM_VK_V,DOM_VK_VOLUME_DOWN,DOM_VK_VOLUME_MUTE," + + "DOM_VK_VOLUME_UP,DOM_VK_W,DOM_VK_WIN,DOM_VK_WIN_ICO_00,DOM_VK_WIN_ICO_CLEAR,DOM_VK_WIN_ICO_HELP," + + "DOM_VK_WIN_OEM_ATTN,DOM_VK_WIN_OEM_AUTO,DOM_VK_WIN_OEM_BACKTAB,DOM_VK_WIN_OEM_CLEAR," + + "DOM_VK_WIN_OEM_COPY," + + "DOM_VK_WIN_OEM_CUSEL,DOM_VK_WIN_OEM_ENLW,DOM_VK_WIN_OEM_FINISH,DOM_VK_WIN_OEM_FJ_JISHO," + + "DOM_VK_WIN_OEM_FJ_LOYA,DOM_VK_WIN_OEM_FJ_MASSHOU,DOM_VK_WIN_OEM_FJ_ROYA,DOM_VK_WIN_OEM_FJ_TOUROKU," + + "DOM_VK_WIN_OEM_JUMP,DOM_VK_WIN_OEM_PA1,DOM_VK_WIN_OEM_PA2,DOM_VK_WIN_OEM_PA3,DOM_VK_WIN_OEM_RESET," + + "DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X,DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM,initKeyEvent(),key,keyCode,metaKey," + + "shiftKey,which", + FF68 = "altKey,charCode,code,constructor(),ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,DOM_VK_0,DOM_VK_1,DOM_VK_2,DOM_VK_3,DOM_VK_4," + + "DOM_VK_5,DOM_VK_6,DOM_VK_7,DOM_VK_8,DOM_VK_9,DOM_VK_A,DOM_VK_ACCEPT,DOM_VK_ADD,DOM_VK_ALT," + + "DOM_VK_ALTGR,DOM_VK_AMPERSAND,DOM_VK_ASTERISK,DOM_VK_AT,DOM_VK_ATTN,DOM_VK_B,DOM_VK_BACK_QUOTE," + + "DOM_VK_BACK_SLASH,DOM_VK_BACK_SPACE,DOM_VK_C,DOM_VK_CANCEL,DOM_VK_CAPS_LOCK,DOM_VK_CIRCUMFLEX," + + "DOM_VK_CLEAR,DOM_VK_CLOSE_BRACKET,DOM_VK_CLOSE_CURLY_BRACKET,DOM_VK_CLOSE_PAREN,DOM_VK_COLON," + + "DOM_VK_COMMA,DOM_VK_CONTEXT_MENU,DOM_VK_CONTROL,DOM_VK_CONVERT,DOM_VK_CRSEL,DOM_VK_D," + + "DOM_VK_DECIMAL,DOM_VK_DELETE,DOM_VK_DIVIDE,DOM_VK_DOLLAR,DOM_VK_DOUBLE_QUOTE,DOM_VK_DOWN," + + "DOM_VK_E,DOM_VK_EISU,DOM_VK_END,DOM_VK_EQUALS,DOM_VK_EREOF,DOM_VK_ESCAPE,DOM_VK_EXCLAMATION," + + "DOM_VK_EXECUTE,DOM_VK_EXSEL,DOM_VK_F,DOM_VK_F1,DOM_VK_F10,DOM_VK_F11,DOM_VK_F12,DOM_VK_F13," + + "DOM_VK_F14,DOM_VK_F15,DOM_VK_F16,DOM_VK_F17,DOM_VK_F18,DOM_VK_F19,DOM_VK_F2,DOM_VK_F20,DOM_VK_F21," + + "DOM_VK_F22,DOM_VK_F23,DOM_VK_F24,DOM_VK_F3,DOM_VK_F4,DOM_VK_F5,DOM_VK_F6,DOM_VK_F7,DOM_VK_F8," + + "DOM_VK_F9,DOM_VK_FINAL,DOM_VK_G,DOM_VK_GREATER_THAN,DOM_VK_H,DOM_VK_HANGUL,DOM_VK_HANJA," + + "DOM_VK_HASH,DOM_VK_HELP,DOM_VK_HOME,DOM_VK_HYPHEN_MINUS,DOM_VK_I,DOM_VK_INSERT,DOM_VK_J," + + "DOM_VK_JUNJA,DOM_VK_K,DOM_VK_KANA,DOM_VK_KANJI,DOM_VK_L,DOM_VK_LEFT,DOM_VK_LESS_THAN,DOM_VK_M," + + "DOM_VK_META,DOM_VK_MODECHANGE,DOM_VK_MULTIPLY,DOM_VK_N,DOM_VK_NONCONVERT,DOM_VK_NUM_LOCK," + + "DOM_VK_NUMPAD0,DOM_VK_NUMPAD1,DOM_VK_NUMPAD2,DOM_VK_NUMPAD3,DOM_VK_NUMPAD4,DOM_VK_NUMPAD5," + + "DOM_VK_NUMPAD6,DOM_VK_NUMPAD7,DOM_VK_NUMPAD8,DOM_VK_NUMPAD9,DOM_VK_O,DOM_VK_OPEN_BRACKET," + + "DOM_VK_OPEN_CURLY_BRACKET,DOM_VK_OPEN_PAREN,DOM_VK_P,DOM_VK_PA1,DOM_VK_PAGE_DOWN,DOM_VK_PAGE_UP," + + "DOM_VK_PAUSE,DOM_VK_PERCENT,DOM_VK_PERIOD,DOM_VK_PIPE,DOM_VK_PLAY,DOM_VK_PLUS,DOM_VK_PRINT," + + "DOM_VK_PRINTSCREEN,DOM_VK_PROCESSKEY,DOM_VK_Q,DOM_VK_QUESTION_MARK,DOM_VK_QUOTE,DOM_VK_R," + + "DOM_VK_RETURN,DOM_VK_RIGHT,DOM_VK_S,DOM_VK_SCROLL_LOCK,DOM_VK_SELECT,DOM_VK_SEMICOLON," + + "DOM_VK_SEPARATOR,DOM_VK_SHIFT,DOM_VK_SLASH,DOM_VK_SLEEP,DOM_VK_SPACE,DOM_VK_SUBTRACT," + + "DOM_VK_T,DOM_VK_TAB,DOM_VK_TILDE,DOM_VK_U,DOM_VK_UNDERSCORE,DOM_VK_UP,DOM_VK_V,DOM_VK_VOLUME_DOWN," + + "DOM_VK_VOLUME_MUTE,DOM_VK_VOLUME_UP,DOM_VK_W,DOM_VK_WIN,DOM_VK_WIN_ICO_00,DOM_VK_WIN_ICO_CLEAR," + + "DOM_VK_WIN_ICO_HELP,DOM_VK_WIN_OEM_ATTN,DOM_VK_WIN_OEM_AUTO,DOM_VK_WIN_OEM_BACKTAB," + + "DOM_VK_WIN_OEM_CLEAR,DOM_VK_WIN_OEM_COPY,DOM_VK_WIN_OEM_CUSEL,DOM_VK_WIN_OEM_ENLW," + + "DOM_VK_WIN_OEM_FINISH,DOM_VK_WIN_OEM_FJ_JISHO,DOM_VK_WIN_OEM_FJ_LOYA,DOM_VK_WIN_OEM_FJ_MASSHOU," + + "DOM_VK_WIN_OEM_FJ_ROYA,DOM_VK_WIN_OEM_FJ_TOUROKU,DOM_VK_WIN_OEM_JUMP,DOM_VK_WIN_OEM_PA1," + + "DOM_VK_WIN_OEM_PA2,DOM_VK_WIN_OEM_PA3,DOM_VK_WIN_OEM_RESET,DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X," + + "DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM,initKeyEvent(),key,keyCode,metaKey,shiftKey,which", + IE = "altKey,char,charCode,constructor,ctrlKey,DOM_KEY_LOCATION_JOYSTICK,DOM_KEY_LOCATION_LEFT," + + "DOM_KEY_LOCATION_MOBILE,DOM_KEY_LOCATION_NUMPAD,DOM_KEY_LOCATION_RIGHT," + + "DOM_KEY_LOCATION_STANDARD,key,keyCode,metaKey,shiftKey,which") + public void keyboardEvent() throws Exception { + testString("document.createEvent('KeyboardEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.UIEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),detail,initUIEvent(),sourceCapabilities,view,which", + FF60 = "constructor(),detail,initUIEvent(),layerX,layerY,pageX,pageY,rangeOffset,rangeParent," + + "SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view," + + "which", + FF68 = "constructor(),detail,initUIEvent(),layerX,layerY,pageX,pageY,rangeOffset,rangeParent," + + "SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view," + + "which", + IE = "constructor,detail,initUIEvent(),view") + @HtmlUnitNYI(CHROME = "constructor(),detail,initUIEvent(),view", + FF60 = "constructor(),detail,initUIEvent(),SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view", + FF68 = "constructor(),detail,initUIEvent(),SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view") + public void uiEvent() throws Exception { + testString("document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.DragEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),dataTransfer", + FF60 = "constructor(),dataTransfer,initDragEvent()", + FF68 = "constructor(),dataTransfer,initDragEvent()", + IE = "constructor,dataTransfer,initDragEvent(),msConvertURL()") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void dragEvent() throws Exception { + testString("document.createEvent('DragEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.PointerEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),getCoalescedEvents(),getPredictedEvents(),height," + + "isPrimary,pointerId,pointerType,pressure," + + "tangentialPressure,tiltX,tiltY,twist,width", + FF = "constructor(),getCoalescedEvents(),height,isPrimary,pointerId,pointerType,pressure," + + "tangentialPressure,tiltX,tiltY,twist,width") + @HtmlUnitNYI(CHROME = "constructor(),height,isPrimary,pointerId,pointerType," + + "pressure,tiltX,tiltY,width", + FF60 = "constructor(),height,isPrimary,pointerId,pointerType,pressure," + + "tiltX,tiltY,width", + FF68 = "constructor(),height,isPrimary,pointerId,pointerType,pressure," + + "tiltX,tiltY,width", + IE = "exception") + public void pointerEvent() throws Exception { + testString("new PointerEvent('click')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.PointerEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "exception", + FF68 = "exception", + FF60 = "exception", + IE = "constructor,height,hwTimestamp,initPointerEvent(),isPrimary,pointerId,pointerType,pressure," + + "rotation,tiltX,tiltY," + + "width") + @HtmlUnitNYI(IE = "constructor,height,initPointerEvent(),isPrimary,pointerId,pointerType,pressure," + + "tiltX,tiltY,width") + public void pointerEvent2() throws Exception { + testString(" document.createEvent('PointerEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.WheelEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF68 = "exception", + FF60 = "exception", + CHROME = "constructor(),deltaMode,deltaX,deltaY,deltaZ,DOM_DELTA_LINE,DOM_DELTA_PAGE,DOM_DELTA_PIXEL," + + "wheelDelta,wheelDeltaX," + + "wheelDeltaY", + IE = "constructor,deltaMode,deltaX,deltaY,deltaZ,DOM_DELTA_LINE,DOM_DELTA_PAGE,DOM_DELTA_PIXEL," + + "initWheelEvent()") + @HtmlUnitNYI(CHROME = "constructor(),DOM_DELTA_LINE,DOM_DELTA_PAGE,DOM_DELTA_PIXEL", + IE = "constructor,DOM_DELTA_LINE,DOM_DELTA_PAGE,DOM_DELTA_PIXEL") + public void wheelEvent() throws Exception { + testString("document.createEvent('WheelEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.MouseEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "altKey,button,buttons,clientX,clientY,constructor(),ctrlKey,fromElement,getModifierState()," + + "initMouseEvent(),layerX,layerY,metaKey,movementX,movementY,offsetX,offsetY,pageX,pageY," + + "relatedTarget,screenX,screenY,shiftKey,toElement,x," + + "y", + FF60 = "altKey,button,buttons,clientX,clientY,constructor(),ctrlKey,getModifierState(),initMouseEvent()," + + "initNSMouseEvent(),metaKey,movementX,movementY,MOZ_SOURCE_CURSOR,MOZ_SOURCE_ERASER," + + "MOZ_SOURCE_KEYBOARD,MOZ_SOURCE_MOUSE,MOZ_SOURCE_PEN,MOZ_SOURCE_TOUCH,MOZ_SOURCE_UNKNOWN," + + "mozInputSource,mozPressure,offsetX,offsetY,region,relatedTarget,screenX,screenY,shiftKey,x," + + "y", + FF68 = "altKey,button,buttons,clientX,clientY,constructor(),ctrlKey,getModifierState(),initMouseEvent()," + + "initNSMouseEvent(),metaKey,movementX,movementY,MOZ_SOURCE_CURSOR,MOZ_SOURCE_ERASER," + + "MOZ_SOURCE_KEYBOARD,MOZ_SOURCE_MOUSE,MOZ_SOURCE_PEN,MOZ_SOURCE_TOUCH,MOZ_SOURCE_UNKNOWN," + + "mozInputSource,mozPressure,offsetX,offsetY,region,relatedTarget,screenX,screenY,shiftKey,x," + + "y", + IE = "altKey,button,buttons,clientX,clientY,constructor,ctrlKey,fromElement,getModifierState()," + + "initMouseEvent(),layerX,layerY,metaKey,offsetX,offsetY,pageX,pageY,relatedTarget,screenX,screenY," + + "shiftKey,toElement,which,x," + + "y") + @HtmlUnitNYI(CHROME = "altKey,button,clientX,clientY,constructor(),ctrlKey,initMouseEvent(),metaKey," + + "pageX,pageY,screenX,screenY,shiftKey,which", + FF60 = "altKey,button,clientX,clientY,constructor(),ctrlKey,initMouseEvent(),metaKey,MOZ_SOURCE_CURSOR," + + "MOZ_SOURCE_ERASER,MOZ_SOURCE_KEYBOARD,MOZ_SOURCE_MOUSE,MOZ_SOURCE_PEN,MOZ_SOURCE_TOUCH," + + "MOZ_SOURCE_UNKNOWN,pageX,pageY,screenX,screenY,shiftKey,which", + FF68 = "altKey,button,clientX,clientY,constructor(),ctrlKey,initMouseEvent(),metaKey,MOZ_SOURCE_CURSOR," + + "MOZ_SOURCE_ERASER,MOZ_SOURCE_KEYBOARD,MOZ_SOURCE_MOUSE,MOZ_SOURCE_PEN,MOZ_SOURCE_TOUCH," + + "MOZ_SOURCE_UNKNOWN,pageX,pageY,screenX,screenY,shiftKey,which", + IE = "altKey,button,clientX,clientY,constructor,ctrlKey,initMouseEvent(),metaKey,pageX,pageY," + + "screenX,screenY,shiftKey,which") + public void mouseEvent() throws Exception { + testString("document.createEvent('MouseEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.CompositionEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),data,initCompositionEvent()", + FF60 = "constructor(),data,initCompositionEvent(),locale", + FF68 = "constructor(),data,initCompositionEvent(),locale", + IE = "constructor,data,initCompositionEvent(),locale") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void compositionEvent() throws Exception { + testString("document.createEvent('CompositionEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.FocusEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),relatedTarget", + FF68 = "constructor(),relatedTarget", + FF60 = "constructor(),relatedTarget", + IE = "constructor,initFocusEvent(),relatedTarget") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void focusEvent() throws Exception { + testString("document.createEvent('FocusEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.InputEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),data,dataTransfer,getTargetRanges(),inputType,isComposing", + FF60 = "constructor(),isComposing", + FF68 = "constructor(),data,dataTransfer,inputType,isComposing", + IE = "exception") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor()", + FF68 = "constructor()") + public void inputEvent() throws Exception { + testString("new InputEvent('input')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.MouseWheelEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "exception", + FF68 = "exception", + FF60 = "exception", + IE = "constructor,initMouseWheelEvent(),wheelDelta") + @HtmlUnitNYI(IE = "constructor") + public void mouseWheelEvent() throws Exception { + testString("document.createEvent('MouseWheelEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.SVGZoomEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts("exception") + public void svgZoomEvent() throws Exception { + testString("document.createEvent('SVGZoomEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.TextEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),data,initTextEvent()", + FF60 = "constructor(),data,initCompositionEvent(),locale", + FF68 = "constructor(),data,initCompositionEvent(),locale", + IE = "constructor,data,DOM_INPUT_METHOD_DROP,DOM_INPUT_METHOD_HANDWRITING,DOM_INPUT_METHOD_IME," + + "DOM_INPUT_METHOD_KEYBOARD,DOM_INPUT_METHOD_MULTIMODAL,DOM_INPUT_METHOD_OPTION," + + "DOM_INPUT_METHOD_PASTE,DOM_INPUT_METHOD_SCRIPT,DOM_INPUT_METHOD_UNKNOWN,DOM_INPUT_METHOD_VOICE," + + "initTextEvent(),inputMethod," + + "locale") + @HtmlUnitNYI(CHROME = "constructor()", + FF60 = "constructor(),detail,initUIEvent(),SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view", + FF68 = "constructor(),detail,initUIEvent(),SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view", + IE = "constructor,DOM_INPUT_METHOD_DROP,DOM_INPUT_METHOD_HANDWRITING,DOM_INPUT_METHOD_IME," + + "DOM_INPUT_METHOD_KEYBOARD,DOM_INPUT_METHOD_MULTIMODAL,DOM_INPUT_METHOD_OPTION," + + "DOM_INPUT_METHOD_PASTE,DOM_INPUT_METHOD_SCRIPT,DOM_INPUT_METHOD_UNKNOWN,DOM_INPUT_METHOD_VOICE") + public void textEvent() throws Exception { + testString("document.createEvent('TextEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.TouchEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(FF68 = "exception", + FF60 = "exception", + CHROME = "altKey,changedTouches,constructor(),ctrlKey,metaKey,shiftKey,targetTouches,touches", + IE = "exception") + @HtmlUnitNYI(CHROME = "constructor()") + public void touchEvent2() throws Exception { + testString("new TouchEvent('touch')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSlot}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "assignedElements(),assignedNodes(),constructor(),name", + FF68 = "assignedElements(),assignedNodes(),constructor(),name", + FF60 = "constructor()", + IE = "constructor,namedRecordset(),recordset") + @HtmlUnitNYI(CHROME = "constructor()", + FF68 = "constructor()", + IE = "constructor") + public void slot() throws Exception { + test("slot"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "alinkColor,all,anchors,applets,bgColor,captureEvents(),clear(),close(),constructor(),cookie," + + "designMode,domain,embeds,execCommand(),fgColor,forms,head,images,linkColor,links,open(),plugins," + + "queryCommandEnabled(),queryCommandIndeterm(),queryCommandState(),queryCommandSupported()," + + "queryCommandValue(),releaseEvents(),scripts,vlinkColor,write()," + + "writeln()", + FF68 = "alinkColor,all,bgColor,captureEvents(),clear(),close(),constructor(),designMode,domain," + + "execCommand(),fgColor,linkColor,open(),queryCommandEnabled(),queryCommandIndeterm()," + + "queryCommandState(),queryCommandSupported(),queryCommandValue(),releaseEvents(),vlinkColor," + + "write()," + + "writeln()", + IE = "constructor") + @HtmlUnitNYI(CHROME = "alinkColor,all,bgColor,captureEvents(),clear(),constructor(),cookie,dispatchEvent()," + + "documentElement,fgColor,getElementById(),getSelection(),head,linkColor,open(),releaseEvents()," + + "vlinkColor,write(),writeln()", + FF60 = "alinkColor,all,anchors,applets,bgColor,body,captureEvents(),clear(),close(),constructor()," + + "cookie,designMode,dispatchEvent(),documentElement,domain,embeds,execCommand(),fgColor,forms," + + "getElementById(),getElementsByName(),getSelection(),head,images,linkColor,links,open(),plugins," + + "queryCommandEnabled(),queryCommandSupported(),releaseEvents(),scripts,vlinkColor,write(),writeln()", + FF68 = "alinkColor,all,anchors,applets,bgColor,body,captureEvents(),clear(),close(),constructor(),cookie," + + "designMode,dispatchEvent(),documentElement,domain,embeds,execCommand(),fgColor,forms," + + "getElementById(),getElementsByName(),getSelection(),head,images,linkColor,links,open(),plugins," + + "queryCommandEnabled(),queryCommandSupported(),releaseEvents(),scripts,vlinkColor,write(),writeln()", + IE = "all,clear(),constructor,cookie,dispatchEvent(),documentElement,getElementById(),getSelection()," + + "head,open(),parentWindow,write(),writeln()") + public void htmlDocument() throws Exception { + testString("document"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.dom.Document}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor()", + FF60 = "async,constructor(),load()", + FF68 = "async,constructor(),load()", + IE = "constructor") + @HtmlUnitNYI(CHROME = "constructor(),getElementsByTagName()", + FF60 = "async,constructor(),getElementsByTagName(),load()", + FF68 = "async,constructor(),getElementsByTagName(),load()", + IE = "constructor,getElementsByTagName()") + public void document() throws Exception { + testString("xmlDocument"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "autofocus,blur(),className,constructor(),dataset,focus(),nonce,onabort,onanimationend," + + "onanimationiteration,onanimationstart,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough," + + "onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend," + + "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,onformdata,ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload," + + "onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpaste,onpause,onplay," + + "onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerrawupdate,onpointerup,onprogress,onratechange,onreset,onresize,onscroll," + + "onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel,ownerSVGElement,style," + + "tabIndex," + + "viewportElement", + FF60 = "blur(),className,constructor(),dataset,focus(),id,onabort,onanimationcancel,onanimationend," + + "onanimationiteration,onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,ownerSVGElement," + + "style,tabIndex," + + "viewportElement", + FF68 = "blur(),className,constructor(),dataset,focus(),id,onabort,onanimationcancel,onanimationend," + + "onanimationiteration,onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter," + + "ondragexit,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter," + + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,ownerSVGElement," + + "style,tabIndex," + + "viewportElement", + IE = "childElementCount,clientHeight,clientLeft,clientTop,clientWidth,constructor,firstElementChild," + + "getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect()," + + "getClientRects(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS()," + + "lastElementChild,msContentZoomFactor,msGetRegionContent(),msGetUntransformedBounds()," + + "msMatchesSelector(),msRegionOverflow,msReleasePointerCapture(),msRequestFullscreen()," + + "msSetPointerCapture(),nextElementSibling,ongotpointercapture,onlostpointercapture," + + "onmsgesturechange,onmsgesturedoubletap,onmsgestureend,onmsgesturehold,onmsgesturestart," + + "onmsgesturetap,onmsgotpointercapture,onmsinertiastart,onmslostpointercapture,onmspointercancel," + + "onmspointerdown,onmspointerenter,onmspointerleave,onmspointermove,onmspointerout,onmspointerover," + + "onmspointerup,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,previousElementSibling,querySelector(),querySelectorAll()," + + "releasePointerCapture(),removeAttribute(),removeAttributeNode(),removeAttributeNS(),scrollHeight," + + "scrollLeft,scrollTop,scrollWidth,setAttribute(),setAttributeNode(),setAttributeNodeNS()," + + "setAttributeNS(),setPointerCapture()," + + "tagName") + @HtmlUnitNYI(CHROME = "constructor(),onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying," + + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," + + "onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + + "onseeking,onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange," + + "onwaiting,onwheel,style", + FF60 = "constructor(),onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy," + + "oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,style", + FF68 = "constructor(),onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy," + + "oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,style", + IE = "attributes,childElementCount,clientHeight,clientLeft,clientTop,clientWidth,constructor," + + "firstElementChild,getAttribute(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS()," + + "getBoundingClientRect(),getClientRects(),getElementsByTagName(),getElementsByTagNameNS()," + + "hasAttribute(),hasAttributeNS(),lastElementChild,msMatchesSelector(),nextElementSibling," + + "ongotpointercapture,onlostpointercapture,onmsgesturechange,onmsgesturedoubletap,onmsgestureend," + + "onmsgesturehold,onmsgesturestart,onmsgesturetap,onmsgotpointercapture,onmsinertiastart," + + "onmslostpointercapture,onmspointercancel,onmspointerdown,onmspointerenter,onmspointerleave," + + "onmspointermove,onmspointerout,onmspointerover,onmspointerup,onpointercancel,onpointerdown," + + "onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup," + + "previousElementSibling,querySelector(),querySelectorAll(),removeAttribute(),removeAttributeNode()," + + "removeAttributeNS(),scrollHeight,scrollLeft,scrollTop,scrollWidth,setAttribute()," + + "setAttributeNode(),setAttributeNS(),tagName") + public void svgElement() throws Exception { + testString("svg"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "constructor(),localName,name,namespaceURI,ownerElement,prefix,specified,value", + FF60 = "constructor(),localName,name,namespaceURI,ownerElement,prefix,specified,value", + FF68 = "constructor(),localName,name,namespaceURI,ownerElement,prefix,specified,value", + IE = "constructor,expando,name,ownerElement,specified,value") + @HtmlUnitNYI(IE = "constructor,expando,localName,name,namespaceURI,ownerElement,prefix,specified,value") + public void nodeAndAttr() throws Exception { + testString("document.createAttribute('some_attrib')"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),comparePoint(),constructor(),createContextualFragment(),deleteContents()," + + "detach(),END_TO_END,END_TO_START,endContainer,endOffset,expand(),extractContents()," + + "getBoundingClientRect(),getClientRects(),insertNode(),intersectsNode(),isPointInRange()," + + "selectNode(),selectNodeContents(),setEnd(),setEndAfter(),setEndBefore(),setStart()," + + "setStartAfter(),setStartBefore(),START_TO_END,START_TO_START,startContainer,startOffset," + + "surroundContents()," + + "toString()", + FF60 = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),comparePoint(),constructor(),createContextualFragment(),deleteContents()," + + "detach(),END_TO_END,END_TO_START,endContainer,endOffset,extractContents()," + + "getBoundingClientRect(),getClientRects(),insertNode(),intersectsNode(),isPointInRange()," + + "selectNode(),selectNodeContents(),setEnd(),setEndAfter(),setEndBefore(),setStart()," + + "setStartAfter(),setStartBefore(),START_TO_END,START_TO_START,startContainer,startOffset," + + "surroundContents()," + + "toString()", + FF68 = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),comparePoint(),constructor(),createContextualFragment(),deleteContents()," + + "detach(),END_TO_END,END_TO_START,endContainer,endOffset,extractContents()," + + "getBoundingClientRect(),getClientRects(),insertNode(),intersectsNode(),isPointInRange()," + + "selectNode(),selectNodeContents(),setEnd(),setEndAfter(),setEndBefore(),setStart()," + + "setStartAfter(),setStartBefore(),START_TO_END,START_TO_START,startContainer,startOffset," + + "surroundContents()," + + "toString()", + IE = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),constructor,createContextualFragment(),deleteContents(),detach()," + + "END_TO_END,END_TO_START,endContainer,endOffset,extractContents(),getBoundingClientRect()," + + "getClientRects(),insertNode(),selectNode(),selectNodeContents(),setEnd(),setEndAfter()," + + "setEndBefore(),setStart(),setStartAfter(),setStartBefore(),START_TO_END,START_TO_START," + + "startContainer,startOffset,surroundContents()," + + "toString()") + @HtmlUnitNYI(CHROME = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),constructor(),createContextualFragment(),deleteContents(),detach()," + + "END_TO_END,END_TO_START,endContainer,endOffset,extractContents(),getBoundingClientRect()," + + "getClientRects(),insertNode(),selectNode(),selectNodeContents(),setEnd(),setEndAfter()," + + "setEndBefore(),setStart(),setStartAfter(),setStartBefore(),START_TO_END,START_TO_START," + + "startContainer,startOffset,surroundContents(),toString()", + FF60 = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),constructor(),createContextualFragment(),deleteContents()," + + "detach(),END_TO_END,END_TO_START,endContainer,endOffset,extractContents()," + + "getBoundingClientRect(),getClientRects(),insertNode(),selectNode(),selectNodeContents()," + + "setEnd(),setEndAfter(),setEndBefore(),setStart(),setStartAfter(),setStartBefore()," + + "START_TO_END,START_TO_START,startContainer,startOffset,surroundContents(),toString()", + FF68 = "cloneContents(),cloneRange(),collapse(),collapsed,commonAncestorContainer," + + "compareBoundaryPoints(),constructor(),createContextualFragment(),deleteContents()," + + "detach(),END_TO_END,END_TO_START,endContainer,endOffset,extractContents()," + + "getBoundingClientRect(),getClientRects(),insertNode(),selectNode(),selectNodeContents()," + + "setEnd(),setEndAfter(),setEndBefore(),setStart(),setStartAfter(),setStartBefore()," + + "START_TO_END,START_TO_START,startContainer,startOffset,surroundContents(),toString()") + public void range() throws Exception { + testString("document.createRange()"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "append(),childElementCount,children,constructor(),firstElementChild,getElementById()," + + "lastElementChild,prepend(),querySelector()," + + "querySelectorAll()", + FF60 = "append(),childElementCount,children,constructor(),firstElementChild,getElementById()," + + "lastElementChild,prepend(),querySelector()," + + "querySelectorAll()", + FF68 = "append(),childElementCount,children,constructor(),firstElementChild,getElementById()," + + "lastElementChild,prepend(),querySelector()," + + "querySelectorAll()", + IE = "constructor,querySelector(),querySelectorAll(),removeNode(),replaceNode(),swapNode()") + @HtmlUnitNYI(CHROME = "childElementCount,children,constructor(),firstElementChild,getElementById()," + + "lastElementChild,querySelector(),querySelectorAll()", + FF60 = "childElementCount,children,constructor(),firstElementChild,getElementById()," + + "lastElementChild,querySelector(),querySelectorAll()", + FF68 = "childElementCount,children,constructor(),firstElementChild,getElementById()" + + ",lastElementChild,querySelector(),querySelectorAll()", + IE = "constructor,querySelector(),querySelectorAll()") + public void documentFragment() throws Exception { + testString("document.createDocumentFragment()"); + } + +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java index f06a0e7e9b1..9c5b0f44289 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/ElementPropertiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,8 @@ package com.gargoylesoftware.htmlunit.general; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF45; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF68; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static java.nio.charset.StandardCharsets.ISO_8859_1; @@ -82,7 +81,12 @@ private void testString(final String string) throws Exception { + " var unknown = document.createElement('harhar');\n" + " var div = document.createElement('div');\n" + " var svg = document.getElementById('mySvg');\n" - + " process(" + string + ");\n" + + " try{\n" + + " process(" + string + ");\n" + + " } catch (e) {\n" + + " alert('exception');\n" + + " return;" + + " }\n" + " }\n" + "\n" + " /*\n" @@ -120,7 +124,8 @@ private void testString(final String string) throws Exception { + " function sortFunction(s1, s2) {\n" + " return s1.toLowerCase() > s2.toLowerCase() ? 1 : -1;\n" + " }\n" - + "\n" + + "\n" + + "\n" + " \n" + " \n" + " \n" @@ -314,23 +319,34 @@ private static StringBuilder htmlDetails(final String name, final StringBuilder html.append("").append('\n').append("").append("").append(name) .append("").append("").append('\n').append(""); int implementedCount = 0; - for (int i = 0; i < realProperties.size(); i++) { - final String color; - if (implementedProperties.contains(realProperties.get(i))) { - color = "green"; - implementedCount++; - } - else { - color = "blue"; - } - html.append("").append(realProperties.get(i)).append(""); - if (i < realProperties.size() - 1) { - html.append(',').append(' '); - } - } + if (realProperties.isEmpty()) { html.append(" "); } + else if (realProperties.size() == 1 + && realProperties.contains("exception") + && implementedProperties.size() == 1 + && implementedProperties.contains("exception") + && erroredProperties.size() == 0) { + html.append(" "); + } + else { + for (int i = 0; i < realProperties.size(); i++) { + final String color; + if (implementedProperties.contains(realProperties.get(i))) { + color = "green"; + implementedCount++; + } + else { + color = "blue"; + } + html.append("").append(realProperties.get(i)).append(""); + if (i < realProperties.size() - 1) { + html.append(',').append(' '); + } + } + } + html.append("").append("").append(implementedCount).append('/') .append(realProperties.size()).append("").append("").append('\n'); html.append("").append(""); @@ -370,12 +386,9 @@ protected boolean ignoreExpectationsLength() { @Alerts(DEFAULT = "appendData(),data,deleteData(),insertData(),length,replaceData(),splitText(),substringData()," + "wholeText", IE = "appendData(),data,deleteData(),insertData(),length,replaceData(),replaceWholeText(),splitText()," - + "substringData()," - + "wholeText", - EDGE = "appendData(),data,deleteData(),insertData(),length,replaceData(),replaceWholeText(),splitText()," + "substringData()," + "wholeText") - @NotYetImplemented({IE, EDGE}) + @NotYetImplemented(IE) public void text() throws Exception { testString("document.createTextNode('some text'), unknown"); } @@ -386,7 +399,6 @@ public void text() throws Exception { @Test @Alerts(DEFAULT = "name,ownerElement,specified,value", IE = "expando,name,ownerElement,specified,value") - @NotYetImplemented(EDGE) public void attr() throws Exception { testString("document.createAttribute('some_attrib'), unknown"); } @@ -396,9 +408,7 @@ public void attr() throws Exception { */ @Test @Alerts(DEFAULT = "appendData(),data,deleteData(),insertData(),length,replaceData(),substringData()", - IE = "appendData(),data,deleteData(),insertData(),length,replaceData(),substringData(),text", - EDGE = "appendData(),data,deleteData(),insertData(),length,replaceData(),substringData(),text") - @NotYetImplemented(EDGE) + IE = "appendData(),data,deleteData(),insertData(),length,replaceData(),substringData(),text") public void comment() throws Exception { testString("document.createComment('come_comment'), unknown"); } @@ -418,50 +428,61 @@ public void unknown() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = "accessKey,autocapitalize," - + "blur(),click(),contentEditable,dataset,dir,draggable,focus(),hidden," + @Alerts(CHROME = "accessKey,attachInternals(),autocapitalize,autofocus," + + "blur(),click(),contentEditable,dataset,dir,draggable,enterKeyHint,focus(),hidden," + "innerText,inputMode,isContentEditable,lang,nonce," + "offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationend,onanimationiteration,onanimationstart," + "onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange,onclick," - + "onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," - + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture," - + "oninput,oninvalid," + + "onclose,oncontextmenu,oncopy,oncuechange,oncut," + + "ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover," + + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onformdata," + + "ongotpointercapture,oninput,oninvalid," + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture," + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," - + "onpause,onplay,onplaying," + + "onpaste,onpause,onplay,onplaying," + "onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout," - + "onpointerover,onpointerup,onprogress," + + "onpointerover,onpointerrawupdate,onpointerup,onprogress," + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," - + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel,outerText," + + "onselectionchange,onselectstart,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend," + + "onvolumechange,onwaiting,onwheel,outerText," + "spellcheck,style,tabIndex,title,translate", - FF45 = "accessKey,accessKeyLabel,blur(),click(),contentEditable,contextMenu,dataset,dir," - + "draggable,focus(),hidden,innerText,isContentEditable,itemId,itemProp,itemRef,itemScope," - + "itemType,itemValue," - + "lang,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onblur,oncanplay," - + "oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend," - + "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," - + "onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata," - + "onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," - + "onmozfullscreenchange,onmozfullscreenerror,onmozpointerlockchange,onmozpointerlockerror,onpaste," - + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," - + "onselect,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,properties," - + "spellcheck,style,tabIndex," - + "title", - FF52 = "accessKey,accessKeyLabel,blur(),click(),contentEditable,contextMenu,dataset,dir," + FF68 = "accessKey,accessKeyLabel,blur(),click(),contentEditable,contextMenu,dataset,dir,draggable," + + "focus(),hidden,innerText,isContentEditable,lang," + + "offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," + + "onanimationcancel,onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur," + + "oncanplay,oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut," + + "ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture,oninput," + + "oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata," + + "onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause," + + "onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset,onresize," + + "onscroll,onseeked,onseeking,onselect,onselectstart,onshow,onstalled,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart," + + "onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart," + + "onwebkittransitionend,onwheel,spellcheck,style,tabIndex,title", + FF60 = "accessKey,accessKeyLabel,blur(),click(),contentEditable,contextMenu,dataset,dir," + "draggable,focus(),hidden,innerText,isContentEditable," + "lang,offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort," - + "onanimationend,onanimationiteration,onanimationstart,onblur,oncanplay," - + "oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend," - + "ondragenter,ondragexit,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied," - + "onended,onerror," - + "onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata," - + "onloadend,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout," - + "onmouseover,onmouseup," + + "onanimationcancel,onanimationend,onanimationiteration,onanimationstart,onauxclick,onblur,oncanplay," + + "oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncut,ondblclick,ondrag,ondragend," + + "ondragenter,ondragexit,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror," + + "onfocus,ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + + "onload,onloadeddata,onloadedmetadata,onloadend," + + "onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup," + "onmozfullscreenchange,onmozfullscreenerror,onpaste," - + "onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking," - + "onselect,onselectstart,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend," - + "onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart," - + "onwebkittransitionend,spellcheck,style,tabIndex,title", + + "onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset," + + "onresize,onscroll,onseeked,onseeking," + + "onselect,onselectstart,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle," + + "ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,onvolumechange,onwaiting," + + "onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart," + + "onwebkittransitionend,onwheel,spellcheck,style,tabIndex," + + "title", IE = "accessKey,applyElement(),blur(),canHaveChildren,canHaveHTML,children,classList,className," + "clearAttributes(),click(),componentFromPoint(),contains(),contentEditable,createControlRange()," + "currentStyle,dataset,dir,disabled,dragDrop(),draggable,focus(),getAdjacentText()," @@ -480,21 +501,7 @@ public void unknown() throws Exception { + "outerText,parentElement,parentTextEdit,recordNumber,recordset,releaseCapture(),removeNode()," + "replaceAdjacentText(),replaceNode(),runtimeStyle,scrollIntoView(),setActive(),setCapture()," + "sourceIndex,spellcheck,style,swapNode(),tabIndex,title,uniqueID," - + "uniqueNumber", - EDGE = "accessKey,blur(),children,className,click(),contentEditable,dataset,dir,dragDrop(),draggable," - + "focus(),getElementsByClassName(),hidden,hideFocus,innerHTML,innerText,insertAdjacentElement()," - + "insertAdjacentHTML(),insertAdjacentText(),isContentEditable,lang,msGetInputContext()," - + "offsetHeight,offsetLeft,offsetParent,offsetTop,offsetWidth,onabort,onactivate,onbeforeactivate," - + "onbeforecopy,onbeforecut,onbeforedeactivate,onbeforepaste,onblur,oncanplay,oncanplaythrough," - + "onchange,onclick,oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondeactivate,ondrag,ondragend," - + "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," - + "onfocus,oninput,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart," - + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel," - + "onmscontentzoom,onmsmanipulationstatechanged,onpaste,onpause,onplay,onplaying,onprogress," - + "onratechange,onreset,onscroll,onseeked,onseeking,onselect,onselectstart,onstalled,onsubmit," - + "onsuspend,ontimeupdate,onvolumechange,onwaiting,outerHTML,outerText,scrollIntoView(),setActive()," - + "spellcheck,style,tabIndex," - + "title") + + "uniqueNumber") @NotYetImplemented public void htmlElement() throws Exception { testString("unknown, element"); @@ -506,43 +513,52 @@ public void htmlElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "animate(),append(),attachShadow(),attributes,attributeStyleMap," + @Alerts(CHROME = "animate(),append(),attachShadow(),attributes,attributeStyleMap," + "childElementCount,children,classList,className," + "clientHeight,clientLeft,clientTop,clientWidth,closest(),computedStyleMap(),createShadowRoot()," - + "firstElementChild,getAttribute(),getAttributeNames(),getAttributeNode()," + + "elementTiming,firstElementChild,getAttribute(),getAttributeNames(),getAttributeNode()," + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect()," + "getClientRects(),getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS()," + "hasAttribute(),hasAttributeNS(),hasAttributes(),hasPointerCapture(),id,innerHTML," + "insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),lastElementChild,localName," - + "matches(),namespaceURI,onbeforecopy,onbeforecut,onbeforepaste,oncopy,oncut,onpaste,onsearch," - + "onselectstart,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix,prepend()," - + "querySelector(),querySelectorAll(),releasePointerCapture(),removeAttribute(),removeAttributeNode()," - + "removeAttributeNS(),requestPointerLock()," + + "matches(),namespaceURI," + + "onbeforecopy,onbeforecut,onbeforepaste,onfullscreenchange,onfullscreenerror,onsearch," + + "onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,part,prefix,prepend()," + + "querySelector(),querySelectorAll()," + + "releasePointerCapture(),removeAttribute(),removeAttributeNode()," + + "removeAttributeNS(),requestFullscreen(),requestPointerLock()," + "scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollIntoViewIfNeeded()," + "scrollLeft,scrollTo(),scrollTop,scrollWidth,setAttribute(),setAttributeNode(),setAttributeNodeNS()," - + "setAttributeNS(),setPointerCapture(),shadowRoot,slot,tagName,webkitMatchesSelector()," - + "webkitRequestFullScreen(),webkitRequestFullscreen()", - FF52 = "animate(),append(),attributes,childElementCount,children,classList,className,clientHeight," - + "clientLeft,clientTop,clientWidth,closest(),firstElementChild,getAttribute(),getAttributeNames()," - + "getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," - + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," - + "hasAttributeNS(),hasAttributes(),id,innerHTML,insertAdjacentElement(),insertAdjacentHTML()," - + "insertAdjacentText(),lastElementChild,localName,matches(),mozMatchesSelector()," - + "mozRequestFullScreen(),namespaceURI,onwheel,outerHTML,prefix,prepend(),querySelector()," - + "querySelectorAll(),releaseCapture(),removeAttribute(),removeAttributeNode(),removeAttributeNS()," - + "requestPointerLock(),scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollLeft,scrollLeftMax," - + "scrollTo(),scrollTop,scrollTopMax,scrollWidth,setAttribute(),setAttributeNode()," - + "setAttributeNodeNS(),setAttributeNS(),setCapture(),tagName,webkitMatchesSelector()", - FF45 = "attributes,childElementCount,children,classList,className,clientHeight,clientLeft,clientTop," + + "setAttributeNS(),setPointerCapture(),shadowRoot,slot,tagName,toggleAttribute()," + + "webkitMatchesSelector(),webkitRequestFullscreen(),webkitRequestFullScreen()", + FF68 = "animate(),append(),attachShadow(),attributes,childElementCount,children,classList,className," + + "clientHeight,clientLeft,clientTop,clientWidth,closest(),firstElementChild,getAttribute()," + + "getAttributeNames(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS()," + + "getBoundingClientRect(),getClientRects(),getElementsByClassName(),getElementsByTagName()," + + "getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes(),hasPointerCapture()," + + "id,innerHTML,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),lastElementChild," + + "localName,matches(),mozMatchesSelector(),mozRequestFullScreen(),namespaceURI,onfullscreenchange," + + "onfullscreenerror,outerHTML,prefix,prepend(),querySelector(),querySelectorAll(),releaseCapture()," + + "releasePointerCapture(),removeAttribute(),removeAttributeNode(),removeAttributeNS()," + + "requestFullscreen(),requestPointerLock(),scroll(),scrollBy(),scrollHeight,scrollIntoView()," + + "scrollLeft,scrollLeftMax,scrollTo(),scrollTop,scrollTopMax,scrollWidth,setAttribute()," + + "setAttributeNode(),setAttributeNodeNS(),setAttributeNS(),setCapture(),setPointerCapture()," + + "shadowRoot,slot,tagName,toggleAttribute(),webkitMatchesSelector()", + FF60 = "animate(),append(),attributes,childElementCount,children,classList,className," + + "clientHeight,clientLeft,clientTop," + "clientWidth,closest(),firstElementChild,getAttribute(),getAttributeNames(),getAttributeNode()," + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," - + "hasAttributeNS(),hasAttributes(),id,innerHTML,insertAdjacentHTML(),lastElementChild,matches()," - + "mozMatchesSelector(),mozRequestFullScreen(),mozRequestPointerLock(),onwheel,outerHTML," - + "querySelector(),querySelectorAll(),releaseCapture(),removeAttribute(),removeAttributeNode()," - + "removeAttributeNS(),scroll(),scrollBy(),scrollHeight,scrollIntoView(),scrollLeft,scrollLeftMax," + + "hasAttributeNS(),hasAttributes(),hasPointerCapture(),id,innerHTML,insertAdjacentElement()," + + "insertAdjacentHTML(),insertAdjacentText(),lastElementChild,localName,matches()," + + "mozMatchesSelector(),mozRequestFullScreen(),namespaceURI,outerHTML,prefix,prepend()," + + "querySelector(),querySelectorAll(),releaseCapture(),releasePointerCapture(),removeAttribute()," + + "removeAttributeNode()," + + "removeAttributeNS(),requestPointerLock(),scroll(),scrollBy(),scrollHeight,scrollIntoView()," + + "scrollLeft,scrollLeftMax," + "scrollTo(),scrollTop,scrollTopMax,scrollWidth,setAttribute(),setAttributeNode()," - + "setAttributeNodeNS(),setAttributeNS(),setCapture(),tagName,webkitMatchesSelector()", + + "setAttributeNodeNS(),setAttributeNS(),setCapture(),setPointerCapture()," + + "tagName,webkitMatchesSelector()", IE = "childElementCount,clientHeight,clientLeft,clientTop,clientWidth,firstElementChild,getAttribute()," + "getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + "getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),lastElementChild," @@ -570,44 +586,50 @@ public void element() throws Exception { @Alerts(CHROME = "after(),animate(),assignedSlot,attachShadow(),attributes,attributeStyleMap," + "before(),classList,className," + "clientHeight,clientLeft,clientTop,clientWidth,closest(),computedStyleMap(),createShadowRoot()," - + "getAttribute()," + + "elementTiming,getAttribute()," + "getAttributeNames(),getAttributeNode(),getAttributeNodeNS(),getAttributeNS()," + "getBoundingClientRect(),getClientRects()," + "getDestinationInsertionPoints(),getElementsByClassName(),getElementsByTagName()," + "getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes(),hasPointerCapture(),id," + "innerHTML,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),localName,matches()," - + "namespaceURI,nextElementSibling,onbeforecopy,onbeforecut,onbeforepaste,oncopy,oncut,onpaste," - + "onsearch,onselectstart,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML,prefix," + + "namespaceURI,nextElementSibling,onbeforecopy,onbeforecut," + + "onbeforepaste,onfullscreenchange,onfullscreenerror," + + "onsearch,onwebkitfullscreenchange,onwebkitfullscreenerror,outerHTML," + + "part,prefix," + "previousElementSibling,releasePointerCapture(),remove(),removeAttribute(),removeAttributeNode()," - + "removeAttributeNS(),replaceWith(),requestPointerLock()," + + "removeAttributeNS(),replaceWith(),requestFullscreen(),requestPointerLock()," + "scroll(),scrollBy(),scrollHeight,scrollIntoView()," + "scrollIntoViewIfNeeded(),scrollLeft,scrollTo(),scrollTop,scrollWidth,setAttribute()," + "setAttributeNode()," - + "setAttributeNodeNS(),setAttributeNS(),setPointerCapture(),shadowRoot,slot,tagName," - + "webkitMatchesSelector(),webkitRequestFullScreen(),webkitRequestFullscreen()", - FF45 = "attributes,classList,className,clientHeight,clientLeft,clientTop," - + "clientWidth,closest(),getAttribute(),getAttributeNames(),getAttributeNode(),getAttributeNodeNS()," - + "getAttributeNS(),getBoundingClientRect(),getClientRects(),getElementsByClassName()," - + "getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes(),id," - + "innerHTML,insertAdjacentHTML(),matches()," - + "mozMatchesSelector(),mozRequestFullScreen(),mozRequestPointerLock(),nextElementSibling," - + "onwheel,outerHTML," - + "previousElementSibling,releaseCapture(),remove(),removeAttribute(),removeAttributeNode()," - + "removeAttributeNS(),scroll(),scrollBy(),scrollHeight," + + "setAttributeNodeNS(),setAttributeNS(),setPointerCapture(),shadowRoot,slot," + + "tagName,toggleAttribute()," + + "webkitMatchesSelector(),webkitRequestFullscreen(),webkitRequestFullScreen()", + FF68 = "after(),animate(),assignedSlot,attachShadow(),attributes,before(),classList,className,clientHeight," + + "clientLeft,clientTop,clientWidth,closest(),getAttribute(),getAttributeNames(),getAttributeNode()," + + "getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + + "getElementsByClassName(),getElementsByTagName(),getElementsByTagNameNS(),hasAttribute()," + + "hasAttributeNS(),hasAttributes(),hasPointerCapture(),id,innerHTML,insertAdjacentElement()," + + "insertAdjacentHTML(),insertAdjacentText(),localName,matches(),mozMatchesSelector()," + + "mozRequestFullScreen(),namespaceURI,nextElementSibling,onfullscreenchange,onfullscreenerror," + + "outerHTML,prefix,previousElementSibling,releaseCapture()," + + "releasePointerCapture(),remove(),removeAttribute(),removeAttributeNode(),removeAttributeNS()," + + "replaceWith(),requestFullscreen(),requestPointerLock(),scroll(),scrollBy(),scrollHeight," + "scrollIntoView(),scrollLeft,scrollLeftMax,scrollTo(),scrollTop,scrollTopMax,scrollWidth," - + "setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS(),setCapture(),tagName," - + "webkitMatchesSelector()", - FF52 = "after(),animate(),attributes,before(),classList,className,clientHeight,clientLeft,clientTop," + + "setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS(),setCapture()," + + "setPointerCapture(),shadowRoot,slot,tagName,toggleAttribute(),webkitMatchesSelector()", + FF60 = "after(),animate(),attributes,before(),classList,className,clientHeight,clientLeft,clientTop," + "clientWidth,closest(),getAttribute(),getAttributeNames(),getAttributeNode(),getAttributeNodeNS()," + "getAttributeNS(),getBoundingClientRect(),getClientRects(),getElementsByClassName()," - + "getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes(),id," + + "getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),hasAttributes()," + + "hasPointerCapture(),id," + "innerHTML,insertAdjacentElement(),insertAdjacentHTML(),insertAdjacentText(),localName,matches()," - + "mozMatchesSelector(),mozRequestFullScreen(),namespaceURI,nextElementSibling,onwheel,outerHTML," - + "prefix,previousElementSibling,releaseCapture(),remove(),removeAttribute(),removeAttributeNode()," - + "removeAttributeNS(),replaceWith(),requestPointerLock(),scroll(),scrollBy(),scrollHeight," + + "mozMatchesSelector(),mozRequestFullScreen(),namespaceURI,nextElementSibling,outerHTML,prefix," + + "previousElementSibling,releaseCapture(),releasePointerCapture(),remove(),removeAttribute()," + + "removeAttributeNode(),removeAttributeNS(),replaceWith(),requestPointerLock()," + + "scroll(),scrollBy(),scrollHeight," + "scrollIntoView(),scrollLeft,scrollLeftMax,scrollTo(),scrollTop,scrollTopMax,scrollWidth," - + "setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS(),setCapture(),tagName," - + "webkitMatchesSelector()", + + "setAttribute(),setAttributeNode(),setAttributeNodeNS(),setAttributeNS()," + + "setCapture(),setPointerCapture(),tagName,webkitMatchesSelector()", IE = "childElementCount,clientHeight,clientLeft,clientTop,clientWidth,firstElementChild,getAttribute()," + "getAttributeNode(),getAttributeNodeNS(),getAttributeNS(),getBoundingClientRect(),getClientRects()," + "getElementsByTagName(),getElementsByTagNameNS(),hasAttribute(),hasAttributeNS(),lastElementChild," @@ -645,24 +667,22 @@ public void currentStyle() throws Exception { + "composed,composedPath(),currentTarget,defaultPrevented,eventPhase,initEvent(),isTrusted," + "NONE,path,preventDefault(),returnValue,srcElement,stopImmediatePropagation(),stopPropagation()," + "target,timeStamp,type", - FF45 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,CAPTURING_PHASE,CONTROL_MASK,currentTarget," - + "defaultPrevented,eventPhase,explicitOriginalTarget,getPreventDefault(),initEvent(),isTrusted," - + "META_MASK,NONE,originalTarget,preventDefault(),SHIFT_MASK,stopImmediatePropagation()," + FF68 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,composed," + + "composedPath(),CONTROL_MASK,currentTarget," + + "defaultPrevented,eventPhase,explicitOriginalTarget,initEvent(),isTrusted," + + "META_MASK,NONE,originalTarget,preventDefault(),returnValue,SHIFT_MASK,srcElement," + + "stopImmediatePropagation()," + "stopPropagation(),target,timeStamp," + "type", - FF52 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,composed," - + "CONTROL_MASK,currentTarget," - + "defaultPrevented,eventPhase,explicitOriginalTarget,getPreventDefault(),initEvent(),isTrusted," + FF60 = "ALT_MASK,AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble," + + "CAPTURING_PHASE,composed,composedPath(),CONTROL_MASK,currentTarget," + + "defaultPrevented,eventPhase,explicitOriginalTarget,initEvent(),isTrusted," + "META_MASK,NONE,originalTarget,preventDefault(),SHIFT_MASK,stopImmediatePropagation()," + "stopPropagation(),target,timeStamp," + "type", IE = "AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,currentTarget," + "defaultPrevented,eventPhase,initEvent(),isTrusted,preventDefault(),srcElement," + "stopImmediatePropagation(),stopPropagation(),target,timeStamp," - + "type", - EDGE = "AT_TARGET,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,CAPTURING_PHASE,currentTarget," - + "defaultPrevented,eventPhase,initEvent(),isTrusted,preventDefault(),returnValue,srcElement," - + "stopImmediatePropagation(),stopPropagation(),target,timeStamp," + "type") @NotYetImplemented public void event() throws Exception { @@ -677,7 +697,7 @@ public void event() throws Exception { + "cancelIdleCallback(),captureEvents(),chrome,clearInterval(),clearTimeout(),clientInformation," + "close(),closed,confirm()," + "createImageBitmap(),crypto,customElements," - + "defaultStatus,defaultstatus,devicePixelRatio," + + "defaultstatus,defaultStatus,devicePixelRatio," + "dispatchEvent(),document,external,fetch(),find(),focus(),frameElement,frames,getComputedStyle()," + "getSelection(),history," + "indexedDB,innerHeight,innerWidth,isSecureContext,length," @@ -687,22 +707,24 @@ public void event() throws Exception { + "onbeforeunload,onblur,oncancel,oncanplay,oncanplaythrough," + "onchange,onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondevicemotion,ondeviceorientation," + "ondeviceorientationabsolute,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," - + "ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture," + + "ondurationchange,onemptied,onended,onerror,onfocus,onformdata,ongotpointercapture," + "onhashchange,oninput,oninvalid,onkeydown,onkeypress,onkeyup," + "onlanguagechange,onload(),onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture,onmessage," + "onmessageerror,onmousedown," + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onoffline," + "ononline,onpagehide,onpageshow,onpause,onplay,onplaying," + "onpointercancel,onpointerdown,onpointerenter,onpointerleave," - + "onpointermove,onpointerout,onpointerover,onpointerup," + + "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup," + "onpopstate,onprogress,onratechange," + "onrejectionhandled,onreset,onresize,onscroll,onsearch," - + "onseeked,onseeking,onselect,onstalled,onstorage," + + "onseeked,onseeking,onselect,onselectionchange,onselectstart," + + "onstalled,onstorage," + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onunhandledrejection," + "onunload,onvolumechange,onwaiting," + "onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend," + "onwheel,open(),openDatabase(),opener,origin,outerHeight,outerWidth,pageXOffset,pageYOffset,parent," - + "performance,PERSISTENT,personalbar,postMessage(),print(),process(),prompt(),releaseEvents()," + + "performance,PERSISTENT,personalbar,postMessage(),print(),process(),prompt()," + + "queueMicrotask(),releaseEvents()," + "removeEventListener(),requestAnimationFrame(),requestIdleCallback()," + "resizeBy(),resizeTo(),screen,screenLeft,screenTop," + "screenX,screenY,scroll(),scrollbars,scrollBy(),scrollTo(),scrollX,scrollY,self,sessionStorage," @@ -711,66 +733,64 @@ public void event() throws Exception { + "webkitRequestAnimationFrame(),webkitRequestFileSystem()," + "webkitResolveLocalFileSystemURL(),webkitStorageInfo," + "window", - FF45 = "addEventListener(),alert(),applicationCache,atob(),blur(),btoa(),caches,cancelAnimationFrame()," - + "captureEvents(),clearInterval(),clearTimeout(),close(),closed,confirm(),console,content," - + "createImageBitmap(),crypto,devicePixelRatio,dispatchEvent(),document,dump()," - + "external,fetch(),find()," - + "focus(),frameElement,frames,fullScreen,getComputedStyle(),getDefaultComputedStyle()," - + "getSelection(),history,indexedDB,innerHeight,innerWidth," - + "InstallTrigger,length,localStorage,location,locationbar,matchMedia(),menubar,moveBy(),moveTo()," - + "mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,onabort," - + "onafterprint,onbeforeprint,onbeforeunload,onblur," - + "oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,ondblclick,ondevicelight," - + "ondevicemotion,ondeviceorientation,ondeviceproximity,ondrag,ondragend,ondragenter,ondragleave," - + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," - + "onhashchange,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onlanguagechange,onload()," - + "onloadeddata,onloadedmetadata,onloadstart,onmessage,onmousedown," - + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," - + "onmozfullscreenerror,onmozpointerlockchange,onmozpointerlockerror,onoffline,ononline,onpagehide," - + "onpageshow,onpause,onplay,onplaying," - + "onpopstate,onprogress," - + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled,onstorage," - + "onsubmit," - + "onsuspend,ontimeupdate,onunload,onuserproximity,onvolumechange,onwaiting,onwheel,open()," - + "opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance," - + "personalbar,postMessage(),print(),process(),prompt(),releaseEvents(),removeEventListener()," - + "requestAnimationFrame(),resizeBy(),resizeTo(),screen,screenX,screenY,scroll(),scrollbars," - + "scrollBy(),scrollByLines(),scrollByPages(),scrollMaxX,scrollMaxY,scrollTo(),scrollX,scrollY,self," - + "sessionStorage,setInterval(),setResizable(),setTimeout(),showModalDialog(),sidebar," - + "sizeToContent(),sortFunction(),status,statusbar,stop(),test(),toolbar,top," - + "updateCommands()," - + "window", - FF52 = "addEventListener(),alert(),applicationCache,atob(),blur(),btoa(),caches,cancelAnimationFrame()," - + "captureEvents(),clearInterval(),clearTimeout(),close(),closed,confirm(),content," - + "createImageBitmap(),crypto,devicePixelRatio,dispatchEvent(),document,dump()," - + "external,fetch(),find()," - + "focus(),frameElement,frames,fullScreen,getComputedStyle(),getDefaultComputedStyle()," - + "getSelection(),history,indexedDB,innerHeight,innerWidth," - + "InstallTrigger,isSecureContext,length,localStorage,location,locationbar," - + "matchMedia(),menubar,moveBy(),moveTo()," - + "mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,onabort," - + "onabsolutedeviceorientation,onafterprint,onanimationend,onanimationiteration," - + "onanimationstart,onbeforeprint,onbeforeunload,onblur," - + "oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,ondblclick,ondevicelight," - + "ondevicemotion,ondeviceorientation,ondeviceproximity,ondrag,ondragend,ondragenter," - + "ondragexit,ondragleave," - + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," - + "onhashchange,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onlanguagechange,onload()," - + "onloadeddata,onloadedmetadata,onloadend,onloadstart,onmessage,onmousedown,onmouseenter," - + "onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," - + "onmozfullscreenerror,onoffline,ononline,onpagehide,onpageshow,onpause,onplay,onplaying," - + "onpopstate,onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," - + "onselectstart,onshow,onstalled,onstorage,onsubmit,onsuspend,ontimeupdate,ontoggle," - + "ontransitionend,onunload,onuserproximity,onvolumechange,onwaiting,onwebkitanimationend," - + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel," - + "open(),opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance," - + "personalbar,postMessage(),print(),process(),prompt(),releaseEvents()," - + "removeEventListener(),requestAnimationFrame(),resizeBy(),resizeTo()," - + "screen,screenX,screenY,scroll(),scrollbars,scrollBy(),scrollByLines(),scrollByPages()," - + "scrollMaxX,scrollMaxY,scrollTo(),scrollX,scrollY,self,sessionStorage,setInterval()," - + "setResizable(),setTimeout(),showModalDialog(),sidebar,sizeToContent()," - + "sortFunction(),speechSynthesis," - + "status,statusbar,stop(),test(),toolbar,top,updateCommands(),window", + FF68 = "addEventListener(),alert(),applicationCache,atob(),blur(),btoa(),caches,cancelAnimationFrame()," + + "cancelIdleCallback(),captureEvents(),clearInterval(),clearTimeout(),close(),closed,confirm()," + + "createImageBitmap(),crypto,customElements,devicePixelRatio,dispatchEvent(),document,dump()," + + "event,external,fetch(),find(),focus(),frameElement,frames,fullScreen,getComputedStyle()," + + "getDefaultComputedStyle(),getSelection(),history,indexedDB,innerHeight,innerWidth,InstallTrigger," + + "isSecureContext,length,localStorage,location,locationbar,matchMedia(),menubar,moveBy(),moveTo()," + + "mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,onabort,onabsolutedeviceorientation," + + "onafterprint,onanimationcancel,onanimationend,onanimationiteration,onanimationstart,onauxclick," + + "onbeforeprint,onbeforeunload,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncuechange,ondblclick,ondevicelight,ondevicemotion,ondeviceorientation," + + "ondeviceproximity,ondrag,ondragend,ondragenter,ondragexit,ondragleave,ondragover,ondragstart," + + "ondrop,ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture,onhashchange," + + "oninput,oninvalid,onkeydown,onkeypress,onkeyup,onlanguagechange,onload(),onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmessage,onmessageerror," + + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," + + "onmozfullscreenchange,onmozfullscreenerror,onoffline,ononline,onpagehide,onpageshow,onpause," + + "onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,onpopstate,onprogress,onratechange,onreset,onresize,onscroll," + + "onseeked,onseeking,onselect,onselectstart,onshow,onstalled,onstorage,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,onunload," + + "onuserproximity,onvolumechange,onvrdisplayactivate,onvrdisplayconnect,onvrdisplaydeactivate," + + "onvrdisplaydisconnect,onvrdisplaypresentchange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,open(),opener," + + "origin,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,postMessage()," + + "print(),process(),prompt(),releaseEvents(),removeEventListener(),requestAnimationFrame()," + + "requestIdleCallback(),resizeBy(),resizeTo(),screen,screenLeft,screenTop,screenX,screenY,scroll()," + + "scrollbars,scrollBy(),scrollByLines(),scrollByPages(),scrollMaxX,scrollMaxY,scrollTo()," + + "scrollX,scrollY,self,sessionStorage,setInterval(),setResizable(),setTimeout(),sidebar," + + "sizeToContent(),sortFunction(),speechSynthesis,status,statusbar,stop(),test(),toolbar,top,u2f," + + "updateCommands(),window", + FF60 = "addEventListener(),alert(),applicationCache,atob(),blur(),btoa(),caches,cancelAnimationFrame()," + + "cancelIdleCallback(),captureEvents(),clearInterval(),clearTimeout(),close(),closed,confirm()," + + "createImageBitmap(),crypto,devicePixelRatio,dispatchEvent(),document,dump(),external,fetch()," + + "find(),focus(),frameElement,frames,fullScreen,getComputedStyle(),getDefaultComputedStyle()," + + "getSelection(),history,indexedDB,innerHeight,innerWidth,isSecureContext,length,localStorage," + + "location,locationbar,matchMedia(),menubar,moveBy(),moveTo(),mozInnerScreenX,mozInnerScreenY," + + "mozPaintCount,name,navigator,onabort,onabsolutedeviceorientation,onafterprint,onanimationcancel," + + "onanimationend,onanimationiteration,onanimationstart,onauxclick,onbeforeprint,onbeforeunload," + + "onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose,oncontextmenu,ondblclick,ondevicelight," + + "ondevicemotion,ondeviceorientation,ondeviceproximity,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,onhashchange,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onlanguagechange," + + "onload(),onloadeddata,onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmessage," + + "onmessageerror,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," + + "onmouseup,onmozfullscreenchange,onmozfullscreenerror,onoffline,ononline,onpagehide,onpageshow," + + "onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,onpopstate,onprogress,onratechange,onreset,onresize," + + "onscroll,onseeked,onseeking,onselect,onselectstart,onshow,onstalled,onstorage,onsubmit,onsuspend," + + "ontimeupdate,ontoggle,ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,onunload," + + "onuserproximity,onvolumechange,onvrdisplayactivate,onvrdisplayconnect,onvrdisplaydeactivate," + + "onvrdisplaydisconnect,onvrdisplaypresentchange,onwaiting,onwebkitanimationend," + + "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,open(),opener," + + "origin,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,postMessage()," + + "print(),process(),prompt(),releaseEvents(),removeEventListener(),requestAnimationFrame()," + + "requestIdleCallback(),resizeBy(),resizeTo(),screen,screenX,screenY,scroll(),scrollbars," + + "scrollBy(),scrollByLines(),scrollByPages(),scrollMaxX,scrollMaxY,scrollTo(),scrollX,scrollY," + + "self,sessionStorage,setInterval(),setResizable(),setTimeout(),sidebar,sizeToContent()," + + "sortFunction(),speechSynthesis,status,statusbar,stop(),test(),toolbar,top,updateCommands(),window", IE = "addEventListener(),alert(),animationStartTime,applicationCache,atob(),blur(),btoa()," + "cancelAnimationFrame(),captureEvents(),clearImmediate(),clearInterval(),clearTimeout()," + "clientInformation,clipboardData,close(),closed,confirm(),console," @@ -797,32 +817,6 @@ public void event() throws Exception { + "resizeTo(),screen,screenLeft,screenTop,screenX,screenY,scroll(),scrollBy(),scrollTo(),self," + "sessionStorage,setImmediate(),setInterval(),setTimeout(),showHelp(),showModalDialog()," + "showModelessDialog(),sortFunction(),status,styleMedia,test(),top,toStaticHTML(),toString()," - + "window", - EDGE = "addEventListener(),alert(),applicationCache,atob(),blur(),btoa(),cancelAnimationFrame()," - + "captureEvents(),chrome,clearImmediate(),clearInterval(),clearTimeout(),clientInformation,close()," - + "closed,confirm(),console,crypto,defaultStatus,devicePixelRatio," - + "dispatchEvent(),document,doNotTrack,event,external,focus(),frameElement,frames," - + "getComputedStyle(),getMatchedCSSRules(),getSelection(),history,ieMethods,indexedDB,innerHeight," - + "innerWidth,length,localStorage,location,locationbar,matchMedia(),menubar,moveBy(),moveTo()," - + "msWriteProfilerMark(),name,navigator,offscreenBuffering,onabort,onafterprint,onbeforeprint," - + "onbeforeunload,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncompassneedscalibration," - + "oncontextmenu,ondblclick,ondevicemotion,ondeviceorientation,ondrag,ondragend,ondragenter," - + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," - + "onhashchange,oninput,onkeydown,onkeypress,onkeyup,onload(),onloadeddata,onloadedmetadata," - + "onloadstart,onmessage,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover," - + "onmouseup,onmousewheel,onmsgesturechange,onmsgesturedoubletap,onmsgestureend,onmsgesturehold," - + "onmsgesturestart,onmsgesturetap,onmsinertiastart,onoffline,ononline,onpagehide,onpageshow," - + "onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," - + "onpointermove,onpointerout,onpointerover,onpointerup,onpopstate,onprogress,onratechange," - + "onreadystatechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onstalled,onstorage," - + "onsubmit,onsuspend,ontimeupdate,onunload,onvolumechange,onwaiting,onwheel,open(),opener," - + "outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,postMessage()," - + "print(),process(),prompt(),releaseEvents(),removeEventListener(),requestAnimationFrame()," - + "resizeBy(),resizeTo(),screen,screenLeft,screenTop,screenX,screenY,scroll(),scrollbars,scrollBy()," - + "scrollTo(),scrollX,scrollY,self,sessionStorage,setImmediate(),setInterval(),setTimeout()," - + "sortFunction(),status,statusbar,styleMedia,test(),toolbar,top,webkitCancelAnimationFrame()," - + "webkitConvertPointFromNodeToPage(),webkitConvertPointFromPageToNode()," - + "webkitRequestAnimationFrame()," + "window") @NotYetImplemented public void window() throws Exception { @@ -862,16 +856,9 @@ public void acronym() throws Exception { @Alerts(DEFAULT = "charset,coords,download,hash,host,hostname,href,hreflang,name,origin,password,pathname,ping," + "port,protocol,referrerPolicy,rel,relList,rev,search,shape,target,text,type," + "username", - FF45 = "charset,coords,download,hash,host,hostname,href,hreflang,name,origin,password,pathname,ping," - + "port,protocol,rel,relList,rev,search,shape,target,text,type," - + "username", IE = "charset,coords,hash,host,hostname,href,hreflang,Methods,mimeType,name,nameProp,pathname,port," - + "protocol,protocolLong,rel,rev,search,shape,target,text,type," - + "urn", - EDGE = "charset,coords,hash,host,hostname,href,hreflang,Methods,mimeType,name,nameProp,pathname,port," + "protocol,protocolLong,rel,rev,search,shape,target,text,type," + "urn") - @NotYetImplemented(EDGE) public void a() throws Exception { test("a"); } @@ -894,14 +881,10 @@ public void address() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "align,alt,archive,code,codeBase,height,hspace,name,object,vspace,width", + @Alerts(DEFAULT = "-", IE = "align,alt,altHtml,archive,BaseHref,border,classid,code,codeBase,codeType,contentDocument,data," - + "declare,form,height,hspace,name,object,standby,type,useMap,vspace,width", - EDGE = "align,alt,altHtml,archive,BaseHref,border,code,codeBase,codeType,contentDocument,data,declare," - + "form,height,hspace,name,object,standby,type,useMap,vspace," - + "width", - CHROME = "-") - @NotYetImplemented({FF, IE}) + + "declare,form,height,hspace,name,object,standby,type,useMap,vspace,width") + @NotYetImplemented(IE) public void applet() throws Exception { test("applet"); } @@ -914,10 +897,7 @@ public void applet() throws Exception { @Test @Alerts(DEFAULT = "alt,coords,download,hash,host,hostname,href,noHref,origin,password,pathname,ping,port," + "protocol,referrerPolicy,rel,relList,search,shape,target,username", - FF45 = "alt,coords,download,hash,host,hostname,href,noHref,origin,password,pathname,ping,port,protocol," - + "rel,relList,search,shape,target,username", - IE = "alt,coords,hash,host,hostname,href,noHref,pathname,port,protocol,rel,search,shape,target", - EDGE = "alt,coords,hash,host,hostname,href,noHref,pathname,port,protocol,rel,search,shape,target") + IE = "alt,coords,hash,host,hostname,href,noHref,pathname,port,protocol,rel,search,shape,target") @NotYetImplemented public void area() throws Exception { test("area"); @@ -961,37 +941,28 @@ public void aside() throws Exception { + "seekable,seeking,setMediaKeys(),setSinkId(),sinkId,src,srcObject,textTracks," + "volume,webkitAudioDecodedByteCount," + "webkitVideoDecodedByteCount", - FF45 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + FF68 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + + "defaultMuted,defaultPlaybackRate,duration,ended,error,fastSeek(),HAVE_CURRENT_DATA,HAVE_ENOUGH_DATA," + + "HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,load(),loop,mediaKeys,mozAudioCaptured," + + "mozCaptureStream(),mozCaptureStreamUntilEnded(),mozFragmentEnd,mozGetMetadata(),mozPreservesPitch," + + "muted,NETWORK_EMPTY,NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted," + + "onwaitingforkey,pause(),paused,play(),playbackRate,played,preload,readyState,seekable,seeking," + + "seekToNextFrame(),setMediaKeys(),src,srcObject,textTracks,volume", + FF60 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + "defaultMuted,defaultPlaybackRate,duration,ended,error,fastSeek(),HAVE_CURRENT_DATA," + "HAVE_ENOUGH_DATA,HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,load(),loop,mediaKeys,mozAudioCaptured," - + "mozAutoplayEnabled,mozCaptureStream()," + + "mozCaptureStream()," + "mozCaptureStreamUntilEnded()," - + "mozFragmentEnd,mozGetMetadata(),mozPreservesPitch,mozSrcObject,muted,NETWORK_EMPTY,NETWORK_IDLE," - + "NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted," + + "mozFragmentEnd,mozGetMetadata(),mozPreservesPitch,muted,NETWORK_EMPTY,NETWORK_IDLE," + + "NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted,onwaitingforkey," + "pause(),paused,play(),playbackRate,played,preload," - + "readyState,seekable,seeking,setMediaKeys(),src,srcObject,textTracks,volume", - FF52 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," - + "defaultMuted,defaultPlaybackRate,duration,ended,error,fastSeek(),HAVE_CURRENT_DATA," - + "HAVE_ENOUGH_DATA,HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,load(),loop,mediaKeys,mozAudioCaptured," - + "mozAutoplayEnabled,mozCaptureStream()," - + "mozCaptureStreamUntilEnded()," - + "mozFragmentEnd,mozGetMetadata(),mozPreservesPitch,mozSrcObject,muted,NETWORK_EMPTY,NETWORK_IDLE," - + "NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted," - + "onwaitingforkey,pause(),paused,play(),playbackRate,played,preload," - + "readyState,seekable,seeking,setMediaKeys(),src,srcObject,textTracks,volume", + + "readyState,seekable,seeking,seekToNextFrame(),setMediaKeys(),src,srcObject,textTracks,volume", IE = "addTextTrack(),audioTracks,autobuffer,autoplay,buffered,canPlayType(),controls,currentSrc," + "currentTime,defaultPlaybackRate,duration,ended,error,HAVE_CURRENT_DATA,HAVE_ENOUGH_DATA," + "HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,initialTime,load(),loop,msPlayToDisabled," + "msPlayToPreferredSourceUri,msPlayToPrimary,muted,NETWORK_EMPTY,NETWORK_IDLE,NETWORK_LOADING," + "NETWORK_NO_SOURCE,networkState,pause(),paused,play(),playbackRate,played,preload,readyState," - + "seekable,seeking,src,textTracks,volume", - EDGE = "addTextTrack(),audioTracks,autoplay,buffered,canPlayType(),controls,currentSrc,currentTime," - + "defaultMuted,defaultPlaybackRate,duration,ended,error,HAVE_CURRENT_DATA,HAVE_ENOUGH_DATA," - + "HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,load(),loop,msGraphicsTrustStatus,msKeys," - + "msPlayToDisabled,msPlayToPreferredSourceUri,msPlayToPrimary,msSetMediaKeys(),muted,NETWORK_EMPTY," - + "NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onmsneedkey,pause(),paused,play()," - + "playbackRate,played,preload,readyState,seekable,seeking,src,srcObject,textTracks,videoTracks," - + "volume") + + "seekable,seeking,src,textTracks,volume") @NotYetImplemented public void audio() throws Exception { test("audio"); @@ -1028,8 +999,7 @@ public void base() throws Exception { */ @Test @Alerts(DEFAULT = "-", - IE = "color,face,size", - EDGE = "color,face,size") + IE = "color,face,size") public void basefont() throws Exception { test("basefont"); } @@ -1104,17 +1074,17 @@ public void blockquote() throws Exception { + "onmessageerror,onoffline,ononline,onpagehide,onpageshow,onpopstate," + "onrejectionhandled,onstorage,onunhandledrejection,onunload," + "text,vLink", - FF = "aLink,background,bgColor,link,onafterprint,onbeforeprint,onbeforeunload,onhashchange," - + "onlanguagechange,onmessage," + FF68 = "aLink,background,bgColor,link,onafterprint,onbeforeprint,onbeforeunload,onhashchange," + + "onlanguagechange,onmessage,onmessageerror," + + "onoffline,ononline,onpagehide,onpageshow,onpopstate,onstorage,onunload,text," + + "vLink", + FF60 = "aLink,background,bgColor,link,onafterprint,onbeforeprint,onbeforeunload,onhashchange," + + "onlanguagechange,onmessage,onmessageerror," + "onoffline,ononline,onpagehide,onpageshow,onpopstate,onstorage,onunload,text," + "vLink", IE = "aLink,background,bgColor,bgProperties,bottomMargin,createTextRange(),leftMargin,link,noWrap," + "onafterprint,onbeforeprint,onbeforeunload,onhashchange,onmessage,onoffline,ononline,onpagehide," + "onpageshow,onpopstate,onresize,onstorage,onunload,rightMargin,scroll,text,topMargin," - + "vLink", - EDGE = "aLink,background,bgColor,bgProperties,link,noWrap,onafterprint,onbeforeprint,onbeforeunload," - + "onhashchange,onmessage,onoffline,ononline,onpagehide,onpageshow,onpopstate,onresize,onstorage," - + "onunload,text," + "vLink") @NotYetImplemented(IE) public void body() throws Exception { @@ -1150,21 +1120,17 @@ public void br() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = "autofocus,checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," + @Alerts(CHROME = "checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," + "formTarget,labels,name,reportValidity(),setCustomValidity(),type,validationMessage,validity," - + "value," - + "willValidate", - FF45 = "autofocus,checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," - + "formTarget,name,setCustomValidity(),type,validationMessage,validity,value," - + "willValidate", - FF52 = "autofocus,checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," - + "formTarget,name,reportValidity(),setCustomValidity(),type,validationMessage,validity,value," - + "willValidate", + + "value,willValidate", + FF68 = "autofocus,checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," + + "formTarget,labels,name,reportValidity(),setCustomValidity(),type,validationMessage,validity," + + "value,willValidate", + FF60 = "autofocus,checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," + + "formTarget,labels,name,reportValidity(),setCustomValidity(),type,validationMessage,validity," + + "value,willValidate", IE = "autofocus,checkValidity(),createTextRange(),form,formAction,formEnctype,formMethod," + "formNoValidate,formTarget,name,setCustomValidity(),status,type,validationMessage,validity,value," - + "willValidate", - EDGE = "autofocus,checkValidity(),disabled,form,formAction,formEnctype,formMethod,formNoValidate," - + "formTarget,name,setCustomValidity(),status,type,validationMessage,validity,value," + "willValidate") @NotYetImplemented public void button() throws Exception { @@ -1177,11 +1143,11 @@ public void button() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = "captureStream(),getContext(),height,toBlob(),toDataURL(),width", + @Alerts(CHROME = "captureStream(),getContext(),height,toBlob()," + + "toDataURL(),transferControlToOffscreen(),width", FF = "captureStream(),getContext(),height," + "mozGetAsFile(),mozOpaque,mozPrintCallback,toBlob(),toDataURL(),width", - IE = "getContext(),height,msToBlob(),toDataURL(),width", - EDGE = "getContext(),height,msToBlob(),toDataURL(),width") + IE = "getContext(),height,msToBlob(),toDataURL(),width") @NotYetImplemented public void canvas() throws Exception { test("canvas"); @@ -1194,9 +1160,7 @@ public void canvas() throws Exception { */ @Test @Alerts(DEFAULT = "align", - IE = "align,vAlign", - EDGE = "align,vAlign") - @NotYetImplemented(EDGE) + IE = "align,vAlign") public void caption() throws Exception { test("caption"); } @@ -1255,7 +1219,6 @@ public void command() throws Exception { */ @Test @Alerts("options") - @NotYetImplemented(EDGE) public void datalist() throws Exception { test("datalist"); } @@ -1301,9 +1264,8 @@ public void del() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "-", - FF52 = "open", - CHROME = "open") + @Alerts(DEFAULT = "open", + IE = "-") public void details() throws Exception { test("details"); } @@ -1341,9 +1303,7 @@ public void dir() throws Exception { */ @Test @Alerts(DEFAULT = "align", - IE = "align,noWrap", - EDGE = "align,noWrap") - @NotYetImplemented(EDGE) + IE = "align,noWrap") public void div() throws Exception { test("div"); } @@ -1379,9 +1339,6 @@ public void dt() throws Exception { @Test @Alerts(DEFAULT = "align,getSVGDocument(),height,name,src,type,width", IE = "getSVGDocument(),height,msPlayToDisabled,msPlayToPreferredSourceUri,msPlayToPrimary,name,palette," - + "pluginspage,readyState,src,units," - + "width", - EDGE = "getSVGDocument(),height,msPlayToDisabled,msPlayToPreferredSourceUri,msPlayToPrimary,name,palette," + "pluginspage,readyState,src,units," + "width") @NotYetImplemented @@ -1409,10 +1366,7 @@ public void em() throws Exception { @Test @Alerts(DEFAULT = "checkValidity(),disabled,elements,form,name,reportValidity(),setCustomValidity(),type," + "validationMessage,validity,willValidate", - FF45 = "checkValidity(),disabled,elements,form,name,setCustomValidity(),type,validationMessage,validity," - + "willValidate", - IE = "align,checkValidity(),form,setCustomValidity(),validationMessage,validity,willValidate", - EDGE = "align,checkValidity(),disabled,form,setCustomValidity(),validationMessage,validity,willValidate") + IE = "align,checkValidity(),form,setCustomValidity(),validationMessage,validity,willValidate") @NotYetImplemented public void fieldset() throws Exception { test("fieldset"); @@ -1460,13 +1414,10 @@ public void font() throws Exception { @Alerts(DEFAULT = "acceptCharset,action,autocomplete,checkValidity(),elements,encoding,enctype,length,method,name," + "noValidate,reportValidity(),reset(),submit()," + "target", - FF45 = "acceptCharset,action,autocomplete,checkValidity(),elements,encoding,enctype,length,method,name," - + "noValidate,reset(),submit()," - + "target", + CHROME = "acceptCharset,action,autocomplete,checkValidity(),elements,encoding,enctype,length,method,name," + + "noValidate,reportValidity(),requestSubmit(),reset(),submit()," + + "target", IE = "acceptCharset,action,autocomplete,checkValidity(),elements,encoding,enctype,item(),length,method," - + "name,namedItem(),noValidate,reset(),submit()," - + "target", - EDGE = "acceptCharset,action,autocomplete,checkValidity(),elements,encoding,enctype,item(),length,method," + "name,namedItem(),noValidate,reset(),submit()," + "target") @NotYetImplemented @@ -1496,9 +1447,6 @@ public void footer() throws Exception { + "src", IE = "border,borderColor,contentDocument,contentWindow,frameBorder,frameSpacing,getSVGDocument()," + "height,longDesc,marginHeight,marginWidth,name,noResize,scrolling,security,src," - + "width", - EDGE = "border,borderColor,contentDocument,contentWindow,frameBorder,frameSpacing,getSVGDocument()," - + "height,longDesc,marginHeight,marginWidth,name,noResize,scrolling,src," + "width") @NotYetImplemented public void frame() throws Exception { @@ -1515,14 +1463,15 @@ public void frame() throws Exception { + "onmessage,onmessageerror,onoffline,ononline,onpagehide," + "onpageshow,onpopstate,onrejectionhandled,onstorage,onunhandledrejection,onunload," + "rows", - FF = "cols,onafterprint,onbeforeprint,onbeforeunload,onhashchange,onlanguagechange,onmessage," - + "onoffline,ononline," + FF68 = "cols,onafterprint,onbeforeprint,onbeforeunload,onhashchange,onlanguagechange,onmessage," + + "onmessageerror,onoffline,ononline," + "onpagehide,onpageshow,onpopstate,onstorage,onunload," + "rows", - IE = "border,borderColor,cols,frameBorder,frameSpacing,name,onafterprint,onbeforeprint,onbeforeunload," - + "onhashchange,onmessage,onoffline,ononline,onpagehide,onpageshow,onresize,onstorage,onunload," + FF60 = "cols,onafterprint,onbeforeprint,onbeforeunload,onhashchange,onlanguagechange,onmessage," + + "onmessageerror,onoffline,ononline," + + "onpagehide,onpageshow,onpopstate,onstorage,onunload," + "rows", - EDGE = "border,borderColor,cols,frameBorder,frameSpacing,name,onafterprint,onbeforeprint,onbeforeunload," + IE = "border,borderColor,cols,frameBorder,frameSpacing,name,onafterprint,onbeforeprint,onbeforeunload," + "onhashchange,onmessage,onoffline,ononline,onpagehide,onpageshow,onresize,onstorage,onunload," + "rows") @NotYetImplemented(IE) @@ -1537,9 +1486,8 @@ public void frameset() throws Exception { */ @Test @Alerts(DEFAULT = "-", - IE = "profile", - EDGE = "profile") - @NotYetImplemented({IE, EDGE}) + IE = "profile") + @NotYetImplemented(IE) public void head() throws Exception { test("head"); } @@ -1656,22 +1604,20 @@ public void html() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(FF45 = "align,allowFullscreen,contentDocument,contentWindow,frameBorder,getSVGDocument(),height," - + "longDesc,marginHeight,marginWidth,name,sandbox,scrolling,src,srcdoc," - + "width", - FF52 = "align,allowFullscreen,contentDocument,contentWindow,frameBorder,getSVGDocument(),height," + @Alerts(FF68 = "align,allowFullscreen,allowPaymentRequest,contentDocument,contentWindow,frameBorder," + + "getSVGDocument(),height,longDesc,marginHeight,marginWidth,name,referrerPolicy," + + "sandbox,scrolling,src,srcdoc,width", + FF60 = "align,allowFullscreen,allowPaymentRequest,contentDocument,contentWindow,frameBorder," + + "getSVGDocument(),height," + "longDesc,marginHeight,marginWidth,name,referrerPolicy,sandbox,scrolling,src,srcdoc," + "width", CHROME = "align,allow,allowFullscreen,allowPaymentRequest,contentDocument,contentWindow," - + "csp,frameBorder,getSVGDocument(),height," - + "longDesc,marginHeight,marginWidth,name,referrerPolicy,sandbox,scrolling,src,srcdoc," + + "csp,featurePolicy,frameBorder,getSVGDocument(),height," + + "loading,longDesc,marginHeight,marginWidth,name," + + "referrerPolicy,sandbox,scrolling,src,srcdoc," + "width", IE = "align,border,contentDocument,contentWindow,frameBorder,frameSpacing,getSVGDocument(),height," + "hspace,longDesc,marginHeight,marginWidth,name,noResize,sandbox,scrolling,security,src,vspace," - + "width", - EDGE = "align,allowFullscreen,border,contentDocument,contentWindow,frameBorder,frameSpacing," - + "getSVGDocument(),height,hspace,longDesc,marginHeight,marginWidth,name,noResize,sandbox,scrolling," - + "src,vspace," + "width") @NotYetImplemented public void iframe() throws Exception { @@ -1696,25 +1642,21 @@ public void q() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(FF45 = "align,alt,border,complete,crossOrigin,currentSrc,height,hspace,isMap,longDesc,lowsrc,name," - + "naturalHeight,naturalWidth,sizes,src,srcset,useMap,vspace,width,x," - + "y", - FF52 = "align,alt,border,complete,crossOrigin,currentSrc,height,hspace,isMap,longDesc,lowsrc,name," + @Alerts(FF68 = "align,alt,border,complete,crossOrigin,currentSrc,decode(),decoding,height,hspace,isMap," + + "longDesc,lowsrc,name,naturalHeight,naturalWidth,referrerPolicy,sizes,src,srcset," + + "useMap,vspace,width,x,y", + FF60 = "align,alt,border,complete,crossOrigin,currentSrc,height,hspace,isMap,longDesc,lowsrc,name," + "naturalHeight,naturalWidth,referrerPolicy,sizes,src,srcset,useMap,vspace,width,x," + "y", CHROME = "align,alt,border,complete,crossOrigin,currentSrc,decode(),decoding," - + "height,hspace,isMap,longDesc,lowsrc,name," + + "height,hspace,isMap,loading,longDesc,lowsrc,name," + "naturalHeight,naturalWidth,referrerPolicy,sizes,src,srcset,useMap,vspace,width,x," + "y", IE = "align,alt,border,complete,crossOrigin,dynsrc,fileCreatedDate,fileModifiedDate,fileUpdatedDate," + "height,href,hspace,isMap,longDesc,loop,lowsrc,mimeType,msPlayToDisabled," + "msPlayToPreferredSourceUri,msPlayToPrimary,name,nameProp,naturalHeight,naturalWidth,protocol,src," + "start,useMap,vrml,vspace," - + "width", - EDGE = "align,alt,border,complete,crossOrigin,height,hspace,isMap,longDesc,msPlayToDisabled," - + "msPlayToPreferredSourceUri,msPlayToPrimary,name,naturalHeight,naturalWidth,src,srcset,useMap," - + "vspace,width,x," - + "y") + + "width") @NotYetImplemented public void img() throws Exception { test("img"); @@ -1731,12 +1673,8 @@ public void img() throws Exception { + "height,href,hspace,isMap,longDesc,loop,lowsrc,mimeType,msPlayToDisabled," + "msPlayToPreferredSourceUri,msPlayToPrimary,name,nameProp,naturalHeight,naturalWidth,protocol,src," + "start,useMap,vrml,vspace," - + "width", - EDGE = "align,alt,border,complete,crossOrigin,height,hspace,isMap,longDesc,msPlayToDisabled," - + "msPlayToPreferredSourceUri,msPlayToPrimary,name,naturalHeight,naturalWidth,src,srcset,useMap," - + "vspace,width,x," - + "y") - @NotYetImplemented({IE, EDGE}) + + "width") + @NotYetImplemented(IE) public void image() throws Exception { test("image"); } @@ -1806,8 +1744,7 @@ public void keygen() throws Exception { */ @Test @Alerts(DEFAULT = "control,form,htmlFor", - IE = "form,htmlFor", - EDGE = "form,htmlFor") + IE = "form,htmlFor") public void label() throws Exception { test("label"); } @@ -1840,12 +1777,8 @@ public void legend() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "-", - CHROME = "width", - FF52 = "width", - IE = "cite,clear,width", - EDGE = "width") - @NotYetImplemented(EDGE) + @Alerts(DEFAULT = "width", + IE = "cite,clear,width") public void listing() throws Exception { test("listing"); } @@ -1868,14 +1801,14 @@ public void li() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = "as,charset,crossOrigin,disabled,href,hreflang,import,integrity," - + "media,referrerPolicy,rel,relList,rev,sheet,sizes,target,type", - FF45 = "charset,crossOrigin,disabled,href,hreflang,integrity," - + "media,rel,relList,rev,sheet,sizes,target,type", - FF52 = "charset,crossOrigin,disabled,href,hreflang,integrity," + @Alerts(CHROME = "as,charset,crossOrigin,disabled,href,hreflang," + + "imageSizes,imageSrcset,import,integrity," + "media,referrerPolicy,rel,relList,rev,sheet,sizes,target,type", - IE = "charset,href,hreflang,media,rel,rev,sheet,target,type", - EDGE = "charset,disabled,href,hreflang,media,rel,rev,sheet,target,type") + FF68 = "as,charset,crossOrigin,disabled,href,hreflang,integrity," + + "media,referrerPolicy,rel,relList,rev,sheet,sizes,target,type", + FF60 = "as,charset,crossOrigin,disabled,href,hreflang,integrity," + + "media,referrerPolicy,rel,relList,rev,sheet,sizes,target,type", + IE = "charset,href,hreflang,media,rel,rev,sheet,target,type") @NotYetImplemented public void link() throws Exception { test("link"); @@ -1920,15 +1853,14 @@ public void mark() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "behavior,bgColor,direction,height,hspace,loop,scrollAmount,scrollDelay,start(),stop(),trueSpeed," + @Alerts(CHROME = "behavior,bgColor,direction,height,hspace,loop,scrollAmount,scrollDelay,start(),stop(),trueSpeed," + "vspace,width", - FF = "align", + FF68 = "behavior,bgColor,direction,height,hspace,loop,onbounce,onfinish,onstart,scrollAmount," + + "scrollDelay,start(),stop(),trueSpeed,vspace,width", + FF60 = "align", IE = "behavior,bgColor,direction,height,hspace,loop,onbounce,onfinish,onstart,scrollAmount,scrollDelay," - + "start(),stop(),trueSpeed,vspace,width", - EDGE = "behavior,bgColor,direction,height,hspace,loop,onbounce,onfinish,onstart,scrollAmount,scrollDelay," - + "start(),stop(),trueSpeed,vspace," - + "width") - @NotYetImplemented({IE, CHROME, EDGE}) + + "start(),stop(),trueSpeed,vspace,width") + @NotYetImplemented({IE, CHROME, FF68}) public void marquee() throws Exception { test("marquee"); } @@ -1941,9 +1873,7 @@ public void marquee() throws Exception { @Test @Alerts(DEFAULT = "compact", FF = "compact,label,type", - IE = "compact,type", - EDGE = "compact,type") - @NotYetImplemented(EDGE) + IE = "compact,type") public void menu() throws Exception { test("menu"); } @@ -1968,9 +1898,7 @@ public void menuitem() throws Exception { */ @Test @Alerts(DEFAULT = "content,httpEquiv,name,scheme", - IE = "charset,content,httpEquiv,name,scheme,url", - EDGE = "charset,content,httpEquiv,name,scheme,url") - @NotYetImplemented(EDGE) + IE = "charset,content,httpEquiv,name,scheme,url") public void meta() throws Exception { test("meta"); } @@ -1982,9 +1910,7 @@ public void meta() throws Exception { */ @Test @Alerts(DEFAULT = "high,labels,low,max,min,optimum,value", - FF = "high,low,max,min,optimum,value", - IE = "-", - EDGE = "-") + IE = "-") public void meter() throws Exception { test("meter"); } @@ -2090,21 +2016,16 @@ public void noscript() throws Exception { + "data,declare,form," + "getSVGDocument(),height,hspace,name,reportValidity(),setCustomValidity(),standby,type,useMap," + "validationMessage,validity,vspace,width,willValidate", - FF45 = "align,archive,border,checkValidity(),code,codeBase,codeType,contentDocument,contentWindow,data," - + "declare,form,getSVGDocument(),height,hspace,name,setCustomValidity(),standby,type,typeMustMatch," - + "useMap,validationMessage,validity,vspace,width,willValidate", - FF52 = "align,archive,border,checkValidity(),code,codeBase,codeType,contentDocument,contentWindow,data," + FF68 = "align,archive,border,checkValidity(),code,codeBase,codeType,contentDocument,contentWindow,data," + "declare,form,getSVGDocument(),height,hspace,name,reportValidity(),setCustomValidity(),standby," - + "type,typeMustMatch,useMap,validationMessage,validity,vspace,width,willValidate", + + "type,useMap,validationMessage,validity,vspace,width,willValidate", + FF60 = "align,archive,border,checkValidity(),code,codeBase,codeType,contentDocument,contentWindow,data," + + "declare,form,getSVGDocument(),height,hspace,name,reportValidity(),setCustomValidity()," + + "standby,type,typeMustMatch,useMap,validationMessage,validity,vspace,width,willValidate", IE = "align,alt,altHtml,archive,BaseHref,border,checkValidity(),classid,code,codeBase,codeType," + "contentDocument,data,declare,form,getSVGDocument(),height,hspace,msPlayToDisabled," + "msPlayToPreferredSourceUri,msPlayToPrimary,name,object,readyState,setCustomValidity(),standby," - + "type,useMap,validationMessage,validity,vspace,width,willValidate", - EDGE = "align,alt,altHtml,archive,BaseHref,border,checkValidity(),code,codeBase,codeType,contentDocument," - + "data,declare,form,getSVGDocument(),height,hspace,msPlayToDisabled,msPlayToPreferredSourceUri," - + "msPlayToPrimary,name,object,readyState,setCustomValidity(),standby,type,useMap,validationMessage," - + "validity,vspace,width," - + "willValidate") + + "type,useMap,validationMessage,validity,vspace,width,willValidate") @NotYetImplemented public void object() throws Exception { test("object"); @@ -2117,8 +2038,7 @@ public void object() throws Exception { */ @Test @Alerts(DEFAULT = "compact,reversed,start,type", - IE = "compact,start,type", - EDGE = "compact,start,type") + IE = "compact,start,type") @NotYetImplemented public void ol() throws Exception { test("ol"); @@ -2131,9 +2051,8 @@ public void ol() throws Exception { */ @Test @Alerts(DEFAULT = "disabled,label", - IE = "defaultSelected,form,index,label,selected,text,value", - EDGE = "defaultSelected,disabled,form,index,label,selected,text,value") - @NotYetImplemented({IE, EDGE}) + IE = "defaultSelected,form,index,label,selected,text,value") + @NotYetImplemented(IE) public void optgroup() throws Exception { test("optgroup"); } @@ -2159,14 +2078,7 @@ public void option() throws Exception { @Alerts(DEFAULT = "checkValidity(),defaultValue,form,htmlFor,labels,name,reportValidity(),setCustomValidity(),type," + "validationMessage,validity,value," + "willValidate", - FF45 = "checkValidity(),defaultValue,form,htmlFor,name,setCustomValidity(),type,validationMessage," - + "validity,value," - + "willValidate", - FF52 = "checkValidity(),defaultValue,form,htmlFor,name,reportValidity(),setCustomValidity()," - + "type,validationMessage,validity,value," - + "willValidate", - IE = "-", - EDGE = "-") + IE = "-") @NotYetImplemented({CHROME, FF}) public void output() throws Exception { test("output"); @@ -2179,9 +2091,7 @@ public void output() throws Exception { */ @Test @Alerts(DEFAULT = "align", - IE = "align,clear", - EDGE = "align,clear") - @NotYetImplemented(EDGE) + IE = "align,clear") public void p() throws Exception { test("p"); } @@ -2228,9 +2138,7 @@ public void pre() throws Exception { */ @Test @Alerts(DEFAULT = "labels,max,position,value", - FF = "max,position,value", - IE = "form,max,position,value", - EDGE = "form,max,position,value") + IE = "form,max,position,value") @NotYetImplemented public void progress() throws Exception { test("progress"); @@ -2305,10 +2213,13 @@ public void samp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "async,charset,crossOrigin,defer,event,htmlFor,integrity,src,text,type", - CHROME = "async,charset,crossOrigin,defer,event,htmlFor,integrity,noModule,src,text,type", - IE = "async,charset,defer,event,htmlFor,src,text,type", - EDGE = "async,charset,defer,event,htmlFor,src,text,type") + @Alerts(CHROME = "async,charset,crossOrigin,defer,event,htmlFor," + + "integrity,noModule,referrerPolicy,src,text,type", + FF60 = "async,charset,crossOrigin,defer,event,htmlFor," + + "integrity,noModule,src,text,type", + FF68 = "async,charset,crossOrigin,defer,event,htmlFor," + + "integrity,noModule,referrerPolicy,src,text,type", + IE = "async,charset,defer,event,htmlFor,src,text,type") @NotYetImplemented public void script() throws Exception { test("script"); @@ -2331,25 +2242,21 @@ public void section() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = "add(),autocomplete,autofocus,checkValidity()," + @Alerts(CHROME = "add(),autocomplete,checkValidity()," + "disabled,form,item(),labels,length,multiple,name,namedItem()," + "options,reportValidity(),required,selectedIndex,selectedOptions,setCustomValidity(),size,type," + "validationMessage,validity,value," + "willValidate", - FF45 = "add(),autofocus,checkValidity(),disabled,form,item(),length,multiple,name," - + "namedItem(),options,required,selectedIndex,selectedOptions,setCustomValidity(),size,type," - + "validationMessage,validity,value," + FF68 = "add(),autocomplete,autofocus,checkValidity(),disabled,form,item(),labels,length,multiple,name," + + "namedItem(),options,reportValidity(),required,selectedIndex,selectedOptions,setCustomValidity()," + + "size,type,validationMessage,validity,value," + "willValidate", - FF52 = "add(),autofocus,checkValidity(),disabled,form,item(),length,multiple,name," + FF60 = "add(),autocomplete,autofocus,checkValidity(),disabled,form,item(),labels,length,multiple,name," + "namedItem(),options,reportValidity(),required,selectedIndex,selectedOptions,setCustomValidity()," + "size,type,validationMessage,validity,value," + "willValidate", IE = "add(),autofocus,checkValidity(),form,item(),length,multiple,name,namedItem(),options,remove()," + "required,selectedIndex,setCustomValidity(),size,type,validationMessage,validity,value," - + "willValidate", - EDGE = "add(),autofocus,checkValidity(),disabled,form,item(),length,multiple,name,namedItem(),options," - + "required,selectedIndex,selectedOptions,setCustomValidity(),size,type,validationMessage,validity," - + "value," + "willValidate") @NotYetImplemented public void select() throws Exception { @@ -2375,8 +2282,7 @@ public void small() throws Exception { */ @Test @Alerts(DEFAULT = "media,sizes,src,srcset,type", - IE = "media,src,type", - EDGE = "media,msKeySystem,src,type") + IE = "media,src,type") @NotYetImplemented public void source() throws Exception { test("source"); @@ -2424,10 +2330,7 @@ public void strong() throws Exception { */ @Test @Alerts(DEFAULT = "disabled,media,sheet,type", - FF = "disabled,media,scoped,sheet,type", - IE = "media,sheet,type", - EDGE = "media,sheet,type") - @NotYetImplemented(EDGE) + IE = "media,sheet,type") public void style() throws Exception { test("style"); } @@ -2492,10 +2395,6 @@ public void svg() throws Exception { + "cells,cellSpacing,cols,createCaption(),createTBody(),createTFoot(),createTHead(),deleteCaption()," + "deleteRow(),deleteTFoot(),deleteTHead(),frame,height,insertRow(),moveRow(),rows,rules,summary," + "tBodies,tFoot,tHead," - + "width", - EDGE = "align,bgColor,border,borderColor,caption,cellPadding,cellSpacing,cols,createCaption()," - + "createTBody(),createTFoot(),createTHead(),deleteCaption(),deleteRow(),deleteTFoot()," - + "deleteTHead(),frame,height,insertRow(),rows,rules,summary,tBodies,tFoot,tHead," + "width") @NotYetImplemented public void table() throws Exception { @@ -2577,9 +2476,8 @@ public void th() throws Exception { @Alerts(DEFAULT = "align,bgColor,cells,ch,chOff,deleteCell(),insertCell(),rowIndex,sectionRowIndex,vAlign", IE = "align,bgColor,borderColor,borderColorDark,borderColorLight,cells,ch,chOff,deleteCell(),height," + "insertCell(),rowIndex,sectionRowIndex," - + "vAlign", - EDGE = "align,bgColor,cells,ch,chOff,deleteCell(),height,insertCell(),rowIndex,sectionRowIndex,vAlign") - @NotYetImplemented({IE, EDGE}) + + "vAlign") + @NotYetImplemented(IE) public void tr() throws Exception { test("tr"); } @@ -2590,26 +2488,24 @@ public void tr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = "autocomplete,autofocus,checkValidity(),cols,defaultValue,dirName,disabled,form,labels," + @Alerts(CHROME = "autocomplete,checkValidity(),cols,defaultValue,dirName,disabled,form,labels," + "maxLength,minLength,name,placeholder,readOnly,reportValidity(),required,rows,select()," + "selectionDirection,selectionEnd,selectionStart,setCustomValidity(),setRangeText()," + "setSelectionRange(),textLength,type,validationMessage,validity,value,willValidate," + "wrap", - FF45 = "autofocus,checkValidity(),cols,defaultValue,disabled,form,maxLength,name,placeholder,readOnly," - + "required,rows,select(),selectionDirection,selectionEnd,selectionStart,setCustomValidity()," - + "setRangeText(),setSelectionRange(),textLength,type,validationMessage,validity,value,willValidate," - + "wrap", - FF52 = "autofocus,checkValidity(),cols,defaultValue,disabled,form,maxLength,minLength,name,placeholder," + FF68 = "autocomplete,autofocus,checkValidity(),cols,defaultValue,disabled,form," + + "labels,maxLength,minLength,name,placeholder," + "readOnly,reportValidity(),required,rows,select(),selectionDirection,selectionEnd," + "selectionStart,setCustomValidity(),setRangeText(),setSelectionRange()," + "textLength,type,validationMessage,validity,value,willValidate,wrap", + FF60 = "autocomplete,autofocus,checkValidity(),cols,defaultValue,disabled,form,labels,maxLength," + + "minLength,name,placeholder,readOnly,reportValidity()," + + "required,rows,select(),selectionDirection,selectionEnd,selectionStart,setCustomValidity()," + + "setRangeText(),setSelectionRange(),textLength,type,validationMessage,validity,value,willValidate," + + "wrap", IE = "autofocus,checkValidity(),cols,createTextRange(),defaultValue,form,maxLength,name,placeholder," + "readOnly,required,rows,select(),selectionEnd,selectionStart,setCustomValidity()," + "setSelectionRange(),status,type,validationMessage,validity,value,willValidate," - + "wrap", - EDGE = "autofocus,checkValidity(),cols,defaultValue,disabled,form,maxLength,name,placeholder,readOnly," - + "required,rows,select(),selectionEnd,selectionStart,setCustomValidity(),setSelectionRange()," - + "status,type,validationMessage,validity,value,willValidate," + "wrap") @NotYetImplemented public void textarea() throws Exception { @@ -2730,43 +2626,44 @@ public void var() throws Exception { @Test @Alerts(CHROME = "addTextTrack(),autoplay,buffered," + "canPlayType(),captureStream(),controls,controlsList,crossOrigin,currentSrc,currentTime," - + "defaultMuted,defaultPlaybackRate,disableRemotePlayback,duration," + + "defaultMuted,defaultPlaybackRate,disablePictureInPicture,disableRemotePlayback,duration," + "ended,error,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," - + "onwaitingforkey,pause(),paused,play(),playbackRate,played," - + "poster,preload,readyState,remote," + + "onenterpictureinpicture,onleavepictureinpicture," + + "onwaitingforkey,pause(),paused,play(),playbackRate,played,playsInline," + + "poster,preload,readyState,remote,requestPictureInPicture()," + "seekable,seeking,setMediaKeys(),setSinkId(),sinkId,src,srcObject," + "textTracks,videoHeight,videoWidth," + "volume,webkitAudioDecodedByteCount,webkitDecodedFrameCount," + "webkitDisplayingFullscreen,webkitDroppedFrameCount," - + "webkitEnterFullscreen(),webkitEnterFullScreen()," - + "webkitExitFullScreen(),webkitExitFullscreen(),webkitSupportsFullscreen,webkitVideoDecodedByteCount," - + "width", - FF45 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + + "webkitEnterFullScreen(),webkitEnterFullscreen()," + + "webkitExitFullScreen(),webkitExitFullscreen()," + + "webkitSupportsFullscreen,webkitVideoDecodedByteCount,width", + FF68 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + "defaultMuted,defaultPlaybackRate,duration,ended,error,fastSeek(),getVideoPlaybackQuality()," + "HAVE_CURRENT_DATA," + "HAVE_ENOUGH_DATA,HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,height,load(),loop,mediaKeys," + "mozAudioCaptured," - + "mozAutoplayEnabled,mozCaptureStream(),mozCaptureStreamUntilEnded()," + + "mozCaptureStream(),mozCaptureStreamUntilEnded()," + "mozDecodedFrames,mozFragmentEnd,mozFrameDelay,mozGetMetadata(),mozHasAudio,mozPaintedFrames," - + "mozParsedFrames,mozPresentedFrames,mozPreservesPitch,mozSrcObject,muted,NETWORK_EMPTY," + + "mozParsedFrames,mozPresentedFrames,mozPreservesPitch,muted,NETWORK_EMPTY," + "NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted," - + "pause(),paused,play(),playbackRate," - + "played,poster,preload,readyState,seekable,seeking,setMediaKeys()," + + "onwaitingforkey,pause(),paused,play(),playbackRate," + + "played,poster,preload,readyState,seekable,seeking,seekToNextFrame(),setMediaKeys()," + "src,srcObject,textTracks,videoHeight,videoWidth,volume," + "width", - FF52 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + FF60 = "addTextTrack(),autoplay,buffered,canPlayType(),controls,crossOrigin,currentSrc,currentTime," + "defaultMuted,defaultPlaybackRate,duration,ended,error,fastSeek(),getVideoPlaybackQuality()," + "HAVE_CURRENT_DATA," + "HAVE_ENOUGH_DATA,HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,height,load(),loop,mediaKeys," + "mozAudioCaptured," - + "mozAutoplayEnabled,mozCaptureStream(),mozCaptureStreamUntilEnded()," + + "mozCaptureStream(),mozCaptureStreamUntilEnded()," + "mozDecodedFrames,mozFragmentEnd,mozFrameDelay,mozGetMetadata(),mozHasAudio,mozPaintedFrames," - + "mozParsedFrames,mozPresentedFrames,mozPreservesPitch,mozSrcObject,muted,NETWORK_EMPTY," + + "mozParsedFrames,mozPresentedFrames,mozPreservesPitch,muted,NETWORK_EMPTY," + "NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,onencrypted," + "onwaitingforkey,pause(),paused,play(),playbackRate," - + "played,poster,preload,readyState,seekable,seeking,setMediaKeys()," + + "played,poster,preload,readyState,seekable,seeking,seekToNextFrame(),setMediaKeys()," + "src,srcObject,textTracks,videoHeight,videoWidth,volume," + "width", IE = "addTextTrack(),audioTracks,autobuffer,autoplay,buffered,canPlayType(),controls,currentSrc," @@ -2775,16 +2672,6 @@ public void var() throws Exception { + "msPlayToPreferredSourceUri,msPlayToPrimary,msZoom,muted,NETWORK_EMPTY,NETWORK_IDLE," + "NETWORK_LOADING,NETWORK_NO_SOURCE,networkState,pause(),paused,play(),playbackRate,played,poster," + "preload,readyState,seekable,seeking,src,textTracks,videoHeight,videoWidth,volume," - + "width", - EDGE = "addTextTrack(),audioTracks,autoplay,buffered,canPlayType(),controls,currentSrc,currentTime," - + "defaultMuted,defaultPlaybackRate,duration,ended,error,getVideoPlaybackQuality()," - + "HAVE_CURRENT_DATA,HAVE_ENOUGH_DATA,HAVE_FUTURE_DATA,HAVE_METADATA,HAVE_NOTHING,height,load()," - + "loop,msGraphicsTrustStatus,msKeys,msPlayToDisabled,msPlayToPreferredSourceUri,msPlayToPrimary," - + "msSetMediaKeys(),msZoom,muted,NETWORK_EMPTY,NETWORK_IDLE,NETWORK_LOADING,NETWORK_NO_SOURCE," - + "networkState,onmsneedkey,pause(),paused,play(),playbackRate,played,poster,preload,readyState," - + "seekable,seeking,src,srcObject,textTracks,videoHeight,videoTracks,videoWidth,volume," - + "webkitDisplayingFullscreen,webkitEnterFullscreen(),webkitEnterFullScreen()," - + "webkitExitFullscreen(),webkitExitFullScreen(),webkitSupportsFullscreen," + "width") @NotYetImplemented public void video() throws Exception { @@ -2809,9 +2696,7 @@ public void wbr() throws Exception { */ @Test @Alerts(DEFAULT = "width", - FF45 = "-", IE = "cite,clear,width") - @NotYetImplemented(EDGE) public void xmp() throws Exception { test("xmp"); } @@ -2822,40 +2707,36 @@ public void xmp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(FF45 = "accept,align,alt,autocomplete,autofocus,checked,checkValidity(),defaultChecked,defaultValue," + @Alerts(FF68 = "accept,align,alt,autocomplete,autofocus,checked,checkValidity(),defaultChecked,defaultValue," + "disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget,height," - + "indeterminate,list,max,maxLength,min,mozIsTextField(),multiple,name,pattern,placeholder,readOnly," - + "required,select(),selectionDirection,selectionEnd,selectionStart,setCustomValidity()," - + "setRangeText(),setSelectionRange(),size,src,step,stepDown(),stepUp(),textLength,type,useMap," - + "validationMessage,validity,value,valueAsNumber,width,willValidate", - FF52 = "accept,align,alt,autocomplete,autofocus,checked,checkValidity(),defaultChecked,defaultValue," - + "disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget,height," - + "indeterminate,list,max,maxLength,min,minLength,mozIsTextField(),multiple,name," + + "indeterminate,labels,list,max,maxLength,min,minLength,mozIsTextField(),multiple,name," + "pattern,placeholder,readOnly,reportValidity(),required," + "select(),selectionDirection,selectionEnd,selectionStart,setCustomValidity()," + "setRangeText(),setSelectionRange(),size,src,step,stepDown(),stepUp(),textLength,type,useMap," - + "validationMessage,validity,value,valueAsNumber,webkitdirectory,webkitEntries,width,willValidate", + + "validationMessage,validity,value,valueAsDate,valueAsNumber,webkitdirectory,webkitEntries," + + "width,willValidate", + FF60 = "accept,align,alt,autocomplete,autofocus,checked,checkValidity(),defaultChecked,defaultValue," + + "disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget,height," + + "indeterminate,labels,list,max,maxLength,min,minLength,mozIsTextField(),multiple,name," + + "pattern,placeholder,readOnly,reportValidity()," + + "required,select(),selectionDirection,selectionEnd,selectionStart,setCustomValidity()," + + "setRangeText(),setSelectionRange(),size,src,step,stepDown(),stepUp(),textLength,type,useMap," + + "validationMessage,validity,value,valueAsDate,valueAsNumber," + + "webkitdirectory,webkitEntries,width,willValidate", IE = "accept,align,alt,autocomplete,autofocus,border,checked,checkValidity(),complete," + "createTextRange(),defaultChecked,defaultValue,dynsrc,files,form,formAction,formEnctype," + "formMethod,formNoValidate,formTarget,height,hspace,indeterminate,list,loop,lowsrc,max,maxLength," + "min,multiple,name,pattern,placeholder,readOnly,required,select(),selectionEnd,selectionStart," + "setCustomValidity(),setSelectionRange(),size,src,start,status,step,stepDown(),stepUp(),type," + "useMap,validationMessage,validity,value,valueAsNumber,vrml,vspace,width,willValidate", - CHROME = "accept,align,alt,autocomplete,autofocus,checked,checkValidity()," + CHROME = "accept,align,alt,autocomplete,checked,checkValidity()," + "defaultChecked,defaultValue," + "dirName,disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget,height," + "incremental,indeterminate,labels,list,max,maxLength,min,minLength,multiple,name,pattern," + "placeholder,readOnly,reportValidity(),required,select(),selectionDirection,selectionEnd," + "selectionStart,setCustomValidity(),setRangeText(),setSelectionRange(),size,src,step,stepDown()," + "stepUp(),type,useMap,validationMessage,validity,value,valueAsDate,valueAsNumber,webkitdirectory," - + "webkitEntries,width,willValidate", - EDGE = "accept,align,alt,autocomplete,autofocus,border,checked,checkValidity(),complete,defaultChecked," - + "defaultValue,disabled,files,form,formAction,formEnctype,formMethod,formNoValidate,formTarget," - + "height,hspace,indeterminate,list,max,maxLength,min,multiple,name,pattern,placeholder,readOnly," - + "required,select(),selectionEnd,selectionStart,setCustomValidity(),setSelectionRange(),size,src," - + "status,step,stepDown(),stepUp(),type,useMap,validationMessage,validity,value,valueAsDate," - + "valueAsNumber,vspace,width," - + "willValidate") + + "webkitEntries,width,willValidate") @NotYetImplemented public void input() throws Exception { test("input"); @@ -2880,9 +2761,8 @@ public void data() throws Exception { */ @Test @Alerts(DEFAULT = "-", - CHROME = "getDistributedNodes(),select", - FF45 = "getDistributedNodes(),select") - @NotYetImplemented({CHROME, FF45}) + CHROME = "getDistributedNodes(),select") + @NotYetImplemented(CHROME) public void content() throws Exception { test("content"); } @@ -2905,8 +2785,7 @@ public void picutre() throws Exception { */ @Test @Alerts(DEFAULT = "content", - IE = "-", - EDGE = "-") + IE = "-") public void template() throws Exception { test("template"); } @@ -2922,7 +2801,40 @@ public void template() throws Exception { + "DOM_KEY_LOCATION_STANDARD,getModifierState(),initKeyboardEvent(),isComposing," + "key,keyCode,location,metaKey,repeat," + "shiftKey", - FF = "altKey,charCode,code,ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + FF68 = "altKey,charCode,code,ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,DOM_VK_0,DOM_VK_1,DOM_VK_2,DOM_VK_3,DOM_VK_4," + + "DOM_VK_5,DOM_VK_6,DOM_VK_7,DOM_VK_8,DOM_VK_9,DOM_VK_A,DOM_VK_ACCEPT,DOM_VK_ADD,DOM_VK_ALT," + + "DOM_VK_ALTGR,DOM_VK_AMPERSAND,DOM_VK_ASTERISK,DOM_VK_AT,DOM_VK_ATTN,DOM_VK_B,DOM_VK_BACK_QUOTE," + + "DOM_VK_BACK_SLASH,DOM_VK_BACK_SPACE,DOM_VK_C,DOM_VK_CANCEL,DOM_VK_CAPS_LOCK,DOM_VK_CIRCUMFLEX," + + "DOM_VK_CLEAR,DOM_VK_CLOSE_BRACKET,DOM_VK_CLOSE_CURLY_BRACKET,DOM_VK_CLOSE_PAREN,DOM_VK_COLON," + + "DOM_VK_COMMA,DOM_VK_CONTEXT_MENU,DOM_VK_CONTROL,DOM_VK_CONVERT,DOM_VK_CRSEL,DOM_VK_D," + + "DOM_VK_DECIMAL,DOM_VK_DELETE,DOM_VK_DIVIDE,DOM_VK_DOLLAR,DOM_VK_DOUBLE_QUOTE,DOM_VK_DOWN," + + "DOM_VK_E,DOM_VK_EISU,DOM_VK_END,DOM_VK_EQUALS,DOM_VK_EREOF,DOM_VK_ESCAPE,DOM_VK_EXCLAMATION," + + "DOM_VK_EXECUTE,DOM_VK_EXSEL,DOM_VK_F,DOM_VK_F1,DOM_VK_F10,DOM_VK_F11,DOM_VK_F12,DOM_VK_F13," + + "DOM_VK_F14,DOM_VK_F15,DOM_VK_F16,DOM_VK_F17,DOM_VK_F18,DOM_VK_F19,DOM_VK_F2,DOM_VK_F20,DOM_VK_F21," + + "DOM_VK_F22,DOM_VK_F23,DOM_VK_F24,DOM_VK_F3,DOM_VK_F4,DOM_VK_F5,DOM_VK_F6,DOM_VK_F7,DOM_VK_F8," + + "DOM_VK_F9,DOM_VK_FINAL,DOM_VK_G,DOM_VK_GREATER_THAN,DOM_VK_H,DOM_VK_HANGUL,DOM_VK_HANJA," + + "DOM_VK_HASH,DOM_VK_HELP,DOM_VK_HOME,DOM_VK_HYPHEN_MINUS,DOM_VK_I,DOM_VK_INSERT,DOM_VK_J," + + "DOM_VK_JUNJA,DOM_VK_K,DOM_VK_KANA,DOM_VK_KANJI,DOM_VK_L,DOM_VK_LEFT,DOM_VK_LESS_THAN,DOM_VK_M," + + "DOM_VK_META,DOM_VK_MODECHANGE,DOM_VK_MULTIPLY,DOM_VK_N,DOM_VK_NONCONVERT,DOM_VK_NUM_LOCK," + + "DOM_VK_NUMPAD0,DOM_VK_NUMPAD1,DOM_VK_NUMPAD2,DOM_VK_NUMPAD3,DOM_VK_NUMPAD4,DOM_VK_NUMPAD5," + + "DOM_VK_NUMPAD6,DOM_VK_NUMPAD7,DOM_VK_NUMPAD8,DOM_VK_NUMPAD9,DOM_VK_O,DOM_VK_OPEN_BRACKET," + + "DOM_VK_OPEN_CURLY_BRACKET,DOM_VK_OPEN_PAREN,DOM_VK_P,DOM_VK_PA1,DOM_VK_PAGE_DOWN,DOM_VK_PAGE_UP," + + "DOM_VK_PAUSE,DOM_VK_PERCENT,DOM_VK_PERIOD,DOM_VK_PIPE,DOM_VK_PLAY,DOM_VK_PLUS,DOM_VK_PRINT," + + "DOM_VK_PRINTSCREEN,DOM_VK_PROCESSKEY,DOM_VK_Q,DOM_VK_QUESTION_MARK,DOM_VK_QUOTE,DOM_VK_R," + + "DOM_VK_RETURN,DOM_VK_RIGHT,DOM_VK_S,DOM_VK_SCROLL_LOCK,DOM_VK_SELECT,DOM_VK_SEMICOLON," + + "DOM_VK_SEPARATOR,DOM_VK_SHIFT,DOM_VK_SLASH,DOM_VK_SLEEP,DOM_VK_SPACE,DOM_VK_SUBTRACT,DOM_VK_T," + + "DOM_VK_TAB,DOM_VK_TILDE,DOM_VK_U,DOM_VK_UNDERSCORE,DOM_VK_UP,DOM_VK_V,DOM_VK_VOLUME_DOWN," + + "DOM_VK_VOLUME_MUTE,DOM_VK_VOLUME_UP,DOM_VK_W,DOM_VK_WIN,DOM_VK_WIN_ICO_00,DOM_VK_WIN_ICO_CLEAR," + + "DOM_VK_WIN_ICO_HELP,DOM_VK_WIN_OEM_ATTN,DOM_VK_WIN_OEM_AUTO,DOM_VK_WIN_OEM_BACKTAB," + + "DOM_VK_WIN_OEM_CLEAR,DOM_VK_WIN_OEM_COPY,DOM_VK_WIN_OEM_CUSEL,DOM_VK_WIN_OEM_ENLW," + + "DOM_VK_WIN_OEM_FINISH,DOM_VK_WIN_OEM_FJ_JISHO,DOM_VK_WIN_OEM_FJ_LOYA,DOM_VK_WIN_OEM_FJ_MASSHOU," + + "DOM_VK_WIN_OEM_FJ_ROYA,DOM_VK_WIN_OEM_FJ_TOUROKU,DOM_VK_WIN_OEM_JUMP,DOM_VK_WIN_OEM_PA1," + + "DOM_VK_WIN_OEM_PA2,DOM_VK_WIN_OEM_PA3,DOM_VK_WIN_OEM_RESET,DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X," + + "DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM," + + "getModifierState(),initKeyboardEvent(),initKeyEvent(),isComposing," + + "key,keyCode,location,metaKey,repeat,shiftKey", + FF60 = "altKey,charCode,code,ctrlKey,DOM_KEY_LOCATION_LEFT,DOM_KEY_LOCATION_NUMPAD," + "DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD,DOM_VK_0,DOM_VK_1,DOM_VK_2,DOM_VK_3,DOM_VK_4," + "DOM_VK_5,DOM_VK_6,DOM_VK_7,DOM_VK_8,DOM_VK_9,DOM_VK_A,DOM_VK_ACCEPT,DOM_VK_ADD,DOM_VK_ALT," + "DOM_VK_ALTGR,DOM_VK_AMPERSAND,DOM_VK_ASTERISK,DOM_VK_AT,DOM_VK_ATTN,DOM_VK_B,DOM_VK_BACK_QUOTE," @@ -2952,13 +2864,9 @@ public void template() throws Exception { + "DOM_VK_WIN_OEM_ENLW,DOM_VK_WIN_OEM_FINISH,DOM_VK_WIN_OEM_FJ_JISHO,DOM_VK_WIN_OEM_FJ_LOYA," + "DOM_VK_WIN_OEM_FJ_MASSHOU,DOM_VK_WIN_OEM_FJ_ROYA,DOM_VK_WIN_OEM_FJ_TOUROKU,DOM_VK_WIN_OEM_JUMP," + "DOM_VK_WIN_OEM_PA1,DOM_VK_WIN_OEM_PA2,DOM_VK_WIN_OEM_PA3,DOM_VK_WIN_OEM_RESET," - + "DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X,DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM,getModifierState(),initKeyEvent()," - + "isComposing,key,keyCode,location,metaKey,repeat,shiftKey", + + "DOM_VK_WIN_OEM_WSCTRL,DOM_VK_X,DOM_VK_Y,DOM_VK_Z,DOM_VK_ZOOM,getModifierState()," + + "initKeyboardEvent(),initKeyEvent(),isComposing,key,keyCode,location,metaKey,repeat,shiftKey", IE = "altKey,char,charCode,ctrlKey,DOM_KEY_LOCATION_JOYSTICK,DOM_KEY_LOCATION_LEFT," - + "DOM_KEY_LOCATION_MOBILE,DOM_KEY_LOCATION_NUMPAD,DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD," - + "getModifierState(),initKeyboardEvent(),key,keyCode,locale,location,metaKey,repeat,shiftKey," - + "which", - EDGE = "altKey,char,charCode,ctrlKey,DOM_KEY_LOCATION_JOYSTICK,DOM_KEY_LOCATION_LEFT," + "DOM_KEY_LOCATION_MOBILE,DOM_KEY_LOCATION_NUMPAD,DOM_KEY_LOCATION_RIGHT,DOM_KEY_LOCATION_STANDARD," + "getModifierState(),initKeyboardEvent(),key,keyCode,locale,location,metaKey,repeat,shiftKey," + "which") @@ -2974,16 +2882,211 @@ public void keyboardEvent() throws Exception { */ @Test @Alerts(CHROME = "detail,initUIEvent(),sourceCapabilities,view,which", - FF45 = "cancelBubble,detail,initUIEvent(),isChar,layerX,layerY,pageX,pageY,rangeOffset,rangeParent," + FF68 = "detail,initUIEvent(),layerX,layerY,pageX,pageY,rangeOffset,rangeParent," + "SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view,which", - FF52 = "detail,initUIEvent(),isChar,layerX,layerY,pageX,pageY,rangeOffset,rangeParent," + FF60 = "detail,initUIEvent(),layerX,layerY,pageX,pageY,rangeOffset,rangeParent," + "SCROLL_PAGE_DOWN,SCROLL_PAGE_UP,view,which", IE = "detail,initUIEvent(),view") - @NotYetImplemented + @NotYetImplemented({CHROME, FF}) public void uiEvent() throws Exception { testString("document.createEvent('UIEvent'), document.createEvent('Event')"); } + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.DragEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "dataTransfer", + FF68 = "dataTransfer,initDragEvent()", + FF60 = "dataTransfer,initDragEvent()", + IE = "dataTransfer,initDragEvent(),msConvertURL()") + @NotYetImplemented + public void dragEvent() throws Exception { + testString("document.createEvent('DragEvent'), document.createEvent('MouseEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.PointerEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "getCoalescedEvents(),getPredictedEvents(),height," + + "isPrimary,pointerId,pointerType,pressure," + + "tangentialPressure,tiltX,tiltY,twist,width", + FF = "getCoalescedEvents(),height,isPrimary,pointerId,pointerType,pressure," + + "tangentialPressure,tiltX,tiltY,twist,width", + IE = "exception") + @NotYetImplemented({CHROME, FF}) + public void pointerEvent() throws Exception { + testString("new PointerEvent('click'), document.createEvent('MouseEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.PointerEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "exception", + FF68 = "exception", + FF60 = "exception", + IE = "height,hwTimestamp,initPointerEvent(),isPrimary,pointerId," + + "pointerType,pressure,rotation,tiltX,tiltY,width") + @NotYetImplemented(IE) + public void pointerEvent2() throws Exception { + testString(" document.createEvent('PointerEvent'), document.createEvent('MouseEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.WheelEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "deltaMode,deltaX,deltaY,deltaZ,DOM_DELTA_LINE,DOM_DELTA_PAGE," + + "DOM_DELTA_PIXEL,wheelDelta,wheelDeltaX,wheelDeltaY", + FF68 = "exception", + FF60 = "exception", + IE = "deltaMode,deltaX,deltaY,deltaZ,DOM_DELTA_LINE,DOM_DELTA_PAGE,DOM_DELTA_PIXEL,initWheelEvent()") + @NotYetImplemented({CHROME, IE}) + public void wheelEvent() throws Exception { + testString("document.createEvent('WheelEvent'), document.createEvent('MouseEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.MouseEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "altKey,button,buttons,clientX,clientY,ctrlKey,fromElement,getModifierState()," + + "initMouseEvent(),layerX,layerY,metaKey,movementX,movementY,offsetX,offsetY," + + "pageX,pageY,relatedTarget,screenX,screenY,shiftKey,toElement,x,y", + FF68 = "altKey,button,buttons,clientX,clientY,ctrlKey,getModifierState(),initMouseEvent()," + + "initNSMouseEvent(),metaKey,movementX,movementY,MOZ_SOURCE_CURSOR,MOZ_SOURCE_ERASER," + + "MOZ_SOURCE_KEYBOARD,MOZ_SOURCE_MOUSE,MOZ_SOURCE_PEN,MOZ_SOURCE_TOUCH,MOZ_SOURCE_UNKNOWN," + + "mozInputSource,mozPressure,offsetX,offsetY,region,relatedTarget,screenX,screenY,shiftKey,x,y", + FF60 = "altKey,button,buttons,clientX,clientY,ctrlKey,getModifierState(),initMouseEvent()," + + "initNSMouseEvent(),metaKey,movementX,movementY,MOZ_SOURCE_CURSOR,MOZ_SOURCE_ERASER," + + "MOZ_SOURCE_KEYBOARD,MOZ_SOURCE_MOUSE,MOZ_SOURCE_PEN,MOZ_SOURCE_TOUCH,MOZ_SOURCE_UNKNOWN," + + "mozInputSource,mozPressure,offsetX,offsetY,region,relatedTarget,screenX,screenY,shiftKey,x,y", + IE = "altKey,button,buttons,clientX,clientY,ctrlKey,fromElement,getModifierState(),initMouseEvent()," + + "layerX,layerY,metaKey,offsetX,offsetY,pageX,pageY,relatedTarget,screenX,screenY,shiftKey," + + "toElement,which,x,y") + @NotYetImplemented + public void mouseEvent() throws Exception { + testString("document.createEvent('MouseEvent'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.CompositionEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "data,initCompositionEvent()", + FF60 = "data,initCompositionEvent(),locale", + FF68 = "data,initCompositionEvent(),locale", + IE = "data,initCompositionEvent(),locale") + @NotYetImplemented + public void compositionEvent() throws Exception { + testString("document.createEvent('CompositionEvent'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.FocusEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "relatedTarget", + FF68 = "relatedTarget", + FF60 = "relatedTarget", + IE = "initFocusEvent(),relatedTarget") + @NotYetImplemented({CHROME, FF, IE}) + public void focusEvent() throws Exception { + testString("document.createEvent('FocusEvent'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.InputEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "data,dataTransfer,getTargetRanges(),inputType,isComposing", + FF68 = "data,dataTransfer,inputType,isComposing", + FF60 = "isComposing", + IE = "exception") + @NotYetImplemented({CHROME, FF}) + public void inputEvent() throws Exception { + testString("new InputEvent('input'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.MouseWheelEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "exception", + FF68 = "exception", + FF60 = "exception", + IE = "altKey,button,buttons,clientX,clientY,ctrlKey,fromElement,getModifierState(),initMouseEvent()," + + "initMouseWheelEvent(),layerX,layerY,metaKey,offsetX,offsetY,pageX,pageY,relatedTarget," + + "screenX,screenY,shiftKey,toElement,wheelDelta,which,x,y") + @NotYetImplemented(IE) + public void mouseWheelEvent() throws Exception { + testString("document.createEvent('MouseWheelEvent'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.SVGZoomEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts("exception") + public void svgZoomEvent() throws Exception { + testString("document.createEvent('SVGZoomEvent'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.TextEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "data,initTextEvent()", + FF68 = "data,initCompositionEvent(),locale", + FF60 = "data,initCompositionEvent(),locale", + IE = "data,DOM_INPUT_METHOD_DROP,DOM_INPUT_METHOD_HANDWRITING,DOM_INPUT_METHOD_IME," + + "DOM_INPUT_METHOD_KEYBOARD,DOM_INPUT_METHOD_MULTIMODAL,DOM_INPUT_METHOD_OPTION," + + "DOM_INPUT_METHOD_PASTE,DOM_INPUT_METHOD_SCRIPT,DOM_INPUT_METHOD_UNKNOWN," + + "DOM_INPUT_METHOD_VOICE,initTextEvent(),inputMethod,locale") + @NotYetImplemented + public void textEvent() throws Exception { + testString("document.createEvent('TextEvent'), document.createEvent('UIEvent')"); + } + + /** + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.TouchEvent}. + * + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = "altKey,changedTouches,ctrlKey,metaKey,shiftKey,targetTouches,touches", + FF68 = "exception", + FF60 = "exception", + IE = "exception") + @NotYetImplemented(CHROME) + public void touchEvent2() throws Exception { + testString("new TouchEvent('touch'), document.createEvent('UIEvent')"); + } + /** * Test {@link com.gargoylesoftware.htmlunit.html.HtmlSlot}. * @@ -2991,8 +3094,9 @@ public void uiEvent() throws Exception { */ @Test @Alerts(DEFAULT = "-", - CHROME = "assignedElements(),assignedNodes(),name") - @NotYetImplemented(CHROME) + CHROME = "assignedElements(),assignedNodes(),name", + FF68 = "assignedElements(),assignedNodes(),name") + @NotYetImplemented({CHROME, FF68}) public void slot() throws Exception { test("slot"); } @@ -3004,15 +3108,11 @@ public void slot() throws Exception { */ @Test @Alerts(DEFAULT = "-", - FF45 = "alinkColor,all,anchors,applets,bgColor,body,captureEvents(),clear(),close(),cookie,designMode," - + "domain," - + "embeds,execCommand(),fgColor,forms,getElementsByName(),getItems(),getSelection(),head,images," - + "linkColor,links," - + "open(),plugins,queryCommandEnabled(),queryCommandIndeterm(),queryCommandState()," - + "queryCommandSupported(),queryCommandValue(),releaseEvents(),scripts,vlinkColor,write(),writeln()", - FF52 = "alinkColor,all,anchors,applets,bgColor,body,captureEvents(),clear(),close(),cookie,designMode," - + "domain," - + "embeds,execCommand(),fgColor,forms,getElementsByName(),getSelection(),head,images," + FF68 = "alinkColor,all,bgColor,captureEvents(),clear(),close(),designMode,domain,execCommand(),fgColor," + + "linkColor,open(),queryCommandEnabled(),queryCommandIndeterm(),queryCommandState()," + + "queryCommandSupported(),queryCommandValue(),releaseEvents(),vlinkColor,write(),writeln()", + FF60 = "alinkColor,all,anchors,applets,bgColor,captureEvents(),clear(),close(),cookie,designMode," + + "domain,embeds,execCommand(),fgColor,forms,head,images," + "linkColor,links," + "open(),plugins,queryCommandEnabled(),queryCommandIndeterm(),queryCommandState()," + "queryCommandSupported(),queryCommandValue(),releaseEvents(),scripts,vlinkColor,write(),writeln()") @@ -3027,85 +3127,109 @@ public void htmlDocument() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "activeElement,adoptNode(),alinkColor,all,anchors,append(),applets," + @Alerts(CHROME = "activeElement,adoptedStyleSheets,adoptNode(),alinkColor,all,anchors,append(),applets," + "bgColor,body,captureEvents(),caretRangeFromPoint(),characterSet," + "charset,childElementCount,children,clear(),close(),compatMode,contentType,cookie,createAttribute()," + "createAttributeNS(),createCDATASection(),createComment(),createDocumentFragment(),createElement()," + "createElementNS(),createEvent(),createExpression(),createNodeIterator(),createNSResolver()," + "createProcessingInstruction(),createRange(),createTextNode(),createTreeWalker(),currentScript," + "defaultView,designMode,dir,doctype,documentElement,documentURI,domain,elementFromPoint()," - + "elementsFromPoint(),embeds,evaluate(),execCommand(),exitPointerLock()," - + "fgColor,firstElementChild,fonts,forms," + + "elementsFromPoint(),embeds,evaluate(),execCommand()," + + "exitFullscreen(),exitPictureInPicture(),exitPointerLock(),featurePolicy," + + "fgColor,firstElementChild,fonts,forms,fullscreen,fullscreenElement,fullscreenEnabled," + "getElementById(),getElementsByClassName(),getElementsByName(),getElementsByTagName()," + "getElementsByTagNameNS(),getSelection(),hasFocus(),head,hidden,images,implementation,importNode()," + "inputEncoding,lastElementChild,lastModified," - + "linkColor,links,location,onabort,onauxclick,onbeforecopy," + + "linkColor,links,location,onabort,onanimationend,onanimationiteration,onanimationstart," + + "onauxclick,onbeforecopy," + "onbeforecut,onbeforepaste,onblur,oncancel,oncanplay,oncanplaythrough,onchange,onclick,onclose," + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave," - + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror," + + "onfocus,onformdata,onfreeze,onfullscreenchange,onfullscreenerror," + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove," + "onmouseout,onmouseover,onmouseup,onmousewheel,onpaste,onpause,onplay,onplaying,onpointercancel," + "onpointerdown,onpointerenter,onpointerleave,onpointerlockchange,onpointerlockerror,onpointermove," - + "onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreadystatechange,onreset,onresize," - + "onscroll,onsearch,onseeked,onseeking,onselect,onselectionchange,onselectstart,onstalled," - + "onsubmit,onsuspend,ontimeupdate,ontoggle,onvisibilitychange,onvolumechange,onwaiting," - + "onwebkitfullscreenchange," - + "onwebkitfullscreenerror,onwheel,open(),origin,plugins,pointerLockElement,preferredStylesheetSet," + + "onpointerout,onpointerover,onpointerrawupdate,onpointerup," + + "onprogress,onratechange,onreadystatechange,onreset,onresize," + + "onresume,onscroll,onsearch,onsecuritypolicyviolation,onseeked,onseeking,onselect,onselectionchange," + + "onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvisibilitychange," + + "onvolumechange,onwaiting,onwebkitfullscreenchange," + + "onwebkitfullscreenerror,onwheel,open(),pictureInPictureElement,pictureInPictureEnabled," + + "plugins,pointerLockElement," + "prepend(),queryCommandEnabled(),queryCommandIndeterm(),queryCommandState(),queryCommandSupported()," + "queryCommandValue(),querySelector(),querySelectorAll(),readyState,referrer,registerElement()," + "releaseEvents(),rootElement," - + "scripts,scrollingElement,selectedStylesheetSet,styleSheets,title,URL," - + "visibilityState,vlinkColor," + + "scripts,scrollingElement,styleSheets,title,URL," + + "visibilityState,vlinkColor,wasDiscarded," + "webkitCancelFullScreen(),webkitCurrentFullScreenElement,webkitExitFullscreen()," + "webkitFullscreenElement,webkitFullscreenEnabled,webkitHidden,webkitIsFullScreen," + "webkitVisibilityState,write(),writeln(),xmlEncoding,xmlStandalone,xmlVersion", - FF45 = "activeElement,adoptNode(),async,caretPositionFromPoint(),characterSet,charset,childElementCount," + FF68 = "activeElement,adoptNode(),anchors,append(),applets,async,body,caretPositionFromPoint()," + + "characterSet,charset,childElementCount,children,compatMode,contentType,cookie,createAttribute()," + + "createAttributeNS(),createCDATASection(),createComment(),createDocumentFragment()," + + "createElement(),createElementNS(),createEvent(),createExpression(),createNodeIterator()," + + "createNSResolver(),createProcessingInstruction(),createRange(),createTextNode(),createTreeWalker()," + + "currentScript,defaultView,dir,doctype,documentElement,documentURI,elementFromPoint()," + + "elementsFromPoint(),embeds,enableStyleSheetsForSet(),evaluate(),exitFullscreen(),exitPointerLock()," + + "firstElementChild,fonts,forms,fullscreen,fullscreenElement,fullscreenEnabled,getElementById()," + + "getElementsByClassName(),getElementsByName(),getElementsByTagName(),getElementsByTagNameNS()," + + "getSelection(),hasFocus(),hasStorageAccess(),head,hidden,images,implementation,importNode()," + + "inputEncoding,lastElementChild,lastModified,lastStyleSheetSet,links,load(),location," + + "mozCancelFullScreen(),mozFullScreen,mozFullScreenElement,mozFullScreenEnabled,mozSetImageElement()," + + "onabort,onafterscriptexecute,onanimationcancel,onanimationend,onanimationiteration,onanimationstart," + + "onauxclick,onbeforescriptexecute,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "onfullscreenchange,onfullscreenerror,ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown," + + "onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange," + + "onmozfullscreenerror,onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter," + + "onpointerleave,onpointerlockchange,onpointerlockerror,onpointermove,onpointerout,onpointerover," + + "onpointerup,onprogress,onratechange,onreadystatechange,onreset,onresize,onscroll,onseeked,onseeking," + + "onselect,onselectionchange,onselectstart,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle," + + "ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,onvisibilitychange," + + "onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart," + + "onwebkittransitionend,onwheel,plugins,pointerLockElement,preferredStyleSheetSet,prepend()," + + "querySelector(),querySelectorAll(),readyState,referrer,releaseCapture(),requestStorageAccess()," + + "rootElement,scripts,scrollingElement," + + "selectedStyleSheetSet,styleSheets,styleSheetSets,title,URL,visibilityState", + FF60 = "activeElement,adoptNode(),append(),async,body," + + "caretPositionFromPoint(),characterSet,charset,childElementCount," + "children,compatMode,contentType,createAttribute(),createAttributeNS(),createCDATASection()," + "createComment(),createDocumentFragment(),createElement(),createElementNS(),createEvent()," + "createExpression(),createNodeIterator(),createNSResolver(),createProcessingInstruction()," + "createRange(),createTextNode(),createTreeWalker(),currentScript,defaultView,dir,doctype," - + "documentElement,documentURI,elementFromPoint(),enableStyleSheetsForSet(),evaluate()," - + "firstElementChild,fonts,getElementById(),getElementsByClassName(),getElementsByTagName()," - + "getElementsByTagNameNS(),hasFocus(),hidden,implementation,importNode(),inputEncoding," + + "documentElement,documentURI,elementFromPoint(),elementsFromPoint()," + + "enableStyleSheetsForSet(),evaluate(),exitPointerLock()," + + "firstElementChild,fonts,getElementById(),getElementsByClassName(),getElementsByName()," + + "getElementsByTagName()," + + "getElementsByTagNameNS(),getSelection(),hasFocus(),hidden,implementation,importNode(),inputEncoding," + "lastElementChild,lastModified,lastStyleSheetSet,load(),location,mozCancelFullScreen()," - + "mozExitPointerLock(),mozFullScreen,mozFullScreenElement,mozFullScreenEnabled,mozHidden," - + "mozPointerLockElement,mozSetImageElement(),mozVisibilityState,onabort,onafterscriptexecute," - + "onbeforescriptexecute,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy," - + "oncut,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop," - + "ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress," - + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave," + + "mozFullScreen,mozFullScreenElement,mozFullScreenEnabled," + + "mozSetImageElement(),onabort,onafterscriptexecute," + + "onanimationcancel,onanimationend,onanimationiteration,onanimationstart,onauxclick," + + "onbeforescriptexecute,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy," + + "oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave,ondragover,ondragstart,ondrop," + + "ondurationchange,onemptied,onended,onerror,onfocus,ongotpointercapture,oninput," + + "oninvalid,onkeydown,onkeypress," + + "onkeyup,onload,onloadeddata,onloadedmetadata,onloadend,onloadstart,onlostpointercapture," + + "onmousedown,onmouseenter,onmouseleave," + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," - + "onmozpointerlockchange,onmozpointerlockerror,onpaste,onpause,onplay,onplaying,onprogress," - + "onratechange,onreadystatechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow," - + "onstalled,onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,onwheel,preferredStyleSheetSet," - + "querySelector(),querySelectorAll(),readyState,referrer,releaseCapture(),selectedStyleSheetSet," - + "styleSheets,styleSheetSets,title,URL,visibilityState", - FF52 = "activeElement,adoptNode(),append(),async,caretPositionFromPoint(),characterSet,charset," - + "childElementCount,children,compatMode,contentType,createAttribute(),createAttributeNS()," - + "createCDATASection(),createComment(),createDocumentFragment(),createElement()," - + "createElementNS(),createEvent(),createExpression(),createNodeIterator(),createNSResolver()," - + "createProcessingInstruction(),createRange(),createTextNode(),createTreeWalker()," - + "currentScript,defaultView,dir,doctype,documentElement,documentURI,elementFromPoint()," - + "elementsFromPoint(),enableStyleSheetsForSet(),evaluate(),exitPointerLock()," - + "firstElementChild,fonts,getElementById(),getElementsByClassName(),getElementsByTagName()," - + "getElementsByTagNameNS(),hasFocus(),hidden,implementation,importNode(),inputEncoding," - + "lastElementChild,lastModified,lastStyleSheetSet,load(),location,mozCancelFullScreen()," - + "mozFullScreen,mozFullScreenElement,mozFullScreenEnabled,mozSetImageElement(),onabort," - + "onafterscriptexecute,onanimationend,onanimationiteration,onanimationstart," - + "onbeforescriptexecute,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu," - + "oncopy,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit,ondragleave,ondragover," - + "ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,oninput,oninvalid," - + "onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadend,onloadstart," - + "onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup," - + "onmozfullscreenchange,onmozfullscreenerror,onpaste,onpause,onplay,onplaying," - + "onpointerlockchange,onpointerlockerror,onprogress,onratechange,onreadystatechange," - + "onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectionchange,onselectstart," - + "onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend," - + "onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart," - + "onwebkittransitionend,onwheel,pointerLockElement,preferredStyleSheetSet,prepend()," - + "querySelector(),querySelectorAll(),readyState,referrer,releaseCapture(),rootElement," - + "scrollingElement,selectedStyleSheetSet,styleSheets,styleSheetSets,title,URL,visibilityState", + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointerlockchange,onpointerlockerror,onpointermove,onpointerout,onpointerover,onpointerup," + + "onprogress," + + "onratechange,onreadystatechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onselectionchange,onselectstart,onshow," + + "onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend," + + "ontransitionrun,ontransitionstart,onvisibilitychange,onvolumechange,onwaiting," + + "onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend," + + "onwheel,pointerLockElement,preferredStyleSheetSet," + + "prepend(),querySelector(),querySelectorAll(),readyState,referrer,releaseCapture(),rootElement," + + "scrollingElement," + + "selectedStyleSheetSet,styleSheets,styleSheetSets,title,URL,visibilityState", IE = "activeElement,adoptNode(),alinkColor,all,anchors,applets,bgColor,body,captureEvents(),characterSet," + "charset,clear(),close(),compatible,compatMode,cookie,createAttribute(),createAttributeNS()," + "createCDATASection(),createComment(),createDocumentFragment(),createElement(),createElementNS()," @@ -3145,36 +3269,50 @@ public void document() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "blur(),dataset,focus(),nonce," - + "onabort,onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," - + "onclick,onclose,oncontextmenu,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave," - + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + @Alerts(CHROME = "autofocus,blur(),dataset,focus(),nonce," + + "onabort,onanimationend,onanimationiteration,onanimationstart," + + "onauxclick,onblur,oncancel,oncanplay,oncanplaythrough,onchange," + + "onclick,onclose,oncontextmenu,oncopy,oncuechange,oncut," + + "ondblclick,ondrag,ondragend,ondragenter,ondragleave," + + "ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onformdata," + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + "onloadedmetadata,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave,onmousemove," - + "onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onpointercancel," - + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover,onpointerup," - + "onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onstalled," - + "onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwheel," + + "onmouseout,onmouseover,onmouseup,onmousewheel,onpaste,onpause,onplay,onplaying,onpointercancel," + + "onpointerdown,onpointerenter,onpointerleave,onpointermove,onpointerout,onpointerover," + + "onpointerrawupdate,onpointerup," + + "onprogress,onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect," + + "onselectionchange,onselectstart,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitionend,onvolumechange,onwaiting,onwheel," + "ownerSVGElement,style,tabIndex," + "viewportElement", - FF45 = "onabort,onblur,oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncut,ondblclick," - + "ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," - + "onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload," - + "onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove," - + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," - + "onmozpointerlockchange,onmozpointerlockerror,onpaste,onpause,onplay,onplaying,onprogress," - + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onshow,onstalled," - + "onsubmit,onsuspend,ontimeupdate,onvolumechange,onwaiting,ownerSVGElement,style,viewportElement", - FF52 = "blur(),dataset,focus(),onabort,onanimationend,onanimationiteration,onanimationstart,onblur," - + "oncanplay,oncanplaythrough,onchange,onclick,oncontextmenu,oncopy,oncut,ondblclick,ondrag," - + "ondragend,ondragenter,ondragexit,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," - + "onemptied,onended,onerror,onfocus,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload," - + "onloadeddata,onloadedmetadata,onloadend,onloadstart,onmousedown,onmouseenter,onmouseleave," - + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," - + "onpaste,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + FF68 = "blur(),dataset,focus(),onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick,onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose," + + "oncontextmenu,oncopy,oncuechange,oncut,ondblclick,ondrag,ondragend,ondragenter,ondragexit," + + "ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus," + + "ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata," + + "onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown,onmouseenter,onmouseleave," + + "onmousemove,onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror,onpaste," + + "onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,onpointermove," + + "onpointerout,onpointerover,onpointerup,onprogress,onratechange,onreset,onresize,onscroll,onseeked," + "onseeking,onselect,onselectstart,onshow,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle," - + "ontransitionend,onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration," - + "onwebkitanimationstart,onwebkittransitionend,ownerSVGElement,style,tabIndex,viewportElement", + + "ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,onvolumechange,onwaiting," + + "onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend," + + "onwheel,ownerSVGElement,style,tabIndex,viewportElement", + FF60 = "blur(),dataset,focus(),onabort,onanimationcancel,onanimationend,onanimationiteration," + + "onanimationstart,onauxclick," + + "onblur,oncanplay,oncanplaythrough,onchange,onclick,onclose,oncontextmenu,oncopy,oncut,ondblclick," + + "ondrag,ondragend,ondragenter,ondragexit,ondragleave,ondragover,ondragstart,ondrop,ondurationchange," + + "onemptied,onended,onerror,onfocus,ongotpointercapture,oninput,oninvalid,onkeydown,onkeypress," + + "onkeyup,onload," + + "onloadeddata,onloadedmetadata,onloadend,onloadstart,onlostpointercapture,onmousedown," + + "onmouseenter,onmouseleave,onmousemove," + + "onmouseout,onmouseover,onmouseup,onmozfullscreenchange,onmozfullscreenerror," + + "onpaste,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave," + + "onpointermove,onpointerout,onpointerover,onpointerup,onprogress," + + "onratechange,onreset,onresize,onscroll,onseeked,onseeking,onselect,onselectstart,onshow,onstalled," + + "onsubmit,onsuspend,ontimeupdate,ontoggle,ontransitioncancel,ontransitionend,ontransitionrun," + + "ontransitionstart,onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration," + + "onwebkitanimationstart,onwebkittransitionend,onwheel,ownerSVGElement,style,tabIndex,viewportElement", IE = "-") @NotYetImplemented({CHROME, FF}) public void svgElement() throws Exception { @@ -3185,7 +3323,7 @@ public void svgElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childNodes,cloneNode(),COMMENT_NODE," + @Alerts(CHROME = "appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childNodes,cloneNode(),COMMENT_NODE," + "compareDocumentPosition(),contains(),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," @@ -3195,27 +3333,26 @@ public void svgElement() throws Exception { + "nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,ownerElement,parentElement,parentNode," + "prefix,previousSibling,PROCESSING_INSTRUCTION_NODE,removeChild(),replaceChild(),specified,TEXT_NODE," + "textContent,value", - FF45 = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childNodes,cloneNode()," - + "COMMENT_NODE,compareDocumentPosition(),contains(),dispatchEvent(),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," - + "ELEMENT_NODE,ENTITY_NODE,ENTITY_REFERENCE_NODE,firstChild,hasChildNodes()," - + "insertBefore(),isDefaultNamespace(),isEqualNode(),lastChild,localName," - + "lookupNamespaceURI(),lookupPrefix(),name,namespaceURI,nextSibling,nodeName,nodeType,nodeValue," - + "normalize(),NOTATION_NODE,ownerDocument,ownerElement,parentElement,parentNode,prefix," - + "previousSibling,PROCESSING_INSTRUCTION_NODE,removeChild(),removeEventListener(),replaceChild()," - + "specified,TEXT_NODE,textContent,value", - FF52 = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childNodes,cloneNode()," - + "COMMENT_NODE,compareDocumentPosition(),contains(),dispatchEvent(),DOCUMENT_FRAGMENT_NODE," + FF68 = "appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childNodes,cloneNode(),COMMENT_NODE," + + "compareDocumentPosition(),contains(),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,ELEMENT_NODE,ENTITY_NODE,ENTITY_REFERENCE_NODE,firstChild,getRootNode()," + + "hasChildNodes(),insertBefore(),isConnected,isDefaultNamespace(),isEqualNode(),isSameNode()," + + "lastChild,localName,lookupNamespaceURI(),lookupPrefix(),name,namespaceURI,nextSibling,nodeName," + + "nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,ownerElement,parentElement," + + "parentNode,prefix,previousSibling,PROCESSING_INSTRUCTION_NODE,removeChild()," + + "replaceChild(),specified,TEXT_NODE,textContent,value", + FF60 = "appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childNodes,cloneNode()," + + "COMMENT_NODE,compareDocumentPosition(),contains(),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," - + "ELEMENT_NODE,ENTITY_NODE,ENTITY_REFERENCE_NODE,firstChild,hasChildNodes()," + + "ELEMENT_NODE,ENTITY_NODE,ENTITY_REFERENCE_NODE,firstChild,getRootNode(),hasChildNodes()," + "insertBefore(),isConnected,isDefaultNamespace(),isEqualNode(),isSameNode(),lastChild,localName," + "lookupNamespaceURI(),lookupPrefix(),name,namespaceURI,nextSibling,nodeName,nodeType,nodeValue," + "normalize(),NOTATION_NODE,ownerDocument,ownerElement,parentElement,parentNode,prefix," - + "previousSibling,PROCESSING_INSTRUCTION_NODE,removeChild(),removeEventListener(),replaceChild()," + + "previousSibling,PROCESSING_INSTRUCTION_NODE,removeChild(),replaceChild()," + "specified,TEXT_NODE,textContent,value", IE = "addEventListener(),appendChild(),ATTRIBUTE_NODE,attributes,CDATA_SECTION_NODE,childNodes,cloneNode()," + "COMMENT_NODE,compareDocumentPosition(),dispatchEvent(),DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE," @@ -3262,7 +3399,7 @@ public void range() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childElementCount,childNodes," + @Alerts(CHROME = "append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childElementCount,childNodes," + "children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains(),DOCUMENT_FRAGMENT_NODE," + "DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY,DOCUMENT_POSITION_CONTAINS," + "DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING," @@ -3273,29 +3410,29 @@ public void range() throws Exception { + "nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,parentElement,parentNode,prepend()," + "previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),querySelectorAll(),removeChild()," + "replaceChild(),TEXT_NODE,textContent", - FF45 = "addEventListener(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE," - + "childElementCount,childNodes,children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains()," - + "dispatchEvent(),DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY," - + "DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED,DOCUMENT_POSITION_FOLLOWING," + FF68 = "append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE,childElementCount,childNodes," + + "children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains(),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," + "ELEMENT_NODE,ENTITY_NODE,ENTITY_REFERENCE_NODE,firstChild,firstElementChild,getElementById()," - + "hasChildNodes(),insertBefore(),isDefaultNamespace(),isEqualNode()," - + "lastChild,lastElementChild,localName,lookupNamespaceURI(),lookupPrefix()," - + "namespaceURI,nextSibling,nodeName,nodeType," - + "nodeValue,normalize(),NOTATION_NODE,ownerDocument,parentElement,parentNode,prefix," + + "getRootNode(),hasChildNodes(),insertBefore(),isConnected,isDefaultNamespace(),isEqualNode()," + + "isSameNode(),lastChild,lastElementChild,lookupNamespaceURI(),lookupPrefix(),nextSibling,nodeName," + + "nodeType,nodeValue,normalize(),NOTATION_NODE,ownerDocument,parentElement,parentNode,prepend()," + "previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),querySelectorAll(),removeChild()," - + "removeEventListener(),replaceChild(),TEXT_NODE,textContent", - FF52 = "addEventListener(),append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE," + + "replaceChild(),TEXT_NODE,textContent", + FF60 = "append(),appendChild(),ATTRIBUTE_NODE,baseURI,CDATA_SECTION_NODE," + "childElementCount,childNodes,children,cloneNode(),COMMENT_NODE,compareDocumentPosition(),contains()," - + "dispatchEvent(),DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE,DOCUMENT_POSITION_CONTAINED_BY," + + "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," + "ELEMENT_NODE,ENTITY_NODE,ENTITY_REFERENCE_NODE,firstChild,firstElementChild,getElementById()," - + "hasChildNodes(),insertBefore(),isConnected,isDefaultNamespace(),isEqualNode(),isSameNode()," - + "lastChild,lastElementChild,lookupNamespaceURI(),lookupPrefix(),nextSibling,nodeName,nodeType," + + "getRootNode(),hasChildNodes(),insertBefore(),isConnected,isDefaultNamespace(),isEqualNode()," + + "isSameNode(),lastChild,lastElementChild,lookupNamespaceURI(),lookupPrefix()," + + "nextSibling,nodeName,nodeType," + "nodeValue,normalize(),NOTATION_NODE,ownerDocument,parentElement,parentNode,prepend()," + "previousSibling,PROCESSING_INSTRUCTION_NODE,querySelector(),querySelectorAll(),removeChild()," - + "removeEventListener(),replaceChild(),TEXT_NODE,textContent", + + "replaceChild(),TEXT_NODE,textContent", IE = "addEventListener(),appendChild(),ATTRIBUTE_NODE,attributes,CDATA_SECTION_NODE,childNodes,cloneNode()," + "COMMENT_NODE,compareDocumentPosition(),dispatchEvent(),DOCUMENT_FRAGMENT_NODE,DOCUMENT_NODE," + "DOCUMENT_POSITION_CONTAINED_BY,DOCUMENT_POSITION_CONTAINS,DOCUMENT_POSITION_DISCONNECTED," diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java index c4a80edb79d..f72110051b5 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/HostClassNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,18 @@ package com.gargoylesoftware.htmlunit.general; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF68; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import org.junit.Test; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; -import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.AlertsStandards; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; +import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.WebDriverTestCase; import com.gargoylesoftware.htmlunit.annotations.StandardsMode; @@ -131,8 +131,9 @@ public void angle_instanced_arrays() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF52 = "function Animation() {\n [native code]\n}") + @Alerts(DEFAULT = "function Animation() {\n [native code]\n}", + CHROME = "function Animation() { [native code] }", + IE = "exception") public void animation() throws Exception { test("Animation"); } @@ -174,7 +175,7 @@ public void animationEffectTimingReadOnly() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.event.AnimationEvent}. + * Test {@link com.gargoylesoftware.htmlunit.javascript.host.animations.AnimationEvent}. * * @throws Exception if the test fails */ @@ -190,7 +191,9 @@ public void animationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF68 = "function AnimationPlaybackEvent() {\n [native code]\n}") + @NotYetImplemented(FF68) public void animationPlaybackEvent() throws Exception { test("AnimationPlaybackEvent"); } @@ -277,7 +280,7 @@ public void array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer}. + * Test ArrayBuffer. * * @throws Exception if an error occurs */ @@ -290,7 +293,7 @@ public void arrayBuffer() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView}. + * Test ArrayBufferView. * * @throws Exception if an error occurs */ @@ -301,7 +304,7 @@ public void arrayBufferView() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase}. + * Test ArrayBufferViewBase. * * @throws Exception if an error occurs */ @@ -460,7 +463,8 @@ public void audioProcessingEvent() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function AudioScheduledSourceNode() { [native code] }") + CHROME = "function AudioScheduledSourceNode() { [native code] }", + FF = "function AudioScheduledSourceNode() {\n [native code]\n}") public void audioScheduledSourceNode() throws Exception { test("AudioScheduledSourceNode"); } @@ -490,7 +494,8 @@ public void barProp() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function BaseAudioContext() { [native code] }") + CHROME = "function BaseAudioContext() { [native code] }", + FF = "function BaseAudioContext() {\n [native code]\n}") public void baseAudioContext() throws Exception { test("BaseAudioContext"); } @@ -721,8 +726,7 @@ public void broadcastChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - CHROME = "function BudgetService() { [native code] }") + @Alerts("exception") public void budgetService() throws Exception { test("BudgetService"); } @@ -1089,7 +1093,6 @@ public void connection() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - EDGE = "function Console() { [native code] }", IE = "[object Console]") public void console() throws Exception { test("Console"); @@ -1101,7 +1104,7 @@ public void console() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function ConstantSourceNode() { [native code] }", - FF52 = "function ConstantSourceNode() {\n [native code]\n}") + FF = "function ConstantSourceNode() {\n [native code]\n}") public void constantSourceNode() throws Exception { test("ConstantSourceNode"); } @@ -1169,7 +1172,6 @@ public void convolverNode() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - EDGE = "function Coordinates() { [native code] }", IE = "[object Coordinates]") public void coordinates() throws Exception { test("Coordinates"); @@ -1180,7 +1182,8 @@ public void coordinates() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function Credential() { [native code] }") + CHROME = "function Credential() { [native code] }", + FF = "function Credential() {\n [native code]\n}") public void credential() throws Exception { test("Credential"); } @@ -1190,7 +1193,8 @@ public void credential() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function CredentialsContainer() { [native code] }") + CHROME = "function CredentialsContainer() { [native code] }", + FF = "function CredentialsContainer() {\n [native code]\n}") public void credentialsContainer() throws Exception { test("CredentialsContainer"); } @@ -1223,7 +1227,8 @@ public void cryptoKey() throws Exception { @Test @Alerts(DEFAULT = "function CSS() { [native code] }", IE = "exception", - FF = "function CSS() {\n [native code]\n}") + FF60 = "function CSS() {\n [native code]\n}", + FF68 = "[object Object]") public void css() throws Exception { test("CSS"); } @@ -1254,9 +1259,8 @@ public void cssCharsetRule() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - EDGE = "function CSSConditionRule() { [native code] }", - FF = "[object CSSConditionRule]", - CHROME = "function CSSConditionRule() { [native code] }") + CHROME = "function CSSConditionRule() { [native code] }", + FF = "function CSSConditionRule() {\n [native code]\n}") public void cssConditionRule() throws Exception { test("CSSConditionRule"); } @@ -1266,7 +1270,7 @@ public void cssConditionRule() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "[object CSSCounterStyleRule]") + FF = "function CSSCounterStyleRule() {\n [native code]\n}") public void cssCounterStyleRule() throws Exception { test("CSSCounterStyleRule"); } @@ -1278,7 +1282,8 @@ public void cssCounterStyleRule() throws Exception { */ @Test @Alerts(DEFAULT = "[object CSSFontFaceRule]", - CHROME = "function CSSFontFaceRule() { [native code] }") + CHROME = "function CSSFontFaceRule() { [native code] }", + FF = "function CSSFontFaceRule() {\n [native code]\n}") public void cssFontFaceRule() throws Exception { test("CSSFontFaceRule"); } @@ -1289,7 +1294,7 @@ public void cssFontFaceRule() throws Exception { @Test @Alerts(DEFAULT = "function CSSGroupingRule() { [native code] }", IE = "exception", - FF = "[object CSSGroupingRule]") + FF = "function CSSGroupingRule() {\n [native code]\n}") public void cssGroupingRule() throws Exception { test("CSSGroupingRule"); } @@ -1301,7 +1306,8 @@ public void cssGroupingRule() throws Exception { */ @Test @Alerts(DEFAULT = "[object CSSImportRule]", - CHROME = "function CSSImportRule() { [native code] }") + CHROME = "function CSSImportRule() { [native code] }", + FF = "function CSSImportRule() {\n [native code]\n}") public void cssImportRule() throws Exception { test("CSSImportRule"); } @@ -1312,7 +1318,7 @@ public void cssImportRule() throws Exception { @Test @Alerts(DEFAULT = "[object CSSKeyframeRule]", CHROME = "function CSSKeyframeRule() { [native code] }", - FF45 = "exception") + FF = "function CSSKeyframeRule() {\n [native code]\n}") public void cssKeyframeRule() throws Exception { test("CSSKeyframeRule"); } @@ -1322,8 +1328,7 @@ public void cssKeyframeRule() throws Exception { */ @Test @Alerts(DEFAULT = "function CSSKeyframesRule() { [native code] }", - FF45 = "exception", - FF52 = "[object CSSKeyframesRule]", + FF = "function CSSKeyframesRule() {\n [native code]\n}", IE = "[object CSSKeyframesRule]") public void cssKeyframesRule() throws Exception { test("CSSKeyframesRule"); @@ -1345,7 +1350,8 @@ public void cssMatrix() throws Exception { */ @Test @Alerts(DEFAULT = "[object CSSMediaRule]", - CHROME = "function CSSMediaRule() { [native code] }") + CHROME = "function CSSMediaRule() { [native code] }", + FF = "function CSSMediaRule() {\n [native code]\n}") public void cssMediaRule() throws Exception { test("CSSMediaRule"); } @@ -1355,8 +1361,8 @@ public void cssMediaRule() throws Exception { */ @Test @Alerts(DEFAULT = "function CSSNamespaceRule() { [native code] }", - IE = "[object CSSNamespaceRule]", - FF = "exception") + FF = "function CSSNamespaceRule() {\n [native code]\n}", + IE = "[object CSSNamespaceRule]") public void cssNamespaceRule() throws Exception { test("CSSNamespaceRule"); } @@ -1368,7 +1374,8 @@ public void cssNamespaceRule() throws Exception { */ @Test @Alerts(DEFAULT = "[object CSSPageRule]", - CHROME = "function CSSPageRule() { [native code] }") + CHROME = "function CSSPageRule() { [native code] }", + FF = "function CSSPageRule() {\n [native code]\n}") public void cssPageRule() throws Exception { test("CSSPageRule"); } @@ -1380,7 +1387,7 @@ public void cssPageRule() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function CSSPrimitiveValue() {\n [native code]\n}") + FF60 = "function CSSPrimitiveValue() {\n [native code]\n}") public void cssPrimitiveValue() throws Exception { test("CSSPrimitiveValue"); } @@ -1392,7 +1399,8 @@ public void cssPrimitiveValue() throws Exception { */ @Test @Alerts(DEFAULT = "[object CSSRule]", - CHROME = "function CSSRule() { [native code] }") + CHROME = "function CSSRule() { [native code] }", + FF = "function CSSRule() {\n [native code]\n}") public void cssRule() throws Exception { test("CSSRule"); } @@ -1430,10 +1438,11 @@ public void cssStyleDeclaration() throws Exception { */ @Test @Alerts(DEFAULT = "[object CSSStyleRule]", - CHROME = "function CSSStyleRule() { [native code] }") + CHROME = "function CSSStyleRule() { [native code] }", + FF = "function CSSStyleRule() {\n [native code]\n}") @AlertsStandards(DEFAULT = "[object CSSStyleRule]", CHROME = "function CSSStyleRule() { [native code] }", - EDGE = "function CSSStyleRule() { [native code] }") + FF = "function CSSStyleRule() {\n [native code]\n}") public void cssStyleRule() throws Exception { test("CSSStyleRule"); } @@ -1457,7 +1466,7 @@ public void cssStyleSheet() throws Exception { @Test @Alerts(DEFAULT = "function CSSSupportsRule() { [native code] }", IE = "exception", - FF = "[object CSSSupportsRule]") + FF = "function CSSSupportsRule() {\n [native code]\n}") public void cssSupportsRule() throws Exception { test("CSSSupportsRule"); } @@ -1478,7 +1487,7 @@ public void cssUnknownRule() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function CSSValue() {\n [native code]\n}") + FF60 = "function CSSValue() {\n [native code]\n}") public void cssValue() throws Exception { test("CSSValue"); } @@ -1488,7 +1497,7 @@ public void cssValue() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function CSSValueList() {\n [native code]\n}") + FF60 = "function CSSValueList() {\n [native code]\n}") public void cssValueList() throws Exception { test("CSSValueList"); } @@ -1507,7 +1516,8 @@ public void cssViewportRule() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function CustomElementRegistry() { [native code] }") + CHROME = "function CustomElementRegistry() { [native code] }", + FF68 = "function CustomElementRegistry() {\n [native code]\n}") public void customElementRegistry() throws Exception { test("CustomElementRegistry"); } @@ -1576,7 +1586,7 @@ public void dataTransfer() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function DataTransferItem() { [native code] }", - FF52 = "function DataTransferItem() {\n [native code]\n}") + FF = "function DataTransferItem() {\n [native code]\n}") public void dataTransferItem() throws Exception { test("DataTransferItem"); } @@ -1587,13 +1597,13 @@ public void dataTransferItem() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function DataTransferItemList() { [native code] }", - FF52 = "function DataTransferItemList() {\n [native code]\n}") + FF = "function DataTransferItemList() {\n [native code]\n}") public void dataTransferItemList() throws Exception { test("DataTransferItemList"); } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.DataView}. + * Test DataView. * * @throws Exception if an error occurs */ @@ -1662,8 +1672,7 @@ public void delayNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - EDGE = "function DeviceAcceleration() { [native code] }") + @Alerts("exception") public void deviceAcceleration() throws Exception { test("DeviceAcceleration"); } @@ -1673,7 +1682,7 @@ public void deviceAcceleration() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function DeviceLightEvent() {\n [native code]\n}") + FF60 = "function DeviceLightEvent() {\n [native code]\n}") public void deviceLightEvent() throws Exception { test("DeviceLightEvent"); } @@ -1705,7 +1714,7 @@ public void deviceOrientationEvent() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function DeviceProximityEvent() {\n [native code]\n}") + FF60 = "function DeviceProximityEvent() {\n [native code]\n}") public void deviceProximityEvent() throws Exception { test("DeviceProximityEvent"); } @@ -1714,8 +1723,7 @@ public void deviceProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - EDGE = "function DeviceRotationRate() { [native code] }") + @Alerts("exception") public void deviceRotationRate() throws Exception { test("DeviceRotationRate"); } @@ -1883,7 +1891,7 @@ public void domConfiguration() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function DOMCursor() {\n [native code]\n}") + FF60 = "function DOMCursor() {\n [native code]\n}") public void domCursor() throws Exception { test("DOMCursor"); } @@ -2062,9 +2070,9 @@ public void domRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - FF = "function DOMRectList() {\n [native code]\n}") - @NotYetImplemented(FF) + @Alerts(DEFAULT = "function DOMRectList() {\n [native code]\n}", + CHROME = "function DOMRectList() { [native code] }", + IE = "exception") public void domRectList() throws Exception { test("DOMRectList"); } @@ -2094,10 +2102,8 @@ public void domRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function DOMSettableTokenList() {\n [native code]\n}", - IE = "[object DOMSettableTokenList]", - CHROME = "exception", - FF52 = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object DOMSettableTokenList]") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -2179,11 +2185,9 @@ public void doubleRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - CHROME = "function DragEvent() { [native code] }", + @Alerts(CHROME = "function DragEvent() { [native code] }", FF = "function DragEvent() {\n [native code]\n}", - IE = "[object DragEvent]", - EDGE = "function DragEvent() { [native code] }") + IE = "[object DragEvent]") public void dragEvent() throws Exception { test("DragEvent"); } @@ -2497,7 +2501,7 @@ public void extendableMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function External() {\n [native code]\n}") + CHROME = "function External() { [native code] }") public void external() throws Exception { test("External"); } @@ -2622,7 +2626,7 @@ public void fileRequest() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function FileSystem() {\n [native code]\n}") + FF = "function FileSystem() {\n [native code]\n}") public void fileSystem() throws Exception { test("FileSystem"); } @@ -2632,7 +2636,7 @@ public void fileSystem() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function FileSystemDirectoryEntry() {\n [native code]\n}") + FF = "function FileSystemDirectoryEntry() {\n [native code]\n}") public void fileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry"); } @@ -2642,7 +2646,7 @@ public void fileSystemDirectoryEntry() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function FileSystemDirectoryReader() {\n [native code]\n}") + FF = "function FileSystemDirectoryReader() {\n [native code]\n}") public void fileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader"); } @@ -2652,7 +2656,7 @@ public void fileSystemDirectoryReader() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function FileSystemEntry() {\n [native code]\n}") + FF = "function FileSystemEntry() {\n [native code]\n}") public void fileSystemEntry() throws Exception { test("FileSystemEntry"); } @@ -2662,7 +2666,7 @@ public void fileSystemEntry() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function FileSystemFileEntry() {\n [native code]\n}") + FF = "function FileSystemFileEntry() {\n [native code]\n}") public void fileSystemFileEntry() throws Exception { test("FileSystemFileEntry"); } @@ -2686,7 +2690,7 @@ public void fileSystemSync() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Float32Array}. + * Test Float32Array. * * @throws Exception if an error occurs */ @@ -2699,7 +2703,7 @@ public void float32Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Float64Array}. + * Test Float64Array. * * @throws Exception if an error occurs */ @@ -2865,8 +2869,8 @@ public void generatorFunction() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object Geolocation]", - EDGE = "function Geolocation() { [native code] }") + CHROME = "function Geolocation() { [native code] }", + IE = "[object Geolocation]") public void geolocation() throws Exception { test("Geolocation"); } @@ -2977,8 +2981,7 @@ public void htmlAnchorElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object HTMLAppletElement]", - FF = "function HTMLAppletElement() {\n [native code]\n}") + IE = "[object HTMLAppletElement]") public void htmlAppletElement() throws Exception { test("HTMLAppletElement"); } @@ -3029,8 +3032,7 @@ public void htmlBaseElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object HTMLBaseFontElement]", - EDGE = "function HTMLBaseFontElement() { [native code] }") + IE = "[object HTMLBaseFontElement]") public void htmlBaseFontElement() throws Exception { test("HTMLBaseFontElement"); } @@ -3151,8 +3153,7 @@ public void htmlCommentElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function HTMLContentElement() { [native code] }", - FF45 = "function HTMLContentElement() {\n [native code]\n}") + CHROME = "function HTMLContentElement() { [native code] }") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -3223,7 +3224,7 @@ public void htmlDefinitionTermElement() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function HTMLDetailsElement() { [native code] }", - FF52 = "function HTMLDetailsElement() {\n [native code]\n}") + FF = "function HTMLDetailsElement() {\n [native code]\n}") public void htmlDetailsElement() throws Exception { test("HTMLDetailsElement"); } @@ -3633,7 +3634,8 @@ public void htmlMapElement() throws Exception { @Test @Alerts(DEFAULT = "function HTMLMarqueeElement() { [native code] }", IE = "[object HTMLMarqueeElement]", - FF = "exception") + FF60 = "exception", + FF68 = "function HTMLMarqueeElement() {\n [native code]\n}") public void htmlMarqueeElement() throws Exception { test("HTMLMarqueeElement"); } @@ -3935,8 +3937,7 @@ public void htmlSelectElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function HTMLShadowElement() { [native code] }", - FF45 = "function HTMLShadowElement() {\n [native code]\n}") + CHROME = "function HTMLShadowElement() { [native code] }") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -3946,7 +3947,8 @@ public void htmlShadowElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function HTMLSlotElement() { [native code] }") + CHROME = "function HTMLSlotElement() { [native code] }", + FF68 = "function HTMLSlotElement() {\n [native code]\n}") public void htmlSlotElement() throws Exception { test("HTMLSlotElement"); } @@ -4047,8 +4049,7 @@ public void htmlTableComponent() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object HTMLTableDataCellElement]", - EDGE = "function HTMLTableDataCellElement() { [native code] }") + IE = "[object HTMLTableDataCellElement]") public void htmlTableDataCellElement() throws Exception { test("HTMLTableDataCellElement"); } @@ -4073,8 +4074,7 @@ public void htmlTableElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object HTMLTableHeaderCellElement]", - EDGE = "function HTMLTableHeaderCellElement() { [native code] }") + IE = "[object HTMLTableHeaderCellElement]") public void htmlTableHeaderCellElement() throws Exception { test("HTMLTableHeaderCellElement"); } @@ -4471,7 +4471,8 @@ public void identityManager() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function IdleDeadline() { [native code] }") + CHROME = "function IdleDeadline() { [native code] }", + FF = "function IdleDeadline() {\n [native code]\n}") public void idleDeadline() throws Exception { test("IdleDeadline"); } @@ -4482,7 +4483,7 @@ public void idleDeadline() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function IIRFilterNode() { [native code] }", - FF52 = "function IIRFilterNode() {\n [native code]\n}") + FF = "function IIRFilterNode() {\n [native code]\n}") public void iirFilterNode() throws Exception { test("IIRFilterNode"); } @@ -4494,7 +4495,6 @@ public void iirFilterNode() throws Exception { */ @Test @Alerts(CHROME = "function Image() { [native code] }", - EDGE = "function Image() { [native code] }", FF = "function Image() {\n [native code]\n}", IE = "\nfunction Image() {\n [native code]\n}\n") public void image() throws Exception { @@ -4527,7 +4527,7 @@ public void imageBitmapFactories() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function ImageBitmapRenderingContext() { [native code] }", - FF52 = "function ImageBitmapRenderingContext() {\n [native code]\n}") + FF = "function ImageBitmapRenderingContext() {\n [native code]\n}") public void imageBitmapRenderingContext() throws Exception { test("ImageBitmapRenderingContext"); } @@ -4629,7 +4629,7 @@ public void installTriggerImpl() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Int16Array}. + * Test Int16Array. * * @throws Exception if an error occurs */ @@ -4642,7 +4642,7 @@ public void int16Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Int32Array}. + * Test Int32Array. * * @throws Exception if an error occurs */ @@ -4655,7 +4655,7 @@ public void int32Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Int8Array}. + * Test Int8Array. * * @throws Exception if an error occurs */ @@ -4673,7 +4673,7 @@ public void int8Array() throws Exception { @Test @Alerts(DEFAULT = "exception", FF = "function InternalError() {\n [native code]\n}") - @NotYetImplemented({CHROME, IE, EDGE}) + @NotYetImplemented({CHROME, IE}) public void internalError() throws Exception { test("InternalError"); } @@ -4683,7 +4683,8 @@ public void internalError() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function IntersectionObserver() { [native code] }") + CHROME = "function IntersectionObserver() { [native code] }", + FF = "function IntersectionObserver() {\n [native code]\n}") public void intersectionObserver() throws Exception { test("IntersectionObserver"); } @@ -4693,7 +4694,8 @@ public void intersectionObserver() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function IntersectionObserverEntry() { [native code] }") + CHROME = "function IntersectionObserverEntry() { [native code] }", + FF = "function IntersectionObserverEntry() {\n [native code]\n}") public void intersectionObserverEntry() throws Exception { test("IntersectionObserverEntry"); } @@ -4768,8 +4770,7 @@ public void isNaN() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF = "function Iterator() {\n [native code]\n}") + @Alerts("exception") public void iterator() throws Exception { test("Iterator"); } @@ -4800,7 +4801,9 @@ public void keyboardEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + CHROME = "function KeyframeEffect() { [native code] }", + FF68 = "function KeyframeEffect() {\n [native code]\n}") public void keyframeEffect() throws Exception { test("KeyframeEffect"); } @@ -4929,7 +4932,7 @@ public void localFileSystemSync() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function LocalMediaStream() {\n [native code]\n}") + FF60 = "function LocalMediaStream() {\n [native code]\n}") public void localMediaStream() throws Exception { test("LocalMediaStream"); } @@ -4945,7 +4948,6 @@ public void localMediaStream() throws Exception { FF = "function Location() {\n [native code]\n}") @AlertsStandards(DEFAULT = "[object Location]", CHROME = "function Location() { [native code] }", - EDGE = "function Location() { [native code] }", FF = "function Location() {\n [native code]\n}") public void location() throws Exception { test("Location"); @@ -5156,7 +5158,8 @@ public void mediaQueryList() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function MediaQueryListEvent() { [native code] }") + CHROME = "function MediaQueryListEvent() { [native code] }", + FF = "function MediaQueryListEvent() {\n [native code]\n}") public void mediaQueryListEvent() throws Exception { test("MediaQueryListEvent"); } @@ -5198,8 +5201,7 @@ public void mediaSource() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function MediaStream() { [native code] }", - FF = "function MediaStream() {\n [native code]\n}", - EDGE = "function MediaStream() { [native code] }") + FF = "function MediaStream() {\n [native code]\n}") public void mediaStream() throws Exception { test("MediaStream"); } @@ -5531,8 +5533,7 @@ public void mozContact() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF45 = "function MozContactChangeEvent() {\n [native code]\n}") + @Alerts("exception") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -5541,8 +5542,7 @@ public void mozContactChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF45 = "[object MozCSSKeyframesRule]") + @Alerts("exception") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -5713,8 +5713,7 @@ public void mozNFCTag() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF45 = "function MozPowerManager() {\n [native code]\n}") + @Alerts("exception") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -5753,8 +5752,7 @@ public void mozRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF45 = "function MozSettingsEvent() {\n [native code]\n}") + @Alerts("exception") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -6321,7 +6319,9 @@ public void offlineResourceList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + CHROME = "function OffscreenCanvas() { [native code] }") + @NotYetImplemented(CHROME) public void offscreenCanvas() throws Exception { test("OffscreenCanvas"); } @@ -6333,7 +6333,6 @@ public void offscreenCanvas() throws Exception { */ @Test @Alerts(CHROME = "function Option() { [native code] }", - EDGE = "function Option() { [native code] }", FF = "function Option() {\n [native code]\n}", IE = "\nfunction Option() {\n [native code]\n}\n") public void option() throws Exception { @@ -6355,8 +6354,7 @@ public void oscillatorNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - EDGE = "function OverflowEvent() { [native code] }") + @Alerts("exception") public void overflowEvent() throws Exception { test("OverflowEvent"); } @@ -6378,8 +6376,7 @@ public void pageTransitionEvent() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function PannerNode() { [native code] }", - FF = "function PannerNode() {\n [native code]\n}", - EDGE = "function PannerNode() { [native code] }") + FF = "function PannerNode() {\n [native code]\n}") public void pannerNode() throws Exception { test("PannerNode"); } @@ -6546,8 +6543,8 @@ public void performanceNavigation() throws Exception { */ @Test @Alerts(DEFAULT = "function PerformanceNavigationTiming() { [native code] }", - IE = "[object PerformanceNavigationTiming]", - FF = "exception") + FF = "function PerformanceNavigationTiming() {\n [native code]\n}", + IE = "[object PerformanceNavigationTiming]") public void performanceNavigationTiming() throws Exception { test("PerformanceNavigationTiming"); } @@ -6557,7 +6554,8 @@ public void performanceNavigationTiming() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function PerformanceObserver() { [native code] }") + CHROME = "function PerformanceObserver() { [native code] }", + FF = "function PerformanceObserver() {\n [native code]\n}") public void performanceObserver() throws Exception { test("PerformanceObserver"); } @@ -6567,7 +6565,8 @@ public void performanceObserver() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function PerformanceObserverEntryList() { [native code] }") + CHROME = "function PerformanceObserverEntryList() { [native code] }", + FF = "function PerformanceObserverEntryList() {\n [native code]\n}") public void performanceObserverEntryList() throws Exception { test("PerformanceObserverEntryList"); } @@ -6638,7 +6637,7 @@ public void periodicWave() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function Permissions() { [native code] }", - FF52 = "function Permissions() {\n [native code]\n}") + FF = "function Permissions() {\n [native code]\n}") public void permissions() throws Exception { test("Permissions"); } @@ -6658,7 +6657,7 @@ public void permissionSettings() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function PermissionStatus() { [native code] }", - FF52 = "function PermissionStatus() {\n [native code]\n}") + FF = "function PermissionStatus() {\n [native code]\n}") public void permissionStatus() throws Exception { test("PermissionStatus"); } @@ -6704,10 +6703,9 @@ public void point() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - CHROME = "function PointerEvent() { [native code] }", - IE = "[object PointerEvent]", - EDGE = "function PointerEvent() { [native code] }") + @Alerts(CHROME = "function PointerEvent() { [native code] }", + FF = "function PointerEvent() {\n [native code]\n}", + IE = "[object PointerEvent]") public void pointerEvent() throws Exception { test("PointerEvent"); } @@ -6748,8 +6746,7 @@ public void portCollection() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object Position]", - EDGE = "function Position() { [native code] }") + IE = "[object Position]") public void position() throws Exception { test("Position"); } @@ -6759,8 +6756,7 @@ public void position() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object PositionError]", - EDGE = "function PositionError() { [native code] }") + IE = "[object PositionError]") public void positionError() throws Exception { test("PositionError"); } @@ -6955,6 +6951,7 @@ public void promiseResolver() throws Exception { @Alerts(DEFAULT = "function Proxy() { [native code] }", FF = "function Proxy() {\n [native code]\n}", IE = "exception") + @NotYetImplemented({CHROME, FF}) public void proxy() throws Exception { test("Proxy"); } @@ -7074,7 +7071,8 @@ public void readableByteStream() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function ReadableStream() { [native code] }") + CHROME = "function ReadableStream() { [native code] }", + FF68 = "function ReadableStream() {\n [native code]\n}") public void readableStream() throws Exception { test("ReadableStream"); } @@ -7188,8 +7186,9 @@ public void rtcConfiguration() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function RTCDataChannel() { [native code] }") - @NotYetImplemented(CHROME) + CHROME = "function RTCDataChannel() { [native code] }", + FF = "function RTCDataChannel() {\n [native code]\n}") + @NotYetImplemented({CHROME, FF}) public void rtcDataChannel() throws Exception { test("RTCDataChannel"); } @@ -7278,7 +7277,9 @@ public void rtcPeerConnectionIceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + CHROME = "function RTCSctpTransport() { [native code] }") + @NotYetImplemented(CHROME) public void rtcSctpTransport() throws Exception { test("RTCSctpTransport"); } @@ -7354,7 +7355,8 @@ public void scriptProcessorNode() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function SecurityPolicyViolationEvent() { [native code] }") + CHROME = "function SecurityPolicyViolationEvent() { [native code] }", + FF68 = "function SecurityPolicyViolationEvent() {\n [native code]\n}") public void securityPolicyViolationEvent() throws Exception { test("SecurityPolicyViolationEvent"); } @@ -7465,7 +7467,8 @@ public void settingsManager() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function ShadowRoot() { [native code] }") + CHROME = "function ShadowRoot() { [native code] }", + FF68 = "function ShadowRoot() {\n [native code]\n}") public void shadowRoot() throws Exception { test("ShadowRoot"); } @@ -7760,6 +7763,15 @@ public void speechRecognitionError() throws Exception { test("SpeechRecognitionError"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("exception") + public void speechRecognitionErrorEvent() throws Exception { + test("SpeechRecognitionErrorEvent"); + } + /** * @throws Exception if the test fails */ @@ -7792,7 +7804,7 @@ public void speechRecognitionResultList() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function SpeechSynthesis() {\n [native code]\n}") + FF = "function SpeechSynthesis() {\n [native code]\n}") public void speechSynthesis() throws Exception { test("SpeechSynthesis"); } @@ -7801,8 +7813,9 @@ public void speechSynthesis() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - FF52 = "function SpeechSynthesisErrorEvent() {\n [native code]\n}") + @Alerts(DEFAULT = "function SpeechSynthesisErrorEvent() {\n [native code]\n}", + CHROME = "function SpeechSynthesisErrorEvent() { [native code] }", + IE = "exception") public void speechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent"); } @@ -7813,7 +7826,7 @@ public void speechSynthesisErrorEvent() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function SpeechSynthesisEvent() { [native code] }", - FF52 = "function SpeechSynthesisEvent() {\n [native code]\n}") + FF = "function SpeechSynthesisEvent() {\n [native code]\n}") public void speechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent"); } @@ -7824,7 +7837,7 @@ public void speechSynthesisEvent() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function SpeechSynthesisUtterance() { [native code] }", - FF52 = "function SpeechSynthesisUtterance() {\n [native code]\n}") + FF = "function SpeechSynthesisUtterance() {\n [native code]\n}") public void speechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance"); } @@ -7834,7 +7847,7 @@ public void speechSynthesisUtterance() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF52 = "function SpeechSynthesisVoice() {\n [native code]\n}") + FF = "function SpeechSynthesisVoice() {\n [native code]\n}") public void speechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice"); } @@ -7854,8 +7867,7 @@ public void staticNodeList() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function StereoPannerNode() { [native code] }", - FF = "function StereoPannerNode() {\n [native code]\n}", - EDGE = "function StereoPannerNode() { [native code] }") + FF = "function StereoPannerNode() {\n [native code]\n}") public void stereoPannerNode() throws Exception { test("StereoPannerNode"); } @@ -7866,8 +7878,7 @@ public void stereoPannerNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - FF = "[object StopIteration]") + @Alerts("exception") public void stopIteration() throws Exception { test("StopIteration"); } @@ -7910,7 +7921,8 @@ public void storageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function StorageManager() { [native code] }") + CHROME = "function StorageManager() { [native code] }", + FF = "function StorageManager() {\n [native code]\n}") public void storageManager() throws Exception { test("StorageManager"); } @@ -7940,8 +7952,7 @@ public void string() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - IE = "[object StyleMedia]", - EDGE = "function StyleMedia() { [native code] }") + IE = "[object StyleMedia]") public void styleMedia() throws Exception { test("StyleMedia"); } @@ -7995,13 +8006,10 @@ public void svgAElement() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.svg.SVGAltGlyphElement}. - * * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - FF45 = "function SVGAltGlyphElement() {\n [native code]\n}") + @Alerts("exception") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -8305,8 +8313,7 @@ public void svgDiscardElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - FF45 = "function SVGDocument() {\n [native code]\n}") + @Alerts("exception") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -8767,7 +8774,8 @@ public void svgGElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function SVGGeometryElement() { [native code] }") + CHROME = "function SVGGeometryElement() { [native code] }", + FF = "function SVGGeometryElement() {\n [native code]\n}") public void svgGeometryElement() throws Exception { test("SVGGeometryElement"); } @@ -8986,10 +8994,8 @@ public void svgPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSeg() { [native code] }", - FF = "function SVGPathSeg() {\n [native code]\n}", - IE = "[object SVGPathSeg]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSeg]") public void svgPathSeg() throws Exception { test("SVGPathSeg"); } @@ -8998,9 +9004,8 @@ public void svgPathSeg() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegArcAbs() {\n [native code]\n}", - IE = "[object SVGPathSegArcAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegArcAbs]") public void svgPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs"); } @@ -9009,9 +9014,8 @@ public void svgPathSegArcAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegArcRel() {\n [native code]\n}", - IE = "[object SVGPathSegArcRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegArcRel]") public void svgPathSegArcRel() throws Exception { test("SVGPathSegArcRel"); } @@ -9020,9 +9024,8 @@ public void svgPathSegArcRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegClosePath() {\n [native code]\n}", - IE = "[object SVGPathSegClosePath]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegClosePath]") public void svgPathSegClosePath() throws Exception { test("SVGPathSegClosePath"); } @@ -9031,9 +9034,8 @@ public void svgPathSegClosePath() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoCubicAbs() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoCubicAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoCubicAbs]") public void svgPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs"); } @@ -9042,9 +9044,8 @@ public void svgPathSegCurvetoCubicAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoCubicRel() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoCubicRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoCubicRel]") public void svgPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel"); } @@ -9053,9 +9054,8 @@ public void svgPathSegCurvetoCubicRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoCubicSmoothAbs() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoCubicSmoothAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoCubicSmoothAbs]") public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs"); } @@ -9064,9 +9064,8 @@ public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoCubicSmoothRel() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoCubicSmoothRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoCubicSmoothRel]") public void svgPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel"); } @@ -9075,9 +9074,8 @@ public void svgPathSegCurvetoCubicSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoQuadraticAbs() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoQuadraticAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoQuadraticAbs]") public void svgPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs"); } @@ -9086,9 +9084,8 @@ public void svgPathSegCurvetoQuadraticAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoQuadraticRel() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoQuadraticRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoQuadraticRel]") public void svgPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel"); } @@ -9097,9 +9094,8 @@ public void svgPathSegCurvetoQuadraticRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoQuadraticSmoothAbs() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoQuadraticSmoothAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoQuadraticSmoothAbs]") public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -9108,9 +9104,8 @@ public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegCurvetoQuadraticSmoothRel() {\n [native code]\n}", - IE = "[object SVGPathSegCurvetoQuadraticSmoothRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegCurvetoQuadraticSmoothRel]") public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -9119,9 +9114,8 @@ public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegLinetoAbs() {\n [native code]\n}", - IE = "[object SVGPathSegLinetoAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegLinetoAbs]") public void svgPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs"); } @@ -9130,9 +9124,8 @@ public void svgPathSegLinetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegLinetoHorizontalAbs() {\n [native code]\n}", - IE = "[object SVGPathSegLinetoHorizontalAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegLinetoHorizontalAbs]") public void svgPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs"); } @@ -9141,9 +9134,8 @@ public void svgPathSegLinetoHorizontalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegLinetoHorizontalRel() {\n [native code]\n}", - IE = "[object SVGPathSegLinetoHorizontalRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegLinetoHorizontalRel]") public void svgPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel"); } @@ -9152,9 +9144,8 @@ public void svgPathSegLinetoHorizontalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegLinetoRel() {\n [native code]\n}", - IE = "[object SVGPathSegLinetoRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegLinetoRel]") public void svgPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel"); } @@ -9163,9 +9154,8 @@ public void svgPathSegLinetoRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegLinetoVerticalAbs() {\n [native code]\n}", - IE = "[object SVGPathSegLinetoVerticalAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegLinetoVerticalAbs]") public void svgPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs"); } @@ -9174,9 +9164,8 @@ public void svgPathSegLinetoVerticalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegLinetoVerticalRel() {\n [native code]\n}", - IE = "[object SVGPathSegLinetoVerticalRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegLinetoVerticalRel]") public void svgPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel"); } @@ -9196,9 +9185,8 @@ public void svgPathSegList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegMovetoAbs() {\n [native code]\n}", - IE = "[object SVGPathSegMovetoAbs]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegMovetoAbs]") public void svgPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs"); } @@ -9207,9 +9195,8 @@ public void svgPathSegMovetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function SVGPathSegMovetoRel() {\n [native code]\n}", - IE = "[object SVGPathSegMovetoRel]", - CHROME = "exception") + @Alerts(DEFAULT = "exception", + IE = "[object SVGPathSegMovetoRel]") public void svgPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel"); } @@ -9628,7 +9615,6 @@ public void svgVKernElement() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function SVGZoomEvent() {\n [native code]\n}", IE = "[object SVGZoomEvent]") public void svgZoomEvent() throws Exception { test("SVGZoomEvent"); @@ -10007,7 +9993,7 @@ public void uiEvent() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint16Array}. + * Test Uint16Array. * * @throws Exception if an error occurs */ @@ -10020,7 +10006,7 @@ public void uint16Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint32Array}. + * Test Uint32Array. * * @throws Exception if an error occurs */ @@ -10033,7 +10019,7 @@ public void uint32Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8Array}. + * Test Uint8Array. * * @throws Exception if an error occurs */ @@ -10046,7 +10032,7 @@ public void uint8Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8ClampedArray}. + * Test Uint8ClampedArray. * * @throws Exception if an error occurs */ @@ -10155,7 +10141,7 @@ public void userDataHandler() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function UserProximityEvent() {\n [native code]\n}") + FF60 = "function UserProximityEvent() {\n [native code]\n}") public void userProximityEvent() throws Exception { test("UserProximityEvent"); } @@ -10185,8 +10171,7 @@ public void validityState() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - FF = "function VideoPlaybackQuality() {\n [native code]\n}", - EDGE = "function VideoPlaybackQuality() { [native code] }") + FF = "function VideoPlaybackQuality() {\n [native code]\n}") public void videoPlaybackQuality() throws Exception { test("VideoPlaybackQuality"); } @@ -10204,7 +10189,9 @@ public void vrDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function VRDisplay() {\n [native code]\n}") + @NotYetImplemented(FF) public void vrDisplay() throws Exception { test("VRDisplay"); } @@ -10213,7 +10200,9 @@ public void vrDisplay() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function VRDisplayCapabilities() {\n [native code]\n}") + @NotYetImplemented(FF) public void vrDisplayCapabilities() throws Exception { test("VRDisplayCapabilities"); } @@ -10222,7 +10211,9 @@ public void vrDisplayCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function VREyeParameters() {\n [native code]\n}") + @NotYetImplemented(FF) public void vrEyeParameters() throws Exception { test("VREyeParameters"); } @@ -10231,7 +10222,9 @@ public void vrEyeParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function VRFieldOfView() {\n [native code]\n}") + @NotYetImplemented(FF) public void vrFieldOfView() throws Exception { test("VRFieldOfView"); } @@ -10258,7 +10251,9 @@ public void vrLayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function VRPose() {\n [native code]\n}") + @NotYetImplemented(FF) public void vrPose() throws Exception { test("VRPose"); } @@ -10276,7 +10271,9 @@ public void vrPositionState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function VRStageParameters() {\n [native code]\n}") + @NotYetImplemented(FF) public void vrStageParameters() throws Exception { test("VRStageParameters"); } @@ -10450,7 +10447,7 @@ public void webGL_lose_context() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function WebGL2RenderingContext() { [native code] }", - FF52 = "function WebGL2RenderingContext() {\n [native code]\n}") + FF = "function WebGL2RenderingContext() {\n [native code]\n}") public void webGL2RenderingContext() throws Exception { test("WebGL2RenderingContext"); } @@ -10482,9 +10479,8 @@ public void webGLBuffer() throws Exception { */ @Test @Alerts(DEFAULT = "function WebGLContextEvent() { [native code] }", - FF45 = "exception", IE = "\nfunction WebGLContextEvent() {\n [native code]\n}\n", - FF52 = "function WebGLContextEvent() {\n [native code]\n}") + FF = "function WebGLContextEvent() {\n [native code]\n}") public void webGLContextEvent() throws Exception { test("WebGLContextEvent"); } @@ -10517,7 +10513,7 @@ public void webGLProgram() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function WebGLQuery() { [native code] }", - FF52 = "function WebGLQuery() {\n [native code]\n}") + FF = "function WebGLQuery() {\n [native code]\n}") public void webGLQuery() throws Exception { test("WebGLQuery"); } @@ -10552,7 +10548,7 @@ public void webGLRenderingContext() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function WebGLSampler() { [native code] }", - FF52 = "function WebGLSampler() {\n [native code]\n}") + FF = "function WebGLSampler() {\n [native code]\n}") public void webGLSampler() throws Exception { test("WebGLSampler"); } @@ -10585,7 +10581,7 @@ public void webGLShaderPrecisionFormat() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function WebGLSync() { [native code] }", - FF52 = "function WebGLSync() {\n [native code]\n}") + FF = "function WebGLSync() {\n [native code]\n}") public void webGLSync() throws Exception { test("WebGLSync"); } @@ -10616,7 +10612,7 @@ public void webGLTimerQueryEXT() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function WebGLTransformFeedback() { [native code] }", - FF52 = "function WebGLTransformFeedback() {\n [native code]\n}") + FF = "function WebGLTransformFeedback() {\n [native code]\n}") public void webGLTransformFeedback() throws Exception { test("WebGLTransformFeedback"); } @@ -10638,7 +10634,7 @@ public void webGLUniformLocation() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function WebGLVertexArrayObject() { [native code] }", - FF52 = "function WebGLVertexArrayObject() {\n [native code]\n}") + FF = "function WebGLVertexArrayObject() {\n [native code]\n}") public void webGLVertexArrayObject() throws Exception { test("WebGLVertexArrayObject"); } @@ -10656,8 +10652,7 @@ public void webGLVertexArrayObjectOES() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - CHROME = "function AnimationEvent() { [native code] }") + @Alerts("exception") public void webKitAnimationEvent() throws Exception { test("WebKitAnimationEvent"); } @@ -10677,8 +10672,7 @@ public void webkitAudioContext() throws Exception { @Test @Alerts(DEFAULT = "exception", CHROME = "function DOMMatrix() { [native code] }", - EDGE = "function WebKitCSSMatrix() { [native code] }", - FF52 = "function WebKitCSSMatrix() {\n [native code]\n}") + FF = "function WebKitCSSMatrix() {\n [native code]\n}") @NotYetImplemented(CHROME) public void webKitCSSMatrix() throws Exception { test("WebKitCSSMatrix"); @@ -10839,7 +10833,7 @@ public void webkitSpeechRecognition() throws Exception { */ @Test @Alerts(DEFAULT = "exception", - CHROME = "function SpeechRecognitionError() { [native code] }") + CHROME = "function SpeechRecognitionErrorEvent() { [native code] }") public void webkitSpeechRecognitionError() throws Exception { test("webkitSpeechRecognitionError"); } @@ -10858,8 +10852,7 @@ public void webkitSpeechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - CHROME = "function TransitionEvent() { [native code] }") + @Alerts("exception") public void webKitTransitionEvent() throws Exception { test("WebKitTransitionEvent"); } @@ -11089,8 +11082,7 @@ public void xmlHttpRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", - CHROME = "function XMLHttpRequestEventTarget() { [native code] }", + @Alerts(CHROME = "function XMLHttpRequestEventTarget() { [native code] }", FF = "function XMLHttpRequestEventTarget() {\n [native code]\n}", IE = "[object XMLHttpRequestEventTarget]") public void xmlHttpRequestEventTarget() throws Exception { @@ -11160,8 +11152,7 @@ public void xPathExpression() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - EDGE = "function XPathNSResolver() { [native code] }") + @Alerts("exception") public void xPathNSResolver() throws Exception { test("XPathNSResolver"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/HostConstantsTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/HostConstantsTest.java index 8c465f9c8af..8c866f2c739 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/HostConstantsTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/HostConstantsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,14 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner; import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner.Default; @@ -40,6 +43,7 @@ * Test all {@code constant}s defined in host classes. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) @ToRunWithRealBrowsers @@ -53,7 +57,7 @@ public class HostConstantsTest extends WebDriverTestCase { @Parameters public static Collection data() throws Exception { final List list = new ArrayList<>(); - final List strings = TestCaseTest.getAllClassNames(); + final Set strings = TestCaseTest.getAllClassNames(); for (final String host : strings) { if (!"Audio".equals(host)) { list.add(new Object[] {host}); @@ -77,8 +81,11 @@ public static Collection data() throws Exception { public void test() throws Exception { setExpectedAlerts(getExpectedString()); - loadPageWithAlerts2("\n" + final String html = "\n" + "\n" - + "\n" - + ""); + + "\n" + + "\n" + + " \n" + + ""; + + final WebDriver driver = loadPage2(html); + final String text = driver.findElement(By.id("log")).getAttribute("value").trim().replaceAll("\r", ""); + assertEquals(String.join("\n", getExpectedAlerts()), text); } /** @@ -125,7 +138,7 @@ private String getExpectedString() throws Exception { return ""; } if ("Error".equals(host_) && getBrowserVersion().hasFeature(JS_ERROR_STACK_TRACE_LIMIT)) { - return "stackTraceLimit:10 "; + return "stackTraceLimit:10"; } final JavaScriptConfiguration javaScriptConfig = JavaScriptConfiguration.getInstance(getBrowserVersion()); final List constants = new ArrayList<>(); @@ -146,7 +159,6 @@ private String getExpectedString() throws Exception { } Collections.sort(constants, new Comparator() { - @Override public int compare(final String o1, final String o2) { return o1.substring(0, o1.indexOf(':')).compareTo(o2.substring(0, o2.indexOf(':'))); @@ -156,7 +168,7 @@ public int compare(final String o1, final String o2) { for (final String key : constants) { builder.append(key).append(' '); } - return builder.toString(); + return builder.toString().trim(); } /** diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/HostExtractor.java b/src/test/java/com/gargoylesoftware/htmlunit/general/HostExtractor.java index 92741c829a8..7ceff6e4d62 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/HostExtractor.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/HostExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/HostTestsTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/HostTestsTest.java index 3ee2d46efe8..fc60fccc87f 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/HostTestsTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/HostTestsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ private void collectionObjectNames(final File dir, final Set set) throws final File[] files = dir.listFiles(); if (files != null) { for (final File file : files) { - if (file.isDirectory() && !".svn".equals(file.getName())) { + if (file.isDirectory() && !".git".equals(file.getName())) { collectionObjectNames(file, set); } else if (file.getName().endsWith(".java")) { diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/HostTypeOfTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/HostTypeOfTest.java index 3eb17444e32..ecde9add0d3 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/HostTypeOfTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/HostTypeOfTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.general; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; @@ -92,8 +93,8 @@ public void angle_instanced_arrays() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void animation() throws Exception { test("Animation"); } @@ -152,7 +153,7 @@ public void arguments() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBuffer}. + * Test ArrayBuffer. * * @throws Exception if an error occurs */ @@ -163,7 +164,7 @@ public void arrayBuffer() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView}. + * Test ArrayBufferView. * * @throws Exception if an error occurs */ @@ -174,7 +175,7 @@ public void arrayBufferView() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase}. + * Test ArrayBufferViewBase. * * @throws Exception if an error occurs */ @@ -301,8 +302,8 @@ public void audioProcessingEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void audioScheduledSourceNode() throws Exception { test("AudioScheduledSourceNode"); } @@ -330,8 +331,8 @@ public void barProp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void baseAudioContext() throws Exception { test("BaseAudioContext"); } @@ -447,8 +448,7 @@ public void broadcastChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts("undefined") public void budgetService() throws Exception { test("BudgetService"); } @@ -690,9 +690,8 @@ public void console() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void constantSourceNode() throws Exception { test("ConstantSourceNode"); } @@ -723,8 +722,8 @@ public void coordinates() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void credential() throws Exception { test("Credential"); } @@ -733,8 +732,8 @@ public void credential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void credentialsContainer() throws Exception { test("CredentialsContainer"); } @@ -764,6 +763,7 @@ public void cryptoKey() throws Exception { */ @Test @Alerts(DEFAULT = "function", + FF68 = "object", IE = "undefined") public void css() throws Exception { test("CSS"); @@ -794,9 +794,8 @@ public void cssCharsetRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF = "object") + @Alerts(DEFAULT = "function", + IE = "undefined") public void cssConditionRule() throws Exception { test("CSSConditionRule"); } @@ -806,7 +805,7 @@ public void cssConditionRule() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "object") + FF = "function") public void cssCounterStyleRule() throws Exception { test("CSSCounterStyleRule"); } @@ -817,8 +816,8 @@ public void cssCounterStyleRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssFontFaceRule() throws Exception { test("CSSFontFaceRule"); } @@ -827,9 +826,8 @@ public void cssFontFaceRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF = "object") + @Alerts(DEFAULT = "function", + IE = "undefined") public void cssGroupingRule() throws Exception { test("CSSGroupingRule"); } @@ -840,8 +838,8 @@ public void cssGroupingRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssImportRule() throws Exception { test("CSSImportRule"); } @@ -850,9 +848,7 @@ public void cssImportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "object", + @Alerts(DEFAULT = "function", IE = "object") public void cssKeyframeRule() throws Exception { test("CSSKeyframeRule"); @@ -862,9 +858,7 @@ public void cssKeyframeRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "object", + @Alerts(DEFAULT = "function", IE = "object") public void cssKeyframesRule() throws Exception { test("CSSKeyframesRule"); @@ -876,8 +870,8 @@ public void cssKeyframesRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssMediaRule() throws Exception { test("CSSMediaRule"); } @@ -886,9 +880,8 @@ public void cssMediaRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - IE = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssNamespaceRule() throws Exception { test("CSSNamespaceRule"); } @@ -897,8 +890,8 @@ public void cssNamespaceRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssPageRule() throws Exception { test("CSSPageRule"); } @@ -910,7 +903,7 @@ public void cssPageRule() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void cssPrimitiveValue() throws Exception { test("CSSPrimitiveValue"); } @@ -921,8 +914,8 @@ public void cssPrimitiveValue() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssRule() throws Exception { test("CSSRule"); } @@ -957,8 +950,8 @@ public void cssStyleDeclaration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "object") public void cssStyleRule() throws Exception { test("CSSStyleRule"); } @@ -979,9 +972,8 @@ public void cssStyleSheet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF = "object") + @Alerts(DEFAULT = "function", + IE = "undefined") public void cssSupportsRule() throws Exception { test("CSSSupportsRule"); } @@ -993,7 +985,7 @@ public void cssSupportsRule() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void cssValue() throws Exception { test("CSSValue"); } @@ -1003,7 +995,7 @@ public void cssValue() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void cssValueList() throws Exception { test("CSSValueList"); } @@ -1022,7 +1014,8 @@ public void cssViewportRule() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - CHROME = "function") + CHROME = "function", + FF68 = "function") public void customElementRegistry() throws Exception { test("CustomElementRegistry"); } @@ -1051,9 +1044,8 @@ public void dataTransfer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF52 = "function", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void dataTransferItem() throws Exception { test("DataTransferItem"); } @@ -1062,15 +1054,14 @@ public void dataTransferItem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF52 = "function", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void dataTransferItemList() throws Exception { test("DataTransferItemList"); } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.DataView}. + * Test DataView. * * @throws Exception if an error occurs */ @@ -1095,7 +1086,7 @@ public void delayNode() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void deviceLightEvent() throws Exception { test("DeviceLightEvent"); } @@ -1125,7 +1116,7 @@ public void deviceOrientationEvent() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void deviceProximityEvent() throws Exception { test("DeviceProximityEvent"); } @@ -1191,7 +1182,7 @@ public void documentType() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void domCursor() throws Exception { test("DOMCursor"); } @@ -1297,9 +1288,8 @@ public void domRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "undefined", - FF = "function") - @NotYetImplemented(FF) + @Alerts(DEFAULT = "function", + IE = "undefined") public void domRectList() throws Exception { test("DOMRectList"); } @@ -1328,10 +1318,8 @@ public void domRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function", - IE = "object", - CHROME = "undefined", - FF52 = "undefined") + @Alerts(DEFAULT = "undefined", + IE = "object") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -1509,7 +1497,7 @@ public void extendableMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + CHROME = "function") public void external() throws Exception { test("External"); } @@ -1585,7 +1573,7 @@ public void fileRequest() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void fileSystem() throws Exception { test("FileSystem"); } @@ -1595,7 +1583,7 @@ public void fileSystem() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void fileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry"); } @@ -1605,7 +1593,7 @@ public void fileSystemDirectoryEntry() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void fileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader"); } @@ -1615,7 +1603,7 @@ public void fileSystemDirectoryReader() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void fileSystemEntry() throws Exception { test("FileSystemEntry"); } @@ -1625,13 +1613,13 @@ public void fileSystemEntry() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void fileSystemFileEntry() throws Exception { test("FileSystemFileEntry"); } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Float32Array}. + * Test Float32Array. * * @throws Exception if an error occurs */ @@ -1642,7 +1630,7 @@ public void float32Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Float64Array}. + * Test Float64Array. * * @throws Exception if an error occurs */ @@ -1758,6 +1746,7 @@ public void gamepadEvent() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", + CHROME = "function", IE = "object") public void geolocation() throws Exception { test("Geolocation"); @@ -1836,9 +1825,8 @@ public void htmlAnchorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "undefined", - FF = "function") + @Alerts(DEFAULT = "undefined", + IE = "object") public void htmlAppletElement() throws Exception { test("HTMLAppletElement"); } @@ -2001,9 +1989,8 @@ public void htmlCommentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function", - FF52 = "undefined", - IE = "undefined") + @Alerts(DEFAULT = "undefined", + CHROME = "function") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -2070,9 +2057,8 @@ public void htmlDefinitionTermElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "undefined", - FF52 = "function", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void htmlDetailsElement() throws Exception { test("HTMLDetailsElement"); } @@ -2456,9 +2442,9 @@ public void htmlMapElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "object", - CHROME = "function", - FF = "undefined") + @Alerts(DEFAULT = "function", + FF60 = "undefined", + IE = "object") public void htmlMarqueeElement() throws Exception { test("HTMLMarqueeElement"); } @@ -2740,9 +2726,8 @@ public void htmlSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function", - FF52 = "undefined", - IE = "undefined") + @Alerts(DEFAULT = "undefined", + CHROME = "function") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -2752,7 +2737,8 @@ public void htmlShadowElement() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - CHROME = "function") + CHROME = "function", + FF68 = "function") public void htmlSlotElement() throws Exception { test("HTMLSlotElement"); } @@ -3136,8 +3122,8 @@ public void idbVersionChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void idleDeadline() throws Exception { test("IdleDeadline"); } @@ -3146,9 +3132,8 @@ public void idleDeadline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void iirFilterNode() throws Exception { test("IIRFilterNode"); } @@ -3178,9 +3163,8 @@ public void imageBitmap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void imageBitmapRenderingContext() throws Exception { test("ImageBitmapRenderingContext"); } @@ -3235,7 +3219,7 @@ public void installTriggerImpl() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Int16Array}. + * Test Int16Array. * * @throws Exception if an error occurs */ @@ -3246,7 +3230,7 @@ public void int16Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Int32Array}. + * Test Int32Array. * * @throws Exception if an error occurs */ @@ -3257,7 +3241,7 @@ public void int32Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Int8Array}. + * Test Int8Array. * * @throws Exception if an error occurs */ @@ -3271,8 +3255,8 @@ public void int8Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void intersectionObserver() throws Exception { test("IntersectionObserver"); } @@ -3281,8 +3265,8 @@ public void intersectionObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void intersectionObserverEntry() throws Exception { test("IntersectionObserverEntry"); } @@ -3323,7 +3307,9 @@ public void keyboardEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("undefined") + @Alerts(DEFAULT = "undefined", + CHROME = "function", + FF68 = "function") public void keyframeEffect() throws Exception { test("KeyframeEffect"); } @@ -3335,7 +3321,7 @@ public void keyframeEffect() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void localMediaStream() throws Exception { test("LocalMediaStream"); } @@ -3524,8 +3510,8 @@ public void mediaQueryList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void mediaQueryListEvent() throws Exception { test("MediaQueryListEvent"); } @@ -3785,8 +3771,7 @@ public void mouseWheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF45 = "function") + @Alerts("undefined") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -3795,8 +3780,7 @@ public void mozContactChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF45 = "object") + @Alerts("undefined") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -3841,8 +3825,7 @@ public void mozMobileMessageThread() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF45 = "function") + @Alerts("undefined") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -3881,8 +3864,7 @@ public void mozRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF45 = "function") + @Alerts("undefined") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -4209,7 +4191,9 @@ public void offlineResourceList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("undefined") + @Alerts(DEFAULT = "undefined", + CHROME = "function") + @NotYetImplemented(CHROME) public void offscreenCanvas() throws Exception { test("OffscreenCanvas"); } @@ -4370,8 +4354,7 @@ public void performanceNavigation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", + @Alerts(DEFAULT = "function", IE = "object") public void performanceNavigationTiming() throws Exception { test("PerformanceNavigationTiming"); @@ -4381,8 +4364,8 @@ public void performanceNavigationTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void performanceObserver() throws Exception { test("PerformanceObserver"); } @@ -4391,8 +4374,8 @@ public void performanceObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void performanceObserverEntryList() throws Exception { test("PerformanceObserverEntryList"); } @@ -4431,9 +4414,8 @@ public void periodicWave() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void permissions() throws Exception { test("Permissions"); } @@ -4442,9 +4424,8 @@ public void permissions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void permissionStatus() throws Exception { test("PermissionStatus"); } @@ -4481,7 +4462,7 @@ public void pluginArray() throws Exception { @Test @Alerts(DEFAULT = "object", CHROME = "function", - FF = "undefined") + FF = "function") public void pointerEvent() throws Exception { test("PointerEvent"); } @@ -4637,6 +4618,7 @@ public void promiseRejectionEvent() throws Exception { @Test @Alerts(DEFAULT = "function", IE = "undefined") + @NotYetImplemented({CHROME, FF}) public void proxy() throws Exception { test("Proxy"); } @@ -4707,7 +4689,8 @@ public void readableByteStream() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - CHROME = "function") + CHROME = "function", + FF68 = "function") public void readableStream() throws Exception { test("ReadableStream"); } @@ -4879,7 +4862,8 @@ public void scriptProcessorNode() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - CHROME = "function") + CHROME = "function", + FF68 = "function") public void securityPolicyViolationEvent() throws Exception { test("SecurityPolicyViolationEvent"); } @@ -4960,7 +4944,8 @@ public void set() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - CHROME = "function") + CHROME = "function", + FF68 = "function") public void shadowRoot() throws Exception { test("ShadowRoot"); } @@ -5095,7 +5080,7 @@ public void speechRecognitionResultList() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void speechSynthesis() throws Exception { test("SpeechSynthesis"); } @@ -5104,8 +5089,8 @@ public void speechSynthesis() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void speechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent"); } @@ -5114,9 +5099,8 @@ public void speechSynthesisErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void speechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent"); } @@ -5125,9 +5109,8 @@ public void speechSynthesisEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void speechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance"); } @@ -5137,7 +5120,7 @@ public void speechSynthesisUtterance() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF52 = "function") + FF = "function") public void speechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice"); } @@ -5167,8 +5150,7 @@ public void stereoPannerNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "undefined", - FF = "object") + @Alerts("undefined") public void stopIteration() throws Exception { test("StopIteration"); } @@ -5199,8 +5181,8 @@ public void storageEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void storageManager() throws Exception { test("StorageManager"); } @@ -5260,13 +5242,10 @@ public void svgAElement() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.svg.SVGAltGlyphElement}. - * * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "undefined", - FF45 = "function") + @Alerts("undefined") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -5530,8 +5509,7 @@ public void svgDiscardElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "undefined", - FF45 = "function") + @Alerts("undefined") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -5898,8 +5876,8 @@ public void svgGElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void svgGeometryElement() throws Exception { test("SVGGeometryElement"); } @@ -6077,7 +6055,6 @@ public void svgPathElement() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSeg() throws Exception { test("SVGPathSeg"); @@ -6088,7 +6065,6 @@ public void svgPathSeg() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs"); @@ -6099,7 +6075,6 @@ public void svgPathSegArcAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegArcRel() throws Exception { test("SVGPathSegArcRel"); @@ -6110,7 +6085,6 @@ public void svgPathSegArcRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegClosePath() throws Exception { test("SVGPathSegClosePath"); @@ -6121,7 +6095,6 @@ public void svgPathSegClosePath() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs"); @@ -6132,7 +6105,6 @@ public void svgPathSegCurvetoCubicAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel"); @@ -6143,7 +6115,6 @@ public void svgPathSegCurvetoCubicRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs"); @@ -6154,7 +6125,6 @@ public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel"); @@ -6165,7 +6135,6 @@ public void svgPathSegCurvetoCubicSmoothRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs"); @@ -6176,7 +6145,6 @@ public void svgPathSegCurvetoQuadraticAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel"); @@ -6187,7 +6155,6 @@ public void svgPathSegCurvetoQuadraticRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs"); @@ -6198,7 +6165,6 @@ public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel"); @@ -6209,7 +6175,6 @@ public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs"); @@ -6220,7 +6185,6 @@ public void svgPathSegLinetoAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs"); @@ -6231,7 +6195,6 @@ public void svgPathSegLinetoHorizontalAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel"); @@ -6242,7 +6205,6 @@ public void svgPathSegLinetoHorizontalRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel"); @@ -6253,7 +6215,6 @@ public void svgPathSegLinetoRel() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs"); @@ -6264,7 +6225,6 @@ public void svgPathSegLinetoVerticalAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel"); @@ -6286,7 +6246,6 @@ public void svgPathSegList() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs"); @@ -6297,7 +6256,6 @@ public void svgPathSegMovetoAbs() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel"); @@ -6635,7 +6593,6 @@ public void svgViewSpec() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", IE = "object") public void svgZoomEvent() throws Exception { test("SVGZoomEvent"); @@ -6878,7 +6835,7 @@ public void uIEvent() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint16Array}. + * Test Uint16Array. * * @throws Exception if an error occurs */ @@ -6889,7 +6846,7 @@ public void uint16Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint32Array}. + * Test Uint32Array. * * @throws Exception if an error occurs */ @@ -6900,7 +6857,7 @@ public void uint32Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8Array}. + * Test Uint8Array. * * @throws Exception if an error occurs */ @@ -6911,7 +6868,7 @@ public void uint8Array() throws Exception { } /** - * Test {@link com.gargoylesoftware.htmlunit.javascript.host.arrays.Uint8ClampedArray}. + * Test Uint8ClampedArray. * * @throws Exception if an error occurs */ @@ -6957,7 +6914,7 @@ public void urlSearchParams() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function") + FF60 = "function") public void userProximityEvent() throws Exception { test("UserProximityEvent"); } @@ -6977,8 +6934,7 @@ public void validityState() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", - EDGE = "function") + FF = "function") public void videoPlaybackQuality() throws Exception { test("VideoPlaybackQuality"); } @@ -7109,9 +7065,8 @@ public void webGL_depth_texture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void webGL2RenderingContext() throws Exception { test("WebGL2RenderingContext"); } @@ -7140,8 +7095,7 @@ public void webGLBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "function", - FF45 = "undefined") + @Alerts("function") public void webGLContextEvent() throws Exception { test("WebGLContextEvent"); } @@ -7170,9 +7124,8 @@ public void webGLProgram() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void webGLQuery() throws Exception { test("WebGLQuery"); } @@ -7201,10 +7154,9 @@ public void webGLRenderingContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") - public void WebGLSampler() throws Exception { + @Alerts(DEFAULT = "function", + IE = "undefined") + public void webGLSampler() throws Exception { test("WebGLSampler"); } @@ -7232,9 +7184,8 @@ public void webGLShaderPrecisionFormat() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void webGLSync() throws Exception { test("WebGLSync"); } @@ -7253,9 +7204,8 @@ public void webGLTexture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void webGLTransformFeedback() throws Exception { test("WebGLTransformFeedback"); } @@ -7274,9 +7224,8 @@ public void webGLUniformLocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void webGLVertexArrayObject() throws Exception { test("WebGLVertexArrayObject"); } @@ -7285,8 +7234,7 @@ public void webGLVertexArrayObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts("undefined") public void webKitAnimationEvent() throws Exception { test("WebKitAnimationEvent"); } @@ -7304,9 +7252,8 @@ public void webkitAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function", - FF52 = "function") + @Alerts(DEFAULT = "function", + IE = "undefined") public void webKitCSSMatrix() throws Exception { test("WebKitCSSMatrix"); } @@ -7476,8 +7423,7 @@ public void webkitSpeechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "undefined", - CHROME = "function") + @Alerts("undefined") public void webKitTransitionEvent() throws Exception { test("WebKitTransitionEvent"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/ElementClosesElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/ElementClosesElementTest.java index 762f14c1727..fa3eae68c74 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/ElementClosesElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/ElementClosesElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package com.gargoylesoftware.htmlunit.general.huge; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.EDGE; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; @@ -23,10 +22,12 @@ import java.util.Collection; import java.util.List; +import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; +import org.openqa.selenium.WebDriver; import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner; import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner.Default; @@ -45,6 +46,8 @@ @RunWith(BrowserParameterizedRunner.class) public class ElementClosesElementTest extends WebDriverTestCase { + private static int ServerRestartCount_ = 0; + /** * Returns the parameterized data. * @return the parameterized data @@ -76,16 +79,28 @@ private void test(final String parent, final String child) throws Exception { if ("script".equals(child)) { childString += ""; } - loadPageWithAlerts2("\n" + + final String html = "\n" + + "\n" + + "-\n" + "\n" - + "\n" + + "\n" + + "\n" + parentString + childString + suffix - + ""); + + ""; + + ServerRestartCount_++; + if (ServerRestartCount_ == 200) { + stopWebServers(); + ServerRestartCount_ = 0; + } + final WebDriver driver = loadPage2(html); + assertTitle(driver, getExpectedAlerts()[0]); } /** @@ -101,14 +116,12 @@ private void test(final String parent, final String child) throws Exception { public String child_; /** - * The default test. - * @throws Exception if an error occurs + * Cleanup. */ - @Test - @Alerts("1") - @Default - public void closes() throws Exception { - test(parent_, child_); + @After + public void after() { + parent_ = null; + child_ = null; } /** @@ -232,9 +245,9 @@ public void _a_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _a_isindex() throws Exception { test("a", "isindex"); } @@ -415,9 +428,9 @@ public void _abbr_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _abbr_isindex() throws Exception { test("abbr", "isindex"); } @@ -598,9 +611,9 @@ public void _acronym_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _acronym_isindex() throws Exception { test("acronym", "isindex"); } @@ -781,9 +794,9 @@ public void _address_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _address_isindex() throws Exception { test("address", "isindex"); } @@ -964,9 +977,9 @@ public void _applet_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _applet_isindex() throws Exception { test("applet", "isindex"); } @@ -2051,6 +2064,15 @@ public void _area_select() throws Exception { test("area", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _area_slot() throws Exception { + test("area", "slot"); + } + /** * @throws Exception if the test fails */ @@ -2132,6 +2154,15 @@ public void _area_sup() throws Exception { test("area", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _area_svg() throws Exception { + test("area", "svg"); + } + /** * @throws Exception if the test fails */ @@ -2407,9 +2438,9 @@ public void _article_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _article_isindex() throws Exception { test("article", "isindex"); } @@ -2590,9 +2621,9 @@ public void _aside_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _aside_isindex() throws Exception { test("aside", "isindex"); } @@ -2773,9 +2804,9 @@ public void _audio_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _audio_isindex() throws Exception { test("audio", "isindex"); } @@ -2956,9 +2987,9 @@ public void _b_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _b_isindex() throws Exception { test("b", "isindex"); } @@ -4043,6 +4074,15 @@ public void _base_select() throws Exception { test("base", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _base_slot() throws Exception { + test("base", "slot"); + } + /** * @throws Exception if the test fails */ @@ -4124,6 +4164,15 @@ public void _base_sup() throws Exception { test("base", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _base_svg() throws Exception { + test("base", "svg"); + } + /** * @throws Exception if the test fails */ @@ -5303,6 +5352,15 @@ public void _basefont_select() throws Exception { test("basefont", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _basefont_slot() throws Exception { + test("basefont", "slot"); + } + /** * @throws Exception if the test fails */ @@ -5384,6 +5442,15 @@ public void _basefont_sup() throws Exception { test("basefont", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _basefont_svg() throws Exception { + test("basefont", "svg"); + } + /** * @throws Exception if the test fails */ @@ -5659,9 +5726,9 @@ public void _bdi_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _bdi_isindex() throws Exception { test("bdi", "isindex"); } @@ -5842,9 +5909,9 @@ public void _bdo_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _bdo_isindex() throws Exception { test("bdo", "isindex"); } @@ -6929,6 +6996,15 @@ public void _bgsound_select() throws Exception { test("bgsound", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _bgsound_slot() throws Exception { + test("bgsound", "slot"); + } + /** * @throws Exception if the test fails */ @@ -7010,6 +7086,15 @@ public void _bgsound_sup() throws Exception { test("bgsound", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _bgsound_svg() throws Exception { + test("bgsound", "svg"); + } + /** * @throws Exception if the test fails */ @@ -7285,9 +7370,9 @@ public void _big_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _big_isindex() throws Exception { test("big", "isindex"); } @@ -7468,9 +7553,9 @@ public void _blink_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _blink_isindex() throws Exception { test("blink", "isindex"); } @@ -7651,9 +7736,9 @@ public void _blockquote_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _blockquote_isindex() throws Exception { test("blockquote", "isindex"); } @@ -8266,9 +8351,9 @@ public void _body_ins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "3", - CHROME = "2") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "2", + IE = "3") + @NotYetImplemented(IE) public void _body_isindex() throws Exception { test("body", "isindex"); } @@ -8669,6 +8754,15 @@ public void _body_select() throws Exception { test("body", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _body_slot() throws Exception { + test("body", "slot"); + } + /** * @throws Exception if the test fails */ @@ -8750,6 +8844,15 @@ public void _body_sup() throws Exception { test("body", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _body_svg() throws Exception { + test("body", "svg"); + } + /** * @throws Exception if the test fails */ @@ -9875,6 +9978,15 @@ public void _br_select() throws Exception { test("br", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _br_slot() throws Exception { + test("br", "slot"); + } + /** * @throws Exception if the test fails */ @@ -9956,6 +10068,15 @@ public void _br_sup() throws Exception { test("br", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _br_svg() throws Exception { + test("br", "svg"); + } + /** * @throws Exception if the test fails */ @@ -10249,9 +10370,9 @@ public void _button_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _button_isindex() throws Exception { test("button", "isindex"); } @@ -10432,9 +10553,9 @@ public void _canvas_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _canvas_isindex() throws Exception { test("canvas", "isindex"); } @@ -11497,7 +11618,6 @@ public void _caption_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _caption_script() throws Exception { test("caption", "script"); } @@ -11520,6 +11640,15 @@ public void _caption_select() throws Exception { test("caption", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _caption_slot() throws Exception { + test("caption", "slot"); + } + /** * @throws Exception if the test fails */ @@ -11601,6 +11730,15 @@ public void _caption_sup() throws Exception { test("caption", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _caption_svg() throws Exception { + test("caption", "svg"); + } + /** * @throws Exception if the test fails */ @@ -11876,9 +12014,9 @@ public void _center_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _center_isindex() throws Exception { test("center", "isindex"); } @@ -12059,9 +12197,9 @@ public void _cite_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _cite_isindex() throws Exception { test("cite", "isindex"); } @@ -12242,9 +12380,9 @@ public void _code_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _code_isindex() throws Exception { test("code", "isindex"); } @@ -13307,7 +13445,6 @@ public void _col_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _col_script() throws Exception { test("col", "script"); } @@ -13330,6 +13467,15 @@ public void _col_select() throws Exception { test("col", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _col_slot() throws Exception { + test("col", "slot"); + } + /** * @throws Exception if the test fails */ @@ -13411,6 +13557,15 @@ public void _col_sup() throws Exception { test("col", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _col_svg() throws Exception { + test("col", "svg"); + } + /** * @throws Exception if the test fails */ @@ -14568,7 +14723,6 @@ public void _colgroup_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _colgroup_script() throws Exception { test("colgroup", "script"); } @@ -14591,6 +14745,15 @@ public void _colgroup_select() throws Exception { test("colgroup", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _colgroup_slot() throws Exception { + test("colgroup", "slot"); + } + /** * @throws Exception if the test fails */ @@ -14672,6 +14835,15 @@ public void _colgroup_sup() throws Exception { test("colgroup", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _colgroup_svg() throws Exception { + test("colgroup", "svg"); + } + /** * @throws Exception if the test fails */ @@ -15518,8 +15690,7 @@ public void _command_ins() throws Exception { */ @Test @Alerts(DEFAULT = "0", - FF = "2") - @NotYetImplemented({FF, EDGE}) + FF = "1") public void _command_isindex() throws Exception { test("command", "isindex"); } @@ -15850,7 +16021,6 @@ public void _command_picture() throws Exception { @Test @Alerts(DEFAULT = "0", FF = "1") - @NotYetImplemented(EDGE) public void _command_plaintext() throws Exception { test("command", "plaintext"); } @@ -15965,6 +16135,16 @@ public void _command_select() throws Exception { test("command", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "0", + FF = "1") + public void _command_slot() throws Exception { + test("command", "slot"); + } + /** * @throws Exception if the test fails */ @@ -16055,6 +16235,16 @@ public void _command_sup() throws Exception { test("command", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "0", + FF = "1") + public void _command_svg() throws Exception { + test("command", "svg"); + } + /** * @throws Exception if the test fails */ @@ -16349,9 +16539,9 @@ public void _content_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _content_isindex() throws Exception { test("content", "isindex"); } @@ -16532,9 +16722,9 @@ public void _data_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _data_isindex() throws Exception { test("data", "isindex"); } @@ -16715,9 +16905,9 @@ public void _datalist_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _datalist_isindex() throws Exception { test("datalist", "isindex"); } @@ -16916,9 +17106,9 @@ public void _dd_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _dd_isindex() throws Exception { test("dd", "isindex"); } @@ -17099,9 +17289,9 @@ public void _del_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _del_isindex() throws Exception { test("del", "isindex"); } @@ -17282,9 +17472,9 @@ public void _details_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _details_isindex() throws Exception { test("details", "isindex"); } @@ -17465,9 +17655,9 @@ public void _dfn_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _dfn_isindex() throws Exception { test("dfn", "isindex"); } @@ -17648,9 +17838,9 @@ public void _dialog_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _dialog_isindex() throws Exception { test("dialog", "isindex"); } @@ -17831,9 +18021,9 @@ public void _dir_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _dir_isindex() throws Exception { test("dir", "isindex"); } @@ -18014,9 +18204,9 @@ public void _div_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _div_isindex() throws Exception { test("div", "isindex"); } @@ -18197,9 +18387,9 @@ public void _dl_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _dl_isindex() throws Exception { test("dl", "isindex"); } @@ -18398,9 +18588,9 @@ public void _dt_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _dt_isindex() throws Exception { test("dt", "isindex"); } @@ -18581,9 +18771,9 @@ public void _em_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _em_isindex() throws Exception { test("em", "isindex"); } @@ -19646,7 +19836,6 @@ public void _embed_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _embed_script() throws Exception { test("embed", "script"); } @@ -19669,6 +19858,15 @@ public void _embed_select() throws Exception { test("embed", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _embed_slot() throws Exception { + test("embed", "slot"); + } + /** * @throws Exception if the test fails */ @@ -19750,6 +19948,15 @@ public void _embed_sup() throws Exception { test("embed", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _embed_svg() throws Exception { + test("embed", "svg"); + } + /** * @throws Exception if the test fails */ @@ -20025,9 +20232,9 @@ public void _fieldset_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _fieldset_isindex() throws Exception { test("fieldset", "isindex"); } @@ -20208,9 +20415,9 @@ public void _figcaption_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _figcaption_isindex() throws Exception { test("figcaption", "isindex"); } @@ -20391,9 +20598,9 @@ public void _figure_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _figure_isindex() throws Exception { test("figure", "isindex"); } @@ -20574,9 +20781,9 @@ public void _font_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _font_isindex() throws Exception { test("font", "isindex"); } @@ -20757,9 +20964,9 @@ public void _footer_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _footer_isindex() throws Exception { test("footer", "isindex"); } @@ -21994,7 +22201,6 @@ public void _frame_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _frame_script() throws Exception { test("frame", "script"); } @@ -22017,6 +22223,15 @@ public void _frame_select() throws Exception { test("frame", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _frame_slot() throws Exception { + test("frame", "slot"); + } + /** * @throws Exception if the test fails */ @@ -22098,6 +22313,15 @@ public void _frame_sup() throws Exception { test("frame", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _frame_svg() throws Exception { + test("frame", "svg"); + } + /** * @throws Exception if the test fails */ @@ -23255,7 +23479,6 @@ public void _frameset_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _frameset_script() throws Exception { test("frameset", "script"); } @@ -23278,6 +23501,15 @@ public void _frameset_select() throws Exception { test("frameset", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _frameset_slot() throws Exception { + test("frameset", "slot"); + } + /** * @throws Exception if the test fails */ @@ -23359,6 +23591,15 @@ public void _frameset_sup() throws Exception { test("frameset", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _frameset_svg() throws Exception { + test("frameset", "svg"); + } + /** * @throws Exception if the test fails */ @@ -23688,9 +23929,9 @@ public void _h1_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _h1_isindex() throws Exception { test("h1", "isindex"); } @@ -23925,9 +24166,9 @@ public void _h2_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _h2_isindex() throws Exception { test("h2", "isindex"); } @@ -24162,9 +24403,9 @@ public void _h3_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _h3_isindex() throws Exception { test("h3", "isindex"); } @@ -24399,9 +24640,9 @@ public void _h4_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _h4_isindex() throws Exception { test("h4", "isindex"); } @@ -24636,9 +24877,9 @@ public void _h5_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _h5_isindex() throws Exception { test("h5", "isindex"); } @@ -24873,9 +25114,9 @@ public void _h6_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _h6_isindex() throws Exception { test("h6", "isindex"); } @@ -25938,7 +26179,6 @@ public void _head_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _head_script() throws Exception { test("head", "script"); } @@ -25961,6 +26201,15 @@ public void _head_select() throws Exception { test("head", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _head_slot() throws Exception { + test("head", "slot"); + } + /** * @throws Exception if the test fails */ @@ -26042,6 +26291,15 @@ public void _head_sup() throws Exception { test("head", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _head_svg() throws Exception { + test("head", "svg"); + } + /** * @throws Exception if the test fails */ @@ -26317,9 +26575,9 @@ public void _header_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _header_isindex() throws Exception { test("header", "isindex"); } @@ -27382,7 +27640,6 @@ public void _hr_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _hr_script() throws Exception { test("hr", "script"); } @@ -27405,6 +27662,15 @@ public void _hr_select() throws Exception { test("hr", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _hr_slot() throws Exception { + test("hr", "slot"); + } + /** * @throws Exception if the test fails */ @@ -27486,6 +27752,15 @@ public void _hr_sup() throws Exception { test("hr", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _hr_svg() throws Exception { + test("hr", "svg"); + } + /** * @throws Exception if the test fails */ @@ -27661,7 +27936,8 @@ public void _hr_xmp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_a() throws Exception { test("html", "a"); } @@ -27670,7 +27946,8 @@ public void _html_a() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_abbr() throws Exception { test("html", "abbr"); } @@ -27679,7 +27956,8 @@ public void _html_abbr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_acronym() throws Exception { test("html", "acronym"); } @@ -27688,7 +27966,8 @@ public void _html_acronym() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_address() throws Exception { test("html", "address"); } @@ -27697,7 +27976,8 @@ public void _html_address() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_applet() throws Exception { test("html", "applet"); } @@ -27706,7 +27986,8 @@ public void _html_applet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_area() throws Exception { test("html", "area"); } @@ -27715,7 +27996,8 @@ public void _html_area() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_article() throws Exception { test("html", "article"); } @@ -27724,7 +28006,8 @@ public void _html_article() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_aside() throws Exception { test("html", "aside"); } @@ -27733,7 +28016,8 @@ public void _html_aside() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_audio() throws Exception { test("html", "audio"); } @@ -27742,7 +28026,8 @@ public void _html_audio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_b() throws Exception { test("html", "b"); } @@ -27751,7 +28036,8 @@ public void _html_b() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_base() throws Exception { test("html", "base"); } @@ -27760,7 +28046,8 @@ public void _html_base() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_basefont() throws Exception { test("html", "basefont"); } @@ -27769,7 +28056,8 @@ public void _html_basefont() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_bdi() throws Exception { test("html", "bdi"); } @@ -27778,7 +28066,8 @@ public void _html_bdi() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_bdo() throws Exception { test("html", "bdo"); } @@ -27787,7 +28076,8 @@ public void _html_bdo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_bgsound() throws Exception { test("html", "bgsound"); } @@ -27796,7 +28086,8 @@ public void _html_bgsound() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_big() throws Exception { test("html", "big"); } @@ -27805,7 +28096,8 @@ public void _html_big() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_blink() throws Exception { test("html", "blink"); } @@ -27814,7 +28106,8 @@ public void _html_blink() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_blockquote() throws Exception { test("html", "blockquote"); } @@ -27823,7 +28116,8 @@ public void _html_blockquote() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_body() throws Exception { test("html", "body"); } @@ -27832,7 +28126,8 @@ public void _html_body() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_br() throws Exception { test("html", "br"); } @@ -27841,7 +28136,8 @@ public void _html_br() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_button() throws Exception { test("html", "button"); } @@ -27850,7 +28146,8 @@ public void _html_button() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_canvas() throws Exception { test("html", "canvas"); } @@ -27859,7 +28156,8 @@ public void _html_canvas() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_caption() throws Exception { test("html", "caption"); } @@ -27868,7 +28166,8 @@ public void _html_caption() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_center() throws Exception { test("html", "center"); } @@ -27877,7 +28176,8 @@ public void _html_center() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_cite() throws Exception { test("html", "cite"); } @@ -27886,7 +28186,8 @@ public void _html_cite() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_code() throws Exception { test("html", "code"); } @@ -27895,7 +28196,8 @@ public void _html_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_col() throws Exception { test("html", "col"); } @@ -27904,7 +28206,8 @@ public void _html_col() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_colgroup() throws Exception { test("html", "colgroup"); } @@ -27913,7 +28216,8 @@ public void _html_colgroup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_command() throws Exception { test("html", "command"); } @@ -27922,7 +28226,8 @@ public void _html_command() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_content() throws Exception { test("html", "content"); } @@ -27931,7 +28236,8 @@ public void _html_content() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_data() throws Exception { test("html", "data"); } @@ -27940,7 +28246,8 @@ public void _html_data() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_datalist() throws Exception { test("html", "datalist"); } @@ -27949,7 +28256,8 @@ public void _html_datalist() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_dd() throws Exception { test("html", "dd"); } @@ -27958,7 +28266,8 @@ public void _html_dd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_del() throws Exception { test("html", "del"); } @@ -27967,7 +28276,8 @@ public void _html_del() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_details() throws Exception { test("html", "details"); } @@ -27976,7 +28286,8 @@ public void _html_details() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_dfn() throws Exception { test("html", "dfn"); } @@ -27985,7 +28296,8 @@ public void _html_dfn() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_dialog() throws Exception { test("html", "dialog"); } @@ -27994,7 +28306,8 @@ public void _html_dialog() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_dir() throws Exception { test("html", "dir"); } @@ -28003,7 +28316,8 @@ public void _html_dir() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_div() throws Exception { test("html", "div"); } @@ -28012,7 +28326,8 @@ public void _html_div() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_dl() throws Exception { test("html", "dl"); } @@ -28021,7 +28336,8 @@ public void _html_dl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_dt() throws Exception { test("html", "dt"); } @@ -28030,7 +28346,8 @@ public void _html_dt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_em() throws Exception { test("html", "em"); } @@ -28039,7 +28356,8 @@ public void _html_em() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_embed() throws Exception { test("html", "embed"); } @@ -28048,7 +28366,8 @@ public void _html_embed() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_fieldset() throws Exception { test("html", "fieldset"); } @@ -28057,7 +28376,8 @@ public void _html_fieldset() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_figcaption() throws Exception { test("html", "figcaption"); } @@ -28066,7 +28386,8 @@ public void _html_figcaption() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_figure() throws Exception { test("html", "figure"); } @@ -28075,7 +28396,8 @@ public void _html_figure() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_font() throws Exception { test("html", "font"); } @@ -28084,7 +28406,8 @@ public void _html_font() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_footer() throws Exception { test("html", "footer"); } @@ -28093,7 +28416,8 @@ public void _html_footer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_form() throws Exception { test("html", "form"); } @@ -28102,7 +28426,8 @@ public void _html_form() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_frame() throws Exception { test("html", "frame"); } @@ -28111,7 +28436,8 @@ public void _html_frame() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_frameset() throws Exception { test("html", "frameset"); } @@ -28120,7 +28446,8 @@ public void _html_frameset() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_h1() throws Exception { test("html", "h1"); } @@ -28129,7 +28456,8 @@ public void _html_h1() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_h2() throws Exception { test("html", "h2"); } @@ -28138,7 +28466,8 @@ public void _html_h2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_h3() throws Exception { test("html", "h3"); } @@ -28147,7 +28476,8 @@ public void _html_h3() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_h4() throws Exception { test("html", "h4"); } @@ -28156,7 +28486,8 @@ public void _html_h4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_h5() throws Exception { test("html", "h5"); } @@ -28165,7 +28496,8 @@ public void _html_h5() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_h6() throws Exception { test("html", "h6"); } @@ -28174,7 +28506,8 @@ public void _html_h6() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_head() throws Exception { test("html", "head"); } @@ -28183,7 +28516,8 @@ public void _html_head() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_header() throws Exception { test("html", "header"); } @@ -28192,7 +28526,8 @@ public void _html_header() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_hr() throws Exception { test("html", "hr"); } @@ -28201,7 +28536,8 @@ public void _html_hr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_html() throws Exception { test("html", "html"); } @@ -28210,7 +28546,8 @@ public void _html_html() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_i() throws Exception { test("html", "i"); } @@ -28219,7 +28556,8 @@ public void _html_i() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_iframe() throws Exception { test("html", "iframe"); } @@ -28228,7 +28566,8 @@ public void _html_iframe() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_image() throws Exception { test("html", "image"); } @@ -28237,7 +28576,8 @@ public void _html_image() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_img() throws Exception { test("html", "img"); } @@ -28246,7 +28586,8 @@ public void _html_img() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_input() throws Exception { test("html", "input"); } @@ -28255,7 +28596,8 @@ public void _html_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_ins() throws Exception { test("html", "ins"); } @@ -28264,7 +28606,8 @@ public void _html_ins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_isindex() throws Exception { test("html", "isindex"); } @@ -28273,7 +28616,8 @@ public void _html_isindex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_kbd() throws Exception { test("html", "kbd"); } @@ -28282,7 +28626,8 @@ public void _html_kbd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_keygen() throws Exception { test("html", "keygen"); } @@ -28291,7 +28636,8 @@ public void _html_keygen() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_label() throws Exception { test("html", "label"); } @@ -28300,7 +28646,8 @@ public void _html_label() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_layer() throws Exception { test("html", "layer"); } @@ -28309,7 +28656,8 @@ public void _html_layer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_legend() throws Exception { test("html", "legend"); } @@ -28318,7 +28666,8 @@ public void _html_legend() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_li() throws Exception { test("html", "li"); } @@ -28327,7 +28676,8 @@ public void _html_li() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_link() throws Exception { test("html", "link"); } @@ -28336,7 +28686,8 @@ public void _html_link() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_listing() throws Exception { test("html", "listing"); } @@ -28345,7 +28696,8 @@ public void _html_listing() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_main() throws Exception { test("html", "main"); } @@ -28354,7 +28706,8 @@ public void _html_main() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_map() throws Exception { test("html", "map"); } @@ -28363,7 +28716,8 @@ public void _html_map() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_mark() throws Exception { test("html", "mark"); } @@ -28372,7 +28726,8 @@ public void _html_mark() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_marquee() throws Exception { test("html", "marquee"); } @@ -28381,7 +28736,8 @@ public void _html_marquee() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_menu() throws Exception { test("html", "menu"); } @@ -28390,7 +28746,8 @@ public void _html_menu() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_menuitem() throws Exception { test("html", "menuitem"); } @@ -28399,7 +28756,8 @@ public void _html_menuitem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_meta() throws Exception { test("html", "meta"); } @@ -28408,7 +28766,8 @@ public void _html_meta() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_meter() throws Exception { test("html", "meter"); } @@ -28417,7 +28776,8 @@ public void _html_meter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_multicol() throws Exception { test("html", "multicol"); } @@ -28426,7 +28786,8 @@ public void _html_multicol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_nav() throws Exception { test("html", "nav"); } @@ -28435,7 +28796,8 @@ public void _html_nav() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_nextid() throws Exception { test("html", "nextid"); } @@ -28444,7 +28806,8 @@ public void _html_nextid() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_nobr() throws Exception { test("html", "nobr"); } @@ -28453,7 +28816,8 @@ public void _html_nobr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_noembed() throws Exception { test("html", "noembed"); } @@ -28462,7 +28826,8 @@ public void _html_noembed() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_noframes() throws Exception { test("html", "noframes"); } @@ -28471,7 +28836,8 @@ public void _html_noframes() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_nolayer() throws Exception { test("html", "nolayer"); } @@ -28480,7 +28846,8 @@ public void _html_nolayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_noscript() throws Exception { test("html", "noscript"); } @@ -28489,7 +28856,8 @@ public void _html_noscript() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_object() throws Exception { test("html", "object"); } @@ -28498,7 +28866,8 @@ public void _html_object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_ol() throws Exception { test("html", "ol"); } @@ -28507,7 +28876,8 @@ public void _html_ol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_optgroup() throws Exception { test("html", "optgroup"); } @@ -28516,7 +28886,8 @@ public void _html_optgroup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_option() throws Exception { test("html", "option"); } @@ -28525,7 +28896,8 @@ public void _html_option() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_output() throws Exception { test("html", "output"); } @@ -28534,7 +28906,8 @@ public void _html_output() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_p() throws Exception { test("html", "p"); } @@ -28543,7 +28916,8 @@ public void _html_p() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_param() throws Exception { test("html", "param"); } @@ -28552,7 +28926,8 @@ public void _html_param() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_picture() throws Exception { test("html", "picture"); } @@ -28561,7 +28936,8 @@ public void _html_picture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_plaintext() throws Exception { test("html", "plaintext"); } @@ -28570,7 +28946,8 @@ public void _html_plaintext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_pre() throws Exception { test("html", "pre"); } @@ -28579,7 +28956,8 @@ public void _html_pre() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_progress() throws Exception { test("html", "progress"); } @@ -28588,7 +28966,8 @@ public void _html_progress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_q() throws Exception { test("html", "q"); } @@ -28597,7 +28976,8 @@ public void _html_q() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_rp() throws Exception { test("html", "rp"); } @@ -28606,7 +28986,8 @@ public void _html_rp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_rt() throws Exception { test("html", "rt"); } @@ -28615,7 +28996,8 @@ public void _html_rt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_ruby() throws Exception { test("html", "ruby"); } @@ -28624,7 +29006,8 @@ public void _html_ruby() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_s() throws Exception { test("html", "s"); } @@ -28633,7 +29016,8 @@ public void _html_s() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_samp() throws Exception { test("html", "samp"); } @@ -28642,8 +29026,8 @@ public void _html_samp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") - @NotYetImplemented(EDGE) + @Alerts("3") + @NotYetImplemented public void _html_script() throws Exception { test("html", "script"); } @@ -28652,7 +29036,8 @@ public void _html_script() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_section() throws Exception { test("html", "section"); } @@ -28661,7 +29046,8 @@ public void _html_section() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_select() throws Exception { test("html", "select"); } @@ -28670,7 +29056,18 @@ public void _html_select() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented + public void _html_slot() throws Exception { + test("html", "slot"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("3") + @NotYetImplemented public void _html_small() throws Exception { test("html", "small"); } @@ -28679,7 +29076,8 @@ public void _html_small() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_source() throws Exception { test("html", "source"); } @@ -28688,7 +29086,8 @@ public void _html_source() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_span() throws Exception { test("html", "span"); } @@ -28697,7 +29096,8 @@ public void _html_span() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_strike() throws Exception { test("html", "strike"); } @@ -28706,7 +29106,8 @@ public void _html_strike() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_strong() throws Exception { test("html", "strong"); } @@ -28715,7 +29116,8 @@ public void _html_strong() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_style() throws Exception { test("html", "style"); } @@ -28724,7 +29126,8 @@ public void _html_style() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_sub() throws Exception { test("html", "sub"); } @@ -28733,7 +29136,8 @@ public void _html_sub() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_summary() throws Exception { test("html", "summary"); } @@ -28742,7 +29146,8 @@ public void _html_summary() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_sup() throws Exception { test("html", "sup"); } @@ -28751,7 +29156,18 @@ public void _html_sup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented + public void _html_svg() throws Exception { + test("html", "svg"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("3") + @NotYetImplemented public void _html_table() throws Exception { test("html", "table"); } @@ -28760,7 +29176,8 @@ public void _html_table() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_tbody() throws Exception { test("html", "tbody"); } @@ -28769,7 +29186,8 @@ public void _html_tbody() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_td() throws Exception { test("html", "td"); } @@ -28778,7 +29196,8 @@ public void _html_td() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_template() throws Exception { test("html", "template"); } @@ -28787,7 +29206,8 @@ public void _html_template() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_textarea() throws Exception { test("html", "textarea"); } @@ -28796,7 +29216,8 @@ public void _html_textarea() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_tfoot() throws Exception { test("html", "tfoot"); } @@ -28805,7 +29226,8 @@ public void _html_tfoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_th() throws Exception { test("html", "th"); } @@ -28814,7 +29236,8 @@ public void _html_th() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_thead() throws Exception { test("html", "thead"); } @@ -28823,7 +29246,8 @@ public void _html_thead() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_time() throws Exception { test("html", "time"); } @@ -28832,7 +29256,8 @@ public void _html_time() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_title() throws Exception { test("html", "title"); } @@ -28841,7 +29266,8 @@ public void _html_title() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_tr() throws Exception { test("html", "tr"); } @@ -28850,7 +29276,8 @@ public void _html_tr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_track() throws Exception { test("html", "track"); } @@ -28859,7 +29286,8 @@ public void _html_track() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_tt() throws Exception { test("html", "tt"); } @@ -28868,7 +29296,8 @@ public void _html_tt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_u() throws Exception { test("html", "u"); } @@ -28877,7 +29306,8 @@ public void _html_u() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_ul() throws Exception { test("html", "ul"); } @@ -28886,7 +29316,8 @@ public void _html_ul() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_var() throws Exception { test("html", "var"); } @@ -28895,7 +29326,8 @@ public void _html_var() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_video() throws Exception { test("html", "video"); } @@ -28904,7 +29336,8 @@ public void _html_video() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_wbr() throws Exception { test("html", "wbr"); } @@ -28913,7 +29346,8 @@ public void _html_wbr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts("3") + @NotYetImplemented public void _html_xmp() throws Exception { test("html", "xmp"); } @@ -29022,9 +29456,9 @@ public void _i_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _i_isindex() throws Exception { test("i", "isindex"); } @@ -30087,7 +30521,6 @@ public void _image_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _image_script() throws Exception { test("image", "script"); } @@ -30110,6 +30543,15 @@ public void _image_select() throws Exception { test("image", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _image_slot() throws Exception { + test("image", "slot"); + } + /** * @throws Exception if the test fails */ @@ -30191,6 +30633,15 @@ public void _image_sup() throws Exception { test("image", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _image_svg() throws Exception { + test("image", "svg"); + } + /** * @throws Exception if the test fails */ @@ -31348,7 +31799,6 @@ public void _img_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _img_script() throws Exception { test("img", "script"); } @@ -31371,6 +31821,15 @@ public void _img_select() throws Exception { test("img", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _img_slot() throws Exception { + test("img", "slot"); + } + /** * @throws Exception if the test fails */ @@ -31452,6 +31911,15 @@ public void _img_sup() throws Exception { test("img", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _img_svg() throws Exception { + test("img", "svg"); + } + /** * @throws Exception if the test fails */ @@ -32609,7 +33077,6 @@ public void _input_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _input_script() throws Exception { test("input", "script"); } @@ -32632,6 +33099,15 @@ public void _input_select() throws Exception { test("input", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _input_slot() throws Exception { + test("input", "slot"); + } + /** * @throws Exception if the test fails */ @@ -32713,6 +33189,15 @@ public void _input_sup() throws Exception { test("input", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _input_svg() throws Exception { + test("input", "svg"); + } + /** * @throws Exception if the test fails */ @@ -32988,9 +33473,9 @@ public void _ins_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _ins_isindex() throws Exception { test("ins", "isindex"); } @@ -33071,9 +33556,9 @@ public void _ins_wbr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_a() throws Exception { test("isindex", "a"); } @@ -33082,9 +33567,9 @@ public void _isindex_a() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_abbr() throws Exception { test("isindex", "abbr"); } @@ -33093,9 +33578,9 @@ public void _isindex_abbr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_acronym() throws Exception { test("isindex", "acronym"); } @@ -33104,9 +33589,9 @@ public void _isindex_acronym() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_address() throws Exception { test("isindex", "address"); } @@ -33115,9 +33600,9 @@ public void _isindex_address() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_applet() throws Exception { test("isindex", "applet"); } @@ -33126,9 +33611,9 @@ public void _isindex_applet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_area() throws Exception { test("isindex", "area"); } @@ -33137,9 +33622,9 @@ public void _isindex_area() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_article() throws Exception { test("isindex", "article"); } @@ -33148,9 +33633,9 @@ public void _isindex_article() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_aside() throws Exception { test("isindex", "aside"); } @@ -33159,9 +33644,9 @@ public void _isindex_aside() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_audio() throws Exception { test("isindex", "audio"); } @@ -33170,9 +33655,9 @@ public void _isindex_audio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_b() throws Exception { test("isindex", "b"); } @@ -33181,9 +33666,9 @@ public void _isindex_b() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_base() throws Exception { test("isindex", "base"); } @@ -33192,9 +33677,9 @@ public void _isindex_base() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_basefont() throws Exception { test("isindex", "basefont"); } @@ -33203,9 +33688,9 @@ public void _isindex_basefont() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_bdi() throws Exception { test("isindex", "bdi"); } @@ -33214,9 +33699,9 @@ public void _isindex_bdi() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_bdo() throws Exception { test("isindex", "bdo"); } @@ -33225,9 +33710,9 @@ public void _isindex_bdo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_bgsound() throws Exception { test("isindex", "bgsound"); } @@ -33236,9 +33721,9 @@ public void _isindex_bgsound() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_big() throws Exception { test("isindex", "big"); } @@ -33247,9 +33732,9 @@ public void _isindex_big() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_blink() throws Exception { test("isindex", "blink"); } @@ -33258,9 +33743,9 @@ public void _isindex_blink() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_blockquote() throws Exception { test("isindex", "blockquote"); } @@ -33269,9 +33754,9 @@ public void _isindex_blockquote() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_body() throws Exception { test("isindex", "body"); } @@ -33280,9 +33765,9 @@ public void _isindex_body() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_br() throws Exception { test("isindex", "br"); } @@ -33291,9 +33776,9 @@ public void _isindex_br() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_button() throws Exception { test("isindex", "button"); } @@ -33302,9 +33787,9 @@ public void _isindex_button() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_canvas() throws Exception { test("isindex", "canvas"); } @@ -33313,9 +33798,9 @@ public void _isindex_canvas() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_caption() throws Exception { test("isindex", "caption"); } @@ -33324,9 +33809,9 @@ public void _isindex_caption() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_center() throws Exception { test("isindex", "center"); } @@ -33335,9 +33820,9 @@ public void _isindex_center() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_cite() throws Exception { test("isindex", "cite"); } @@ -33346,9 +33831,9 @@ public void _isindex_cite() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_code() throws Exception { test("isindex", "code"); } @@ -33357,9 +33842,9 @@ public void _isindex_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_col() throws Exception { test("isindex", "col"); } @@ -33368,9 +33853,9 @@ public void _isindex_col() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_colgroup() throws Exception { test("isindex", "colgroup"); } @@ -33380,8 +33865,9 @@ public void _isindex_colgroup() throws Exception { */ @Test @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + CHROME = "2", + FF = "1") + @NotYetImplemented(IE) public void _isindex_command() throws Exception { test("isindex", "command"); } @@ -33390,9 +33876,9 @@ public void _isindex_command() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_content() throws Exception { test("isindex", "content"); } @@ -33401,9 +33887,9 @@ public void _isindex_content() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_data() throws Exception { test("isindex", "data"); } @@ -33412,9 +33898,9 @@ public void _isindex_data() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_datalist() throws Exception { test("isindex", "datalist"); } @@ -33423,9 +33909,9 @@ public void _isindex_datalist() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_dd() throws Exception { test("isindex", "dd"); } @@ -33434,9 +33920,9 @@ public void _isindex_dd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_del() throws Exception { test("isindex", "del"); } @@ -33445,9 +33931,9 @@ public void _isindex_del() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_details() throws Exception { test("isindex", "details"); } @@ -33456,9 +33942,9 @@ public void _isindex_details() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_dfn() throws Exception { test("isindex", "dfn"); } @@ -33467,9 +33953,9 @@ public void _isindex_dfn() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_dialog() throws Exception { test("isindex", "dialog"); } @@ -33478,9 +33964,9 @@ public void _isindex_dialog() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_dir() throws Exception { test("isindex", "dir"); } @@ -33489,9 +33975,9 @@ public void _isindex_dir() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_div() throws Exception { test("isindex", "div"); } @@ -33500,9 +33986,9 @@ public void _isindex_div() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_dl() throws Exception { test("isindex", "dl"); } @@ -33511,9 +33997,9 @@ public void _isindex_dl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_dt() throws Exception { test("isindex", "dt"); } @@ -33522,9 +34008,9 @@ public void _isindex_dt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_em() throws Exception { test("isindex", "em"); } @@ -33533,9 +34019,9 @@ public void _isindex_em() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_embed() throws Exception { test("isindex", "embed"); } @@ -33544,9 +34030,9 @@ public void _isindex_embed() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_fieldset() throws Exception { test("isindex", "fieldset"); } @@ -33555,9 +34041,9 @@ public void _isindex_fieldset() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_figcaption() throws Exception { test("isindex", "figcaption"); } @@ -33566,9 +34052,9 @@ public void _isindex_figcaption() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_figure() throws Exception { test("isindex", "figure"); } @@ -33577,9 +34063,9 @@ public void _isindex_figure() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_font() throws Exception { test("isindex", "font"); } @@ -33588,9 +34074,9 @@ public void _isindex_font() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_footer() throws Exception { test("isindex", "footer"); } @@ -33599,9 +34085,9 @@ public void _isindex_footer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_form() throws Exception { test("isindex", "form"); } @@ -33610,9 +34096,9 @@ public void _isindex_form() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_frame() throws Exception { test("isindex", "frame"); } @@ -33621,9 +34107,9 @@ public void _isindex_frame() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_frameset() throws Exception { test("isindex", "frameset"); } @@ -33632,9 +34118,9 @@ public void _isindex_frameset() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_h1() throws Exception { test("isindex", "h1"); } @@ -33643,9 +34129,9 @@ public void _isindex_h1() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_h2() throws Exception { test("isindex", "h2"); } @@ -33654,9 +34140,9 @@ public void _isindex_h2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_h3() throws Exception { test("isindex", "h3"); } @@ -33665,9 +34151,9 @@ public void _isindex_h3() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_h4() throws Exception { test("isindex", "h4"); } @@ -33676,9 +34162,9 @@ public void _isindex_h4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_h5() throws Exception { test("isindex", "h5"); } @@ -33687,9 +34173,9 @@ public void _isindex_h5() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_h6() throws Exception { test("isindex", "h6"); } @@ -33698,9 +34184,9 @@ public void _isindex_h6() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_head() throws Exception { test("isindex", "head"); } @@ -33709,9 +34195,9 @@ public void _isindex_head() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_header() throws Exception { test("isindex", "header"); } @@ -33720,9 +34206,9 @@ public void _isindex_header() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_hr() throws Exception { test("isindex", "hr"); } @@ -33731,9 +34217,9 @@ public void _isindex_hr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_html() throws Exception { test("isindex", "html"); } @@ -33742,9 +34228,9 @@ public void _isindex_html() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_i() throws Exception { test("isindex", "i"); } @@ -33753,9 +34239,9 @@ public void _isindex_i() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_iframe() throws Exception { test("isindex", "iframe"); } @@ -33764,9 +34250,9 @@ public void _isindex_iframe() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_image() throws Exception { test("isindex", "image"); } @@ -33775,9 +34261,9 @@ public void _isindex_image() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_img() throws Exception { test("isindex", "img"); } @@ -33786,9 +34272,9 @@ public void _isindex_img() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_input() throws Exception { test("isindex", "input"); } @@ -33797,9 +34283,9 @@ public void _isindex_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_ins() throws Exception { test("isindex", "ins"); } @@ -33808,8 +34294,8 @@ public void _isindex_ins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") + @Alerts(DEFAULT = "1", + IE = "0") public void _isindex_isindex() throws Exception { test("isindex", "isindex"); } @@ -33818,9 +34304,9 @@ public void _isindex_isindex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_kbd() throws Exception { test("isindex", "kbd"); } @@ -33829,9 +34315,9 @@ public void _isindex_kbd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_keygen() throws Exception { test("isindex", "keygen"); } @@ -33840,9 +34326,9 @@ public void _isindex_keygen() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_label() throws Exception { test("isindex", "label"); } @@ -33851,9 +34337,9 @@ public void _isindex_label() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_layer() throws Exception { test("isindex", "layer"); } @@ -33862,9 +34348,9 @@ public void _isindex_layer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_legend() throws Exception { test("isindex", "legend"); } @@ -33873,9 +34359,9 @@ public void _isindex_legend() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_li() throws Exception { test("isindex", "li"); } @@ -33884,9 +34370,9 @@ public void _isindex_li() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_link() throws Exception { test("isindex", "link"); } @@ -33895,9 +34381,9 @@ public void _isindex_link() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_listing() throws Exception { test("isindex", "listing"); } @@ -33906,9 +34392,9 @@ public void _isindex_listing() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_main() throws Exception { test("isindex", "main"); } @@ -33917,9 +34403,9 @@ public void _isindex_main() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_map() throws Exception { test("isindex", "map"); } @@ -33928,9 +34414,9 @@ public void _isindex_map() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_mark() throws Exception { test("isindex", "mark"); } @@ -33939,9 +34425,9 @@ public void _isindex_mark() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_marquee() throws Exception { test("isindex", "marquee"); } @@ -33950,9 +34436,9 @@ public void _isindex_marquee() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_menu() throws Exception { test("isindex", "menu"); } @@ -33961,9 +34447,9 @@ public void _isindex_menu() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_menuitem() throws Exception { test("isindex", "menuitem"); } @@ -33972,9 +34458,9 @@ public void _isindex_menuitem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_meta() throws Exception { test("isindex", "meta"); } @@ -33983,9 +34469,9 @@ public void _isindex_meta() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_meter() throws Exception { test("isindex", "meter"); } @@ -33994,9 +34480,9 @@ public void _isindex_meter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_multicol() throws Exception { test("isindex", "multicol"); } @@ -34005,9 +34491,9 @@ public void _isindex_multicol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_nav() throws Exception { test("isindex", "nav"); } @@ -34016,9 +34502,9 @@ public void _isindex_nav() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_nextid() throws Exception { test("isindex", "nextid"); } @@ -34027,9 +34513,9 @@ public void _isindex_nextid() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_nobr() throws Exception { test("isindex", "nobr"); } @@ -34038,9 +34524,9 @@ public void _isindex_nobr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_noembed() throws Exception { test("isindex", "noembed"); } @@ -34049,9 +34535,9 @@ public void _isindex_noembed() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_noframes() throws Exception { test("isindex", "noframes"); } @@ -34060,9 +34546,9 @@ public void _isindex_noframes() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_nolayer() throws Exception { test("isindex", "nolayer"); } @@ -34071,9 +34557,9 @@ public void _isindex_nolayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_noscript() throws Exception { test("isindex", "noscript"); } @@ -34082,9 +34568,9 @@ public void _isindex_noscript() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_object() throws Exception { test("isindex", "object"); } @@ -34093,9 +34579,9 @@ public void _isindex_object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_ol() throws Exception { test("isindex", "ol"); } @@ -34104,9 +34590,9 @@ public void _isindex_ol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_optgroup() throws Exception { test("isindex", "optgroup"); } @@ -34115,9 +34601,9 @@ public void _isindex_optgroup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_option() throws Exception { test("isindex", "option"); } @@ -34126,9 +34612,9 @@ public void _isindex_option() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_output() throws Exception { test("isindex", "output"); } @@ -34137,9 +34623,9 @@ public void _isindex_output() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_p() throws Exception { test("isindex", "p"); } @@ -34148,9 +34634,9 @@ public void _isindex_p() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_param() throws Exception { test("isindex", "param"); } @@ -34159,9 +34645,9 @@ public void _isindex_param() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_picture() throws Exception { test("isindex", "picture"); } @@ -34170,9 +34656,9 @@ public void _isindex_picture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_plaintext() throws Exception { test("isindex", "plaintext"); } @@ -34181,9 +34667,9 @@ public void _isindex_plaintext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_pre() throws Exception { test("isindex", "pre"); } @@ -34192,9 +34678,9 @@ public void _isindex_pre() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_progress() throws Exception { test("isindex", "progress"); } @@ -34203,9 +34689,9 @@ public void _isindex_progress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_q() throws Exception { test("isindex", "q"); } @@ -34214,9 +34700,9 @@ public void _isindex_q() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_rp() throws Exception { test("isindex", "rp"); } @@ -34225,9 +34711,9 @@ public void _isindex_rp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_rt() throws Exception { test("isindex", "rt"); } @@ -34236,9 +34722,9 @@ public void _isindex_rt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_ruby() throws Exception { test("isindex", "ruby"); } @@ -34247,9 +34733,9 @@ public void _isindex_ruby() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_s() throws Exception { test("isindex", "s"); } @@ -34258,9 +34744,9 @@ public void _isindex_s() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_samp() throws Exception { test("isindex", "samp"); } @@ -34269,9 +34755,9 @@ public void _isindex_samp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_script() throws Exception { test("isindex", "script"); } @@ -34280,9 +34766,9 @@ public void _isindex_script() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_section() throws Exception { test("isindex", "section"); } @@ -34291,9 +34777,9 @@ public void _isindex_section() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_select() throws Exception { test("isindex", "select"); } @@ -34302,9 +34788,9 @@ public void _isindex_select() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_slot() throws Exception { test("isindex", "slot"); } @@ -34313,9 +34799,9 @@ public void _isindex_slot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_small() throws Exception { test("isindex", "small"); } @@ -34324,9 +34810,9 @@ public void _isindex_small() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_source() throws Exception { test("isindex", "source"); } @@ -34335,9 +34821,9 @@ public void _isindex_source() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_span() throws Exception { test("isindex", "span"); } @@ -34346,9 +34832,9 @@ public void _isindex_span() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_strike() throws Exception { test("isindex", "strike"); } @@ -34357,9 +34843,9 @@ public void _isindex_strike() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_strong() throws Exception { test("isindex", "strong"); } @@ -34368,9 +34854,9 @@ public void _isindex_strong() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_style() throws Exception { test("isindex", "style"); } @@ -34379,9 +34865,9 @@ public void _isindex_style() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_sub() throws Exception { test("isindex", "sub"); } @@ -34390,9 +34876,9 @@ public void _isindex_sub() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_summary() throws Exception { test("isindex", "summary"); } @@ -34401,9 +34887,9 @@ public void _isindex_summary() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_sup() throws Exception { test("isindex", "sup"); } @@ -34412,9 +34898,20 @@ public void _isindex_sup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) + public void _isindex_svg() throws Exception { + test("isindex", "svg"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_table() throws Exception { test("isindex", "table"); } @@ -34423,9 +34920,9 @@ public void _isindex_table() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_tbody() throws Exception { test("isindex", "tbody"); } @@ -34434,9 +34931,9 @@ public void _isindex_tbody() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_td() throws Exception { test("isindex", "td"); } @@ -34445,9 +34942,9 @@ public void _isindex_td() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_template() throws Exception { test("isindex", "template"); } @@ -34456,9 +34953,9 @@ public void _isindex_template() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_textarea() throws Exception { test("isindex", "textarea"); } @@ -34467,9 +34964,9 @@ public void _isindex_textarea() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_tfoot() throws Exception { test("isindex", "tfoot"); } @@ -34478,9 +34975,9 @@ public void _isindex_tfoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_th() throws Exception { test("isindex", "th"); } @@ -34489,9 +34986,9 @@ public void _isindex_th() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_thead() throws Exception { test("isindex", "thead"); } @@ -34500,9 +34997,9 @@ public void _isindex_thead() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_time() throws Exception { test("isindex", "time"); } @@ -34511,9 +35008,9 @@ public void _isindex_time() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_title() throws Exception { test("isindex", "title"); } @@ -34522,9 +35019,9 @@ public void _isindex_title() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_tr() throws Exception { test("isindex", "tr"); } @@ -34533,9 +35030,9 @@ public void _isindex_tr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_track() throws Exception { test("isindex", "track"); } @@ -34544,9 +35041,9 @@ public void _isindex_track() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_tt() throws Exception { test("isindex", "tt"); } @@ -34555,9 +35052,9 @@ public void _isindex_tt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_u() throws Exception { test("isindex", "u"); } @@ -34566,9 +35063,9 @@ public void _isindex_u() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_ul() throws Exception { test("isindex", "ul"); } @@ -34577,9 +35074,9 @@ public void _isindex_ul() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_var() throws Exception { test("isindex", "var"); } @@ -34588,9 +35085,9 @@ public void _isindex_var() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_video() throws Exception { test("isindex", "video"); } @@ -34599,9 +35096,9 @@ public void _isindex_video() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "2") - @NotYetImplemented({IE, FF, EDGE}) + @Alerts(DEFAULT = "2", + IE = "0") + @NotYetImplemented(IE) public void _isindex_wbr() throws Exception { test("isindex", "wbr"); } @@ -34610,9 +35107,9 @@ public void _isindex_wbr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE, EDGE}) + @Alerts(DEFAULT = "1", + IE = "0") + @NotYetImplemented(IE) public void _isindex_xmp() throws Exception { test("isindex", "xmp"); } @@ -34721,9 +35218,9 @@ public void _kbd_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _kbd_isindex() throws Exception { test("kbd", "isindex"); } @@ -35896,7 +36393,6 @@ public void _keygen_samp() throws Exception { @Test @Alerts(DEFAULT = "0", FF = "2") - @NotYetImplemented(EDGE) public void _keygen_script() throws Exception { test("keygen", "script"); } @@ -35921,6 +36417,16 @@ public void _keygen_select() throws Exception { test("keygen", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "0", + FF = "2") + public void _keygen_slot() throws Exception { + test("keygen", "slot"); + } + /** * @throws Exception if the test fails */ @@ -36011,6 +36517,16 @@ public void _keygen_sup() throws Exception { test("keygen", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "0", + FF = "2") + public void _keygen_svg() throws Exception { + test("keygen", "svg"); + } + /** * @throws Exception if the test fails */ @@ -36305,9 +36821,9 @@ public void _label_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _label_isindex() throws Exception { test("label", "isindex"); } @@ -36488,9 +37004,9 @@ public void _layer_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _layer_isindex() throws Exception { test("layer", "isindex"); } @@ -36671,9 +37187,9 @@ public void _legend_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _legend_isindex() throws Exception { test("legend", "isindex"); } @@ -36854,9 +37370,9 @@ public void _li_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _li_isindex() throws Exception { test("li", "isindex"); } @@ -37928,7 +38444,6 @@ public void _link_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _link_script() throws Exception { test("link", "script"); } @@ -37951,6 +38466,15 @@ public void _link_select() throws Exception { test("link", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _link_slot() throws Exception { + test("link", "slot"); + } + /** * @throws Exception if the test fails */ @@ -38032,6 +38556,15 @@ public void _link_sup() throws Exception { test("link", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _link_svg() throws Exception { + test("link", "svg"); + } + /** * @throws Exception if the test fails */ @@ -38307,9 +38840,9 @@ public void _listing_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _listing_isindex() throws Exception { test("listing", "isindex"); } @@ -38490,9 +39023,9 @@ public void _main_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _main_isindex() throws Exception { test("main", "isindex"); } @@ -38673,9 +39206,9 @@ public void _map_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _map_isindex() throws Exception { test("map", "isindex"); } @@ -38856,9 +39389,9 @@ public void _mark_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _mark_isindex() throws Exception { test("mark", "isindex"); } @@ -39039,9 +39572,9 @@ public void _marquee_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _marquee_isindex() throws Exception { test("marquee", "isindex"); } @@ -39222,9 +39755,9 @@ public void _menu_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _menu_isindex() throws Exception { test("menu", "isindex"); } @@ -39405,9 +39938,9 @@ public void _menuitem_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _menuitem_isindex() throws Exception { test("menuitem", "isindex"); } @@ -40470,7 +41003,6 @@ public void _meta_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _meta_script() throws Exception { test("meta", "script"); } @@ -40493,6 +41025,15 @@ public void _meta_select() throws Exception { test("meta", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _meta_slot() throws Exception { + test("meta", "slot"); + } + /** * @throws Exception if the test fails */ @@ -40574,6 +41115,15 @@ public void _meta_sup() throws Exception { test("meta", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _meta_svg() throws Exception { + test("meta", "svg"); + } + /** * @throws Exception if the test fails */ @@ -40849,9 +41399,9 @@ public void _meter_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _meter_isindex() throws Exception { test("meter", "isindex"); } @@ -41032,9 +41582,9 @@ public void _multicol_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _multicol_isindex() throws Exception { test("multicol", "isindex"); } @@ -41215,9 +41765,9 @@ public void _nav_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _nav_isindex() throws Exception { test("nav", "isindex"); } @@ -41398,9 +41948,9 @@ public void _nextid_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _nextid_isindex() throws Exception { test("nextid", "isindex"); } @@ -41581,9 +42131,9 @@ public void _nobr_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _nobr_isindex() throws Exception { test("nobr", "isindex"); } @@ -41963,9 +42513,9 @@ public void _nolayer_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _nolayer_isindex() throws Exception { test("nolayer", "isindex"); } @@ -42146,9 +42696,9 @@ public void _object_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _object_isindex() throws Exception { test("object", "isindex"); } @@ -42329,9 +42879,9 @@ public void _ol_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({IE, FF}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _ol_isindex() throws Exception { test("ol", "isindex"); } @@ -42512,9 +43062,9 @@ public void _optgroup_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _optgroup_isindex() throws Exception { test("optgroup", "isindex"); } @@ -42695,9 +43245,9 @@ public void _option_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _option_isindex() throws Exception { test("option", "isindex"); } @@ -42896,9 +43446,9 @@ public void _output_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _output_isindex() throws Exception { test("output", "isindex"); } @@ -43071,7 +43621,6 @@ public void _p_center() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _p_command() throws Exception { test("p", "command"); } @@ -43094,6 +43643,17 @@ public void _p_details() throws Exception { test("p", "details"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "1", + FF = "0") + @NotYetImplemented(FF) + public void _p_dialog() throws Exception { + test("p", "dialog"); + } + /** * @throws Exception if the test fails */ @@ -43287,9 +43847,8 @@ public void _p_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented(EDGE) + @Alerts(DEFAULT = "1", + IE = "0") public void _p_isindex() throws Exception { test("p", "isindex"); } @@ -43336,7 +43895,6 @@ public void _p_listing() throws Exception { @Test @Alerts(DEFAULT = "0", IE = "1") - @NotYetImplemented(EDGE) public void _p_main() throws Exception { test("p", "main"); } @@ -44471,7 +45029,6 @@ public void _param_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _param_script() throws Exception { test("param", "script"); } @@ -44494,6 +45051,15 @@ public void _param_select() throws Exception { test("param", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _param_slot() throws Exception { + test("param", "slot"); + } + /** * @throws Exception if the test fails */ @@ -44575,6 +45141,15 @@ public void _param_sup() throws Exception { test("param", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _param_svg() throws Exception { + test("param", "svg"); + } + /** * @throws Exception if the test fails */ @@ -44850,9 +45425,9 @@ public void _picture_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _picture_isindex() throws Exception { test("picture", "isindex"); } @@ -44980,7 +45555,6 @@ public void _pre_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _pre_command() throws Exception { test("pre", "command"); } @@ -45034,9 +45608,9 @@ public void _pre_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _pre_isindex() throws Exception { test("pre", "isindex"); } @@ -45164,7 +45738,6 @@ public void _progress_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _progress_command() throws Exception { test("progress", "command"); } @@ -45218,9 +45791,9 @@ public void _progress_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _progress_isindex() throws Exception { test("progress", "isindex"); } @@ -45348,7 +45921,6 @@ public void _q_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _q_command() throws Exception { test("q", "command"); } @@ -45402,9 +45974,9 @@ public void _q_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _q_isindex() throws Exception { test("q", "isindex"); } @@ -45532,7 +46104,6 @@ public void _rp_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _rp_command() throws Exception { test("rp", "command"); } @@ -45586,9 +46157,9 @@ public void _rp_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _rp_isindex() throws Exception { test("rp", "isindex"); } @@ -45726,7 +46297,6 @@ public void _rt_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _rt_command() throws Exception { test("rt", "command"); } @@ -45780,9 +46350,9 @@ public void _rt_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _rt_isindex() throws Exception { test("rt", "isindex"); } @@ -45910,7 +46480,6 @@ public void _ruby_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _ruby_command() throws Exception { test("ruby", "command"); } @@ -45964,9 +46533,9 @@ public void _ruby_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _ruby_isindex() throws Exception { test("ruby", "isindex"); } @@ -46094,7 +46663,6 @@ public void _s_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _s_command() throws Exception { test("s", "command"); } @@ -46148,9 +46716,9 @@ public void _s_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _s_isindex() throws Exception { test("s", "isindex"); } @@ -46278,7 +46846,6 @@ public void _samp_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _samp_command() throws Exception { test("samp", "command"); } @@ -46332,9 +46899,9 @@ public void _samp_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _samp_isindex() throws Exception { test("samp", "isindex"); } @@ -46416,7 +46983,6 @@ public void _samp_wbr() throws Exception { */ @Test @Alerts("1") - @NotYetImplemented(EDGE) public void _script_param() throws Exception { test("script", "param"); } @@ -46426,7 +46992,6 @@ public void _script_param() throws Exception { */ @Test @Alerts("1") - @NotYetImplemented(EDGE) public void _script_script() throws Exception { test("script", "script"); } @@ -46482,7 +47047,6 @@ public void _section_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _section_command() throws Exception { test("section", "command"); } @@ -46536,9 +47100,9 @@ public void _section_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _section_isindex() throws Exception { test("section", "isindex"); } @@ -46833,6 +47397,189 @@ public void _select_wbr() throws Exception { test("select", "wbr"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_area() throws Exception { + test("slot", "area"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_base() throws Exception { + test("slot", "base"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_basefont() throws Exception { + test("slot", "basefont"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_bgsound() throws Exception { + test("slot", "bgsound"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_br() throws Exception { + test("slot", "br"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "2", + FF = "1") + public void _slot_command() throws Exception { + test("slot", "command"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_embed() throws Exception { + test("slot", "embed"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_hr() throws Exception { + test("slot", "hr"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_image() throws Exception { + test("slot", "image"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_img() throws Exception { + test("slot", "img"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_input() throws Exception { + test("slot", "input"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) + public void _slot_isindex() throws Exception { + test("slot", "isindex"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_keygen() throws Exception { + test("slot", "keygen"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_link() throws Exception { + test("slot", "link"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_meta() throws Exception { + test("slot", "meta"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_param() throws Exception { + test("slot", "param"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_script() throws Exception { + test("slot", "script"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_source() throws Exception { + test("slot", "source"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_track() throws Exception { + test("slot", "track"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("2") + public void _slot_wbr() throws Exception { + test("slot", "wbr"); + } + /** * @throws Exception if the test fails */ @@ -46884,7 +47631,6 @@ public void _small_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _small_command() throws Exception { test("small", "command"); } @@ -46938,9 +47684,9 @@ public void _small_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _small_isindex() throws Exception { test("small", "isindex"); } @@ -48003,7 +48749,6 @@ public void _source_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _source_script() throws Exception { test("source", "script"); } @@ -48026,6 +48771,15 @@ public void _source_select() throws Exception { test("source", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _source_slot() throws Exception { + test("source", "slot"); + } + /** * @throws Exception if the test fails */ @@ -48107,6 +48861,15 @@ public void _source_sup() throws Exception { test("source", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _source_svg() throws Exception { + test("source", "svg"); + } + /** * @throws Exception if the test fails */ @@ -48329,7 +49092,6 @@ public void _span_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _span_command() throws Exception { test("span", "command"); } @@ -48383,9 +49145,9 @@ public void _span_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _span_isindex() throws Exception { test("span", "isindex"); } @@ -48513,7 +49275,6 @@ public void _strike_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _strike_command() throws Exception { test("strike", "command"); } @@ -48567,9 +49328,9 @@ public void _strike_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _strike_isindex() throws Exception { test("strike", "isindex"); } @@ -48697,7 +49458,6 @@ public void _strong_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _strong_command() throws Exception { test("strong", "command"); } @@ -48751,9 +49511,9 @@ public void _strong_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _strong_isindex() throws Exception { test("strong", "isindex"); } @@ -48881,7 +49641,6 @@ public void _sub_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _sub_command() throws Exception { test("sub", "command"); } @@ -48935,9 +49694,9 @@ public void _sub_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _sub_isindex() throws Exception { test("sub", "isindex"); } @@ -49065,7 +49824,6 @@ public void _summary_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _summary_command() throws Exception { test("summary", "command"); } @@ -49119,9 +49877,9 @@ public void _summary_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _summary_isindex() throws Exception { test("summary", "isindex"); } @@ -49249,7 +50007,6 @@ public void _sup_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _sup_command() throws Exception { test("sup", "command"); } @@ -49303,9 +50060,9 @@ public void _sup_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _sup_isindex() throws Exception { test("sup", "isindex"); } @@ -49382,6 +50139,406 @@ public void _sup_wbr() throws Exception { test("sup", "wbr"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_b() throws Exception { + test("svg", "b"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_big() throws Exception { + test("svg", "big"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_blockquote() throws Exception { + test("svg", "blockquote"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_body() throws Exception { + test("svg", "body"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_br() throws Exception { + test("svg", "br"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_center() throws Exception { + test("svg", "center"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_code() throws Exception { + test("svg", "code"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_dd() throws Exception { + test("svg", "dd"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_div() throws Exception { + test("svg", "div"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_dl() throws Exception { + test("svg", "dl"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_dt() throws Exception { + test("svg", "dt"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_em() throws Exception { + test("svg", "em"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_embed() throws Exception { + test("svg", "embed"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_h1() throws Exception { + test("svg", "h1"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_h2() throws Exception { + test("svg", "h2"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_h3() throws Exception { + test("svg", "h3"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_h4() throws Exception { + test("svg", "h4"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_h5() throws Exception { + test("svg", "h5"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_h6() throws Exception { + test("svg", "h6"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_head() throws Exception { + test("svg", "head"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_hr() throws Exception { + test("svg", "hr"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_i() throws Exception { + test("svg", "i"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_img() throws Exception { + test("svg", "img"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_li() throws Exception { + test("svg", "li"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_listing() throws Exception { + test("svg", "listing"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_menu() throws Exception { + test("svg", "menu"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_meta() throws Exception { + test("svg", "meta"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_nobr() throws Exception { + test("svg", "nobr"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_ol() throws Exception { + test("svg", "ol"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_p() throws Exception { + test("svg", "p"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_pre() throws Exception { + test("svg", "pre"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_ruby() throws Exception { + test("svg", "ruby"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_s() throws Exception { + test("svg", "s"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_small() throws Exception { + test("svg", "small"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_span() throws Exception { + test("svg", "span"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + @NotYetImplemented + public void _svg_strike() throws Exception { + test("svg", "strike"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + @NotYetImplemented + public void _svg_strong() throws Exception { + test("svg", "strong"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + @NotYetImplemented + public void _svg_sub() throws Exception { + test("svg", "sub"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + @NotYetImplemented + public void _svg_sup() throws Exception { + test("svg", "sup"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_table() throws Exception { + test("svg", "table"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_tt() throws Exception { + test("svg", "tt"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_u() throws Exception { + test("svg", "u"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_ul() throws Exception { + test("svg", "ul"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _svg_var() throws Exception { + test("svg", "var"); + } + /** * @throws Exception if the test fails */ @@ -49560,7 +50717,6 @@ public void _table_code() throws Exception { @Test @Alerts(DEFAULT = "1", FF = "0") - @NotYetImplemented(EDGE) public void _table_command() throws Exception { test("table", "command"); } @@ -49841,9 +50997,8 @@ public void _table_ins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "1", - CHROME = "0") - @NotYetImplemented({FF, EDGE}) + @Alerts(DEFAULT = "0", + IE = "1") public void _table_isindex() throws Exception { test("table", "isindex"); } @@ -50220,6 +51375,15 @@ public void _table_select() throws Exception { test("table", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _table_slot() throws Exception { + test("table", "slot"); + } + /** * @throws Exception if the test fails */ @@ -50293,6 +51457,15 @@ public void _table_sup() throws Exception { test("table", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _table_svg() throws Exception { + test("table", "svg"); + } + /** * @throws Exception if the test fails */ @@ -50308,7 +51481,7 @@ public void _table_table() throws Exception { @Test @Alerts(DEFAULT = "1", IE = "0") - @NotYetImplemented({CHROME, FF, EDGE}) + @NotYetImplemented({CHROME, FF}) public void _table_template() throws Exception { test("table", "template"); } @@ -51291,7 +52464,6 @@ public void _tbody_param() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _tbody_picture() throws Exception { test("tbody", "picture"); } @@ -51382,7 +52554,6 @@ public void _tbody_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _tbody_script() throws Exception { test("tbody", "script"); } @@ -51495,6 +52666,15 @@ public void _tbody_sup() throws Exception { test("tbody", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _tbody_svg() throws Exception { + test("tbody", "svg"); + } + /** * @throws Exception if the test fails */ @@ -52562,7 +53742,6 @@ public void _td_param() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _td_picture() throws Exception { test("td", "picture"); } @@ -52653,7 +53832,6 @@ public void _td_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _td_script() throws Exception { test("td", "script"); } @@ -52676,6 +53854,15 @@ public void _td_select() throws Exception { test("td", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _td_slot() throws Exception { + test("td", "slot"); + } + /** * @throws Exception if the test fails */ @@ -52757,6 +53944,15 @@ public void _td_sup() throws Exception { test("td", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _td_svg() throws Exception { + test("td", "svg"); + } + /** * @throws Exception if the test fails */ @@ -54024,8 +55220,7 @@ public void _template_samp() throws Exception { */ @Test @Alerts(DEFAULT = "0", - IE = "1") - @NotYetImplemented(IE) + IE = "2") public void _template_script() throws Exception { test("template", "script"); } @@ -54050,6 +55245,16 @@ public void _template_select() throws Exception { test("template", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "0", + IE = "1") + public void _template_slot() throws Exception { + test("template", "slot"); + } + /** * @throws Exception if the test fails */ @@ -54140,6 +55345,16 @@ public void _template_sup() throws Exception { test("template", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "0", + IE = "1") + public void _template_svg() throws Exception { + test("template", "svg"); + } + /** * @throws Exception if the test fails */ @@ -55227,7 +56442,6 @@ public void _tfoot_param() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _tfoot_picture() throws Exception { test("tfoot", "picture"); } @@ -55318,7 +56532,6 @@ public void _tfoot_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _tfoot_script() throws Exception { test("tfoot", "script"); } @@ -55341,6 +56554,15 @@ public void _tfoot_select() throws Exception { test("tfoot", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _tfoot_slot() throws Exception { + test("tfoot", "slot"); + } + /** * @throws Exception if the test fails */ @@ -55422,6 +56644,15 @@ public void _tfoot_sup() throws Exception { test("tfoot", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _tfoot_svg() throws Exception { + test("tfoot", "svg"); + } + /** * @throws Exception if the test fails */ @@ -56489,7 +57720,6 @@ public void _th_param() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _th_picture() throws Exception { test("th", "picture"); } @@ -56580,7 +57810,6 @@ public void _th_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _th_script() throws Exception { test("th", "script"); } @@ -56603,6 +57832,15 @@ public void _th_select() throws Exception { test("th", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _th_slot() throws Exception { + test("th", "slot"); + } + /** * @throws Exception if the test fails */ @@ -56684,6 +57922,15 @@ public void _th_sup() throws Exception { test("th", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _th_svg() throws Exception { + test("th", "svg"); + } + /** * @throws Exception if the test fails */ @@ -57751,7 +58998,6 @@ public void _thead_param() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _thead_picture() throws Exception { test("thead", "picture"); } @@ -57842,7 +59088,6 @@ public void _thead_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _thead_script() throws Exception { test("thead", "script"); } @@ -57865,6 +59110,15 @@ public void _thead_select() throws Exception { test("thead", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _thead_slot() throws Exception { + test("thead", "slot"); + } + /** * @throws Exception if the test fails */ @@ -57946,6 +59200,15 @@ public void _thead_sup() throws Exception { test("thead", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _thead_svg() throws Exception { + test("thead", "svg"); + } + /** * @throws Exception if the test fails */ @@ -58168,7 +59431,6 @@ public void _time_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _time_command() throws Exception { test("time", "command"); } @@ -58222,9 +59484,9 @@ public void _time_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _time_isindex() throws Exception { test("time", "isindex"); } @@ -59397,7 +60659,6 @@ public void _tr_param() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _tr_picture() throws Exception { test("tr", "picture"); } @@ -59488,7 +60749,6 @@ public void _tr_samp() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented(EDGE) public void _tr_script() throws Exception { test("tr", "script"); } @@ -59511,6 +60771,15 @@ public void _tr_select() throws Exception { test("tr", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _tr_slot() throws Exception { + test("tr", "slot"); + } + /** * @throws Exception if the test fails */ @@ -59592,6 +60861,15 @@ public void _tr_sup() throws Exception { test("tr", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("null") + public void _tr_svg() throws Exception { + test("tr", "svg"); + } + /** * @throws Exception if the test fails */ @@ -60749,7 +62027,6 @@ public void _track_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _track_script() throws Exception { test("track", "script"); } @@ -60772,6 +62049,15 @@ public void _track_select() throws Exception { test("track", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _track_slot() throws Exception { + test("track", "slot"); + } + /** * @throws Exception if the test fails */ @@ -60853,6 +62139,15 @@ public void _track_sup() throws Exception { test("track", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _track_svg() throws Exception { + test("track", "svg"); + } + /** * @throws Exception if the test fails */ @@ -61075,7 +62370,6 @@ public void _tt_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _tt_command() throws Exception { test("tt", "command"); } @@ -61129,9 +62423,9 @@ public void _tt_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _tt_isindex() throws Exception { test("tt", "isindex"); } @@ -61259,7 +62553,6 @@ public void _u_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _u_command() throws Exception { test("u", "command"); } @@ -61313,9 +62606,9 @@ public void _u_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _u_isindex() throws Exception { test("u", "isindex"); } @@ -61443,7 +62736,6 @@ public void _ul_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _ul_command() throws Exception { test("ul", "command"); } @@ -61497,9 +62789,9 @@ public void _ul_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _ul_isindex() throws Exception { test("ul", "isindex"); } @@ -61627,7 +62919,6 @@ public void _var_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _var_command() throws Exception { test("var", "command"); } @@ -61681,9 +62972,9 @@ public void _var_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _var_isindex() throws Exception { test("var", "isindex"); } @@ -61811,7 +63102,6 @@ public void _video_br() throws Exception { @Test @Alerts(DEFAULT = "2", FF = "1") - @NotYetImplemented(EDGE) public void _video_command() throws Exception { test("video", "command"); } @@ -61865,9 +63155,9 @@ public void _video_input() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) + @Alerts(DEFAULT = "1", + IE = "2") + @NotYetImplemented(IE) public void _video_isindex() throws Exception { test("video", "isindex"); } @@ -62930,7 +64220,6 @@ public void _wbr_samp() throws Exception { */ @Test @Alerts("0") - @NotYetImplemented(EDGE) public void _wbr_script() throws Exception { test("wbr", "script"); } @@ -62953,6 +64242,15 @@ public void _wbr_select() throws Exception { test("wbr", "select"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _wbr_slot() throws Exception { + test("wbr", "slot"); + } + /** * @throws Exception if the test fails */ @@ -63034,6 +64332,15 @@ public void _wbr_sup() throws Exception { test("wbr", "sup"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("0") + public void _wbr_svg() throws Exception { + test("wbr", "svg"); + } + /** * @throws Exception if the test fails */ @@ -63206,1205 +64513,13 @@ public void _wbr_xmp() throws Exception { } /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _area_slot() throws Exception { - test("area", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _base_slot() throws Exception { - test("base", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _basefont_slot() throws Exception { - test("basefont", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _bgsound_slot() throws Exception { - test("bgsound", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _body_slot() throws Exception { - test("body", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _br_slot() throws Exception { - test("br", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _caption_slot() throws Exception { - test("caption", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _col_slot() throws Exception { - test("col", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _colgroup_slot() throws Exception { - test("colgroup", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - FF = "1") - public void _command_slot() throws Exception { - test("command", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _embed_slot() throws Exception { - test("embed", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _frame_slot() throws Exception { - test("frame", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _frameset_slot() throws Exception { - test("frameset", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _head_slot() throws Exception { - test("head", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _hr_slot() throws Exception { - test("hr", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _html_slot() throws Exception { - test("html", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _image_slot() throws Exception { - test("image", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _img_slot() throws Exception { - test("img", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _input_slot() throws Exception { - test("input", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - FF = "2") - public void _keygen_slot() throws Exception { - test("keygen", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _link_slot() throws Exception { - test("link", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _meta_slot() throws Exception { - test("meta", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _param_slot() throws Exception { - test("param", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _source_slot() throws Exception { - test("source", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _table_slot() throws Exception { - test("table", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _td_slot() throws Exception { - test("td", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - IE = "1") - public void _template_slot() throws Exception { - test("template", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _tfoot_slot() throws Exception { - test("tfoot", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _th_slot() throws Exception { - test("th", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _thead_slot() throws Exception { - test("thead", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _tr_slot() throws Exception { - test("tr", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _track_slot() throws Exception { - test("track", "slot"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _wbr_slot() throws Exception { - test("wbr", "slot"); - } - - /** - * @throws Exception if the test fails + * The default test. + * @throws Exception if an error occurs */ @Test - @Alerts("2") - public void _slot_area() throws Exception { - test("slot", "area"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_base() throws Exception { - test("slot", "base"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_basefont() throws Exception { - test("slot", "basefont"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_bgsound() throws Exception { - test("slot", "bgsound"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_br() throws Exception { - test("slot", "br"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "2", - FF = "1") - public void _slot_command() throws Exception { - test("slot", "command"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_embed() throws Exception { - test("slot", "embed"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_hr() throws Exception { - test("slot", "hr"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_image() throws Exception { - test("slot", "image"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_img() throws Exception { - test("slot", "img"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_input() throws Exception { - test("slot", "input"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "2", - CHROME = "1") - @NotYetImplemented({FF, IE}) - public void _slot_isindex() throws Exception { - test("slot", "isindex"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_keygen() throws Exception { - test("slot", "keygen"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_link() throws Exception { - test("slot", "link"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_meta() throws Exception { - test("slot", "meta"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_param() throws Exception { - test("slot", "param"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_script() throws Exception { - test("slot", "script"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_source() throws Exception { - test("slot", "source"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_track() throws Exception { - test("slot", "track"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _slot_wbr() throws Exception { - test("slot", "wbr"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _area_svg() throws Exception { - test("area", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _base_svg() throws Exception { - test("base", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _basefont_svg() throws Exception { - test("basefont", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _bgsound_svg() throws Exception { - test("bgsound", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _body_svg() throws Exception { - test("body", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _br_svg() throws Exception { - test("br", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _caption_svg() throws Exception { - test("caption", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _col_svg() throws Exception { - test("col", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _colgroup_svg() throws Exception { - test("colgroup", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - FF = "1") - public void _command_svg() throws Exception { - test("command", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _embed_svg() throws Exception { - test("embed", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _frame_svg() throws Exception { - test("frame", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _frameset_svg() throws Exception { - test("frameset", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _head_svg() throws Exception { - test("head", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _hr_svg() throws Exception { - test("hr", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("2") - public void _html_svg() throws Exception { - test("html", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _image_svg() throws Exception { - test("image", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _img_svg() throws Exception { - test("img", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _input_svg() throws Exception { - test("input", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - CHROME = "1") - @NotYetImplemented({FF, IE}) - public void _isindex_svg() throws Exception { - test("isindex", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - FF = "2") - public void _keygen_svg() throws Exception { - test("keygen", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _link_svg() throws Exception { - test("link", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _meta_svg() throws Exception { - test("meta", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _param_svg() throws Exception { - test("param", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _source_svg() throws Exception { - test("source", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_b() throws Exception { - test("svg", "b"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_big() throws Exception { - test("svg", "big"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_blockquote() throws Exception { - test("svg", "blockquote"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_body() throws Exception { - test("svg", "body"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_br() throws Exception { - test("svg", "br"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_center() throws Exception { - test("svg", "center"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_code() throws Exception { - test("svg", "code"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_dd() throws Exception { - test("svg", "dd"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_div() throws Exception { - test("svg", "div"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_dl() throws Exception { - test("svg", "dl"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_dt() throws Exception { - test("svg", "dt"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_em() throws Exception { - test("svg", "em"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_embed() throws Exception { - test("svg", "embed"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_h1() throws Exception { - test("svg", "h1"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_h2() throws Exception { - test("svg", "h2"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_h3() throws Exception { - test("svg", "h3"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_h4() throws Exception { - test("svg", "h4"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_h5() throws Exception { - test("svg", "h5"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_h6() throws Exception { - test("svg", "h6"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_head() throws Exception { - test("svg", "head"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_hr() throws Exception { - test("svg", "hr"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_i() throws Exception { - test("svg", "i"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_img() throws Exception { - test("svg", "img"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_li() throws Exception { - test("svg", "li"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_listing() throws Exception { - test("svg", "listing"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_menu() throws Exception { - test("svg", "menu"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_meta() throws Exception { - test("svg", "meta"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_nobr() throws Exception { - test("svg", "nobr"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_ol() throws Exception { - test("svg", "ol"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_p() throws Exception { - test("svg", "p"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_pre() throws Exception { - test("svg", "pre"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_ruby() throws Exception { - test("svg", "ruby"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_s() throws Exception { - test("svg", "s"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_small() throws Exception { - test("svg", "small"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_span() throws Exception { - test("svg", "span"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - @NotYetImplemented - public void _svg_strike() throws Exception { - test("svg", "strike"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - @NotYetImplemented - public void _svg_strong() throws Exception { - test("svg", "strong"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - @NotYetImplemented - public void _svg_sub() throws Exception { - test("svg", "sub"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - @NotYetImplemented - public void _svg_sup() throws Exception { - test("svg", "sup"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_table() throws Exception { - test("svg", "table"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_tt() throws Exception { - test("svg", "tt"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_u() throws Exception { - test("svg", "u"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_ul() throws Exception { - test("svg", "ul"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _svg_var() throws Exception { - test("svg", "var"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _table_svg() throws Exception { - test("table", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _tbody_svg() throws Exception { - test("tbody", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _td_svg() throws Exception { - test("td", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "0", - IE = "1") - public void _template_svg() throws Exception { - test("template", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _tfoot_svg() throws Exception { - test("tfoot", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _th_svg() throws Exception { - test("th", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _thead_svg() throws Exception { - test("thead", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("null") - public void _tr_svg() throws Exception { - test("tr", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _track_svg() throws Exception { - test("track", "svg"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("0") - public void _wbr_svg() throws Exception { - test("wbr", "svg"); + @Alerts("1") + @Default + public void closes() throws Exception { + test(parent_, child_); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java index a104c81d047..f8c21254ca1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,13 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Set; import java.util.function.Predicate; +import org.junit.After; import org.junit.Test; import org.junit.runners.Parameterized.Parameter; +import org.openqa.selenium.WebDriver; import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner.Default; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; @@ -32,9 +35,12 @@ * Tests two Host classes, if one prototype is parent of another. * * @author Ahmed Ashour + * @author Ronald Brill */ public abstract class HostParentOf extends WebDriverTestCase { + private static int ServerRestartCount_ = 0; + /** * Returns the parameterized data. * @param predicate the predicate, which determines whether or not to include the parent @@ -43,7 +49,7 @@ public abstract class HostParentOf extends WebDriverTestCase { */ protected static Collection data(final Predicate predicate) throws Exception { final List list = new ArrayList<>(); - final List strings = TestCaseTest.getAllClassNames(); + final Set strings = TestCaseTest.getAllClassNames(); for (final String parent : strings) { if (predicate.test(parent)) { for (final String child : strings) { @@ -86,11 +92,14 @@ public void isParentOf() throws Exception { */ protected void test(final String parent, final String child) throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "" + (getBrowserVersion().isIE() ? "Blank Page" : "New Tab") + "\n" + ""; - loadPageWithAlerts2(html); + ServerRestartCount_++; + if (ServerRestartCount_ == 200) { + stopWebServers(); + ServerRestartCount_ = 0; + } + final WebDriver driver = loadPage2(html); + assertTitle(driver, getExpectedAlerts()[0]); } /** @@ -114,4 +129,12 @@ protected boolean isWebClientCached() { return true; } + /** + * Cleanup. + */ + @After + public void after() { + parent_ = null; + child_ = null; + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java index 2340fcbb6ee..219c87d623c 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfATest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package com.gargoylesoftware.htmlunit.general.huge; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import java.util.Collection; @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'A'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfATest extends HostParentOf { @@ -84,8 +85,8 @@ public void _ANGLE_instanced_arrays_ANGLE_instanced_arrays() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _Animation_Animation() throws Exception { test("Animation", "Animation"); } @@ -99,25 +100,6 @@ public void _AnimationEvent_AnimationEvent() throws Exception { test("AnimationEvent", "AnimationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _AnimationEvent_WebKitAnimationEvent() throws Exception { - test("AnimationEvent", "WebKitAnimationEvent"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _AppBannerPromptResult_AppBannerPromptResult() throws Exception { - test("AppBannerPromptResult", "AppBannerPromptResult"); - } - /** * @throws Exception if the test fails */ @@ -179,10 +161,9 @@ public void _Audio_Audio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - FF52 = "true") - @NotYetImplemented({CHROME, FF52}) + @Alerts(DEFAULT = "true", + IE = "false") + @NotYetImplemented({CHROME, FF}) public void _Audio_HTMLAudioElement() throws Exception { test("Audio", "HTMLAudioElement"); } @@ -221,9 +202,7 @@ public void _AudioContext_AudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF = "true") - @NotYetImplemented(CHROME) + @Alerts("false") public void _AudioContext_OfflineAudioContext() throws Exception { test("AudioContext", "OfflineAudioContext"); } @@ -293,7 +272,8 @@ public void _AudioNode_AudioNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _AudioNode_AudioScheduledSourceNode() throws Exception { test("AudioNode", "AudioScheduledSourceNode"); } @@ -332,10 +312,8 @@ public void _AudioNode_ChannelSplitterNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") - @NotYetImplemented(FF52) + @Alerts(DEFAULT = "true", + IE = "false") public void _AudioNode_ConstantSourceNode() throws Exception { test("AudioNode", "ConstantSourceNode"); } @@ -384,9 +362,8 @@ public void _AudioNode_GainNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _AudioNode_IIRFilterNode() throws Exception { test("AudioNode", "IIRFilterNode"); } @@ -496,8 +473,8 @@ public void _AudioProcessingEvent_AudioProcessingEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") - @NotYetImplemented(CHROME) + CHROME = "true", + FF = "true") public void _AudioScheduledSourceNode_AudioBufferSourceNode() throws Exception { test("AudioScheduledSourceNode", "AudioBufferSourceNode"); } @@ -507,7 +484,8 @@ public void _AudioScheduledSourceNode_AudioBufferSourceNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _AudioScheduledSourceNode_AudioScheduledSourceNode() throws Exception { test("AudioScheduledSourceNode", "AudioScheduledSourceNode"); } @@ -517,7 +495,8 @@ public void _AudioScheduledSourceNode_AudioScheduledSourceNode() throws Exceptio */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _AudioScheduledSourceNode_ConstantSourceNode() throws Exception { test("AudioScheduledSourceNode", "ConstantSourceNode"); } @@ -527,8 +506,8 @@ public void _AudioScheduledSourceNode_ConstantSourceNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") - @NotYetImplemented(CHROME) + CHROME = "true", + FF = "true") public void _AudioScheduledSourceNode_OscillatorNode() throws Exception { test("AudioScheduledSourceNode", "OscillatorNode"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java index 26f2dc2dce1..18aadda0d24 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfBTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ * This class handles all host names which starts by character 'B'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfBTest extends HostParentOf { @@ -61,7 +62,8 @@ public void _BarProp_BarProp() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _BaseAudioContext_AudioContext() throws Exception { test("BaseAudioContext", "AudioContext"); } @@ -71,7 +73,8 @@ public void _BaseAudioContext_AudioContext() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _BaseAudioContext_BaseAudioContext() throws Exception { test("BaseAudioContext", "BaseAudioContext"); } @@ -81,7 +84,8 @@ public void _BaseAudioContext_BaseAudioContext() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _BaseAudioContext_OfflineAudioContext() throws Exception { test("BaseAudioContext", "OfflineAudioContext"); } @@ -162,14 +166,4 @@ public void _BlobEvent_BlobEvent() throws Exception { public void _BroadcastChannel_BroadcastChannel() throws Exception { test("BroadcastChannel", "BroadcastChannel"); } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _BudgetService_BudgetService() throws Exception { - test("BudgetService", "BudgetService"); - } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java index 7857ca06ff6..2e37276d803 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfCTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ * This class handles all host names which starts by character 'C'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfCTest extends HostParentOf { @@ -271,9 +272,8 @@ public void _Console_Console() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _ConstantSourceNode_ConstantSourceNode() throws Exception { test("ConstantSourceNode", "ConstantSourceNode"); } @@ -303,7 +303,8 @@ public void _Coordinates_Coordinates() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _Credential_Credential() throws Exception { test("Credential", "Credential"); } @@ -333,7 +334,8 @@ public void _Credential_PasswordCredential() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _CredentialsContainer_CredentialsContainer() throws Exception { test("CredentialsContainer", "CredentialsContainer"); } @@ -480,8 +482,7 @@ public void _CSSImportRule_CSSImportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF45 = "false") + @Alerts("true") public void _CSSKeyframeRule_CSSKeyframeRule() throws Exception { test("CSSKeyframeRule", "CSSKeyframeRule"); } @@ -490,8 +491,7 @@ public void _CSSKeyframeRule_CSSKeyframeRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF45 = "false") + @Alerts("true") public void _CSSKeyframesRule_CSSKeyframesRule() throws Exception { test("CSSKeyframesRule", "CSSKeyframesRule"); } @@ -509,8 +509,7 @@ public void _CSSMediaRule_CSSMediaRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _CSSNamespaceRule_CSSNamespaceRule() throws Exception { test("CSSNamespaceRule", "CSSNamespaceRule"); } @@ -529,7 +528,7 @@ public void _CSSPageRule_CSSPageRule() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _CSSPrimitiveValue_CSSPrimitiveValue() throws Exception { test("CSSPrimitiveValue", "CSSPrimitiveValue"); } @@ -586,8 +585,7 @@ public void _CSSRule_CSSImportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF45 = "false") + @Alerts("true") public void _CSSRule_CSSKeyframeRule() throws Exception { test("CSSRule", "CSSKeyframeRule"); } @@ -596,8 +594,7 @@ public void _CSSRule_CSSKeyframeRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF45 = "false") + @Alerts("true") public void _CSSRule_CSSKeyframesRule() throws Exception { test("CSSRule", "CSSKeyframesRule"); } @@ -615,8 +612,7 @@ public void _CSSRule_CSSMediaRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _CSSRule_CSSNamespaceRule() throws Exception { test("CSSRule", "CSSNamespaceRule"); } @@ -658,25 +654,6 @@ public void _CSSRule_CSSSupportsRule() throws Exception { test("CSSRule", "CSSSupportsRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSRule_CSSViewportRule() throws Exception { - test("CSSRule", "CSSViewportRule"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _CSSRule_MozCSSKeyframesRule() throws Exception { - test("CSSRule", "MozCSSKeyframesRule"); - } - /** * @throws Exception if the test fails */ @@ -738,7 +715,7 @@ public void _CSSSupportsRule_CSSSupportsRule() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _CSSValue_CSSPrimitiveValue() throws Exception { test("CSSValue", "CSSPrimitiveValue"); } @@ -748,7 +725,7 @@ public void _CSSValue_CSSPrimitiveValue() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _CSSValue_CSSValue() throws Exception { test("CSSValue", "CSSValue"); } @@ -758,7 +735,7 @@ public void _CSSValue_CSSValue() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _CSSValue_CSSValueList() throws Exception { test("CSSValue", "CSSValueList"); } @@ -768,26 +745,18 @@ public void _CSSValue_CSSValueList() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _CSSValueList_CSSValueList() throws Exception { test("CSSValueList", "CSSValueList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSViewportRule_CSSViewportRule() throws Exception { - test("CSSViewportRule", "CSSViewportRule"); - } - /** * @throws Exception if the test fails */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _CustomElementRegistry_CustomElementRegistry() throws Exception { test("CustomElementRegistry", "CustomElementRegistry"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java index f13d19827eb..b759bd28881 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfDTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,7 @@ package com.gargoylesoftware.htmlunit.general.huge; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF45; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF52; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import java.util.Collection; @@ -66,8 +65,7 @@ public void _DataTransfer_DataTransfer() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _DataTransferItem_DataTransferItem() throws Exception { test("DataTransferItem", "DataTransferItem"); } @@ -77,8 +75,7 @@ public void _DataTransferItem_DataTransferItem() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _DataTransferItemList_DataTransferItemList() throws Exception { test("DataTransferItemList", "DataTransferItemList"); } @@ -107,7 +104,7 @@ public void _DelayNode_DelayNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _DeviceLightEvent_DeviceLightEvent() throws Exception { test("DeviceLightEvent", "DeviceLightEvent"); } @@ -137,7 +134,7 @@ public void _DeviceOrientationEvent_DeviceOrientationEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _DeviceProximityEvent_DeviceProximityEvent() throws Exception { test("DeviceProximityEvent", "DeviceProximityEvent"); } @@ -160,16 +157,6 @@ public void _Document_HTMLDocument() throws Exception { test("Document", "HTMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _Document_SVGDocument() throws Exception { - test("Document", "SVGDocument"); - } - /** * @throws Exception if the test fails */ @@ -193,7 +180,8 @@ public void _DocumentFragment_DocumentFragment() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _DocumentFragment_ShadowRoot() throws Exception { test("DocumentFragment", "ShadowRoot"); } @@ -212,7 +200,7 @@ public void _DocumentType_DocumentType() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _DOMCursor_DOMCursor() throws Exception { test("DOMCursor", "DOMCursor"); } @@ -258,10 +246,8 @@ public void _DOMMatrix_DOMMatrix() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - FF52 = "true") - @NotYetImplemented({CHROME, FF52}) + @Alerts(DEFAULT = "true", + IE = "false") public void _DOMMatrix_WebKitCSSMatrix() throws Exception { test("DOMMatrix", "WebKitCSSMatrix"); } @@ -290,10 +276,8 @@ public void _DOMMatrixReadOnly_DOMMatrixReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - FF52 = "true") - @NotYetImplemented({CHROME, FF52}) + @Alerts(DEFAULT = "true", + IE = "false") public void _DOMMatrixReadOnly_WebKitCSSMatrix() throws Exception { test("DOMMatrixReadOnly", "WebKitCSSMatrix"); } @@ -343,19 +327,39 @@ public void _DOMPointReadOnly_DOMPointReadOnly() throws Exception { @Test @Alerts(DEFAULT = "true", IE = "false") - public void _DOMRectReadOnly_DOMRectReadOnly() throws Exception { - test("DOMRectReadOnly", "DOMRectReadOnly"); + public void _DOMRect_DOMRect() throws Exception { + test("DOMRect", "DOMRect"); } /** * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - @NotYetImplemented(FF45) - public void _DOMRequest_DOMCursor() throws Exception { - test("DOMRequest", "DOMCursor"); + @Alerts(DEFAULT = "true", + IE = "false") + public void _DOMRectList_DOMRectList() throws Exception { + test("DOMRectList", "DOMRectList"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + @NotYetImplemented({CHROME, FF}) + public void _DOMRectReadOnly_DOMRect() throws Exception { + test("DOMRectReadOnly", "DOMRect"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _DOMRectReadOnly_DOMRectReadOnly() throws Exception { + test("DOMRectReadOnly", "DOMRectReadOnly"); } /** @@ -372,9 +376,8 @@ public void _DOMRequest_DOMRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - CHROME = "false", - FF52 = "false") + @Alerts(DEFAULT = "false", + IE = "true") public void _DOMSettableTokenList_DOMSettableTokenList() throws Exception { test("DOMSettableTokenList", "DOMSettableTokenList"); } @@ -402,9 +405,8 @@ public void _DOMStringMap_DOMStringMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - CHROME = "false", - FF52 = "false") + @Alerts(DEFAULT = "false", + IE = "true") public void _DOMTokenList_DOMSettableTokenList() throws Exception { test("DOMTokenList", "DOMSettableTokenList"); } @@ -469,7 +471,8 @@ public void _Element_HTMLAnchorElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _Element_HTMLAppletElement() throws Exception { test("Element", "HTMLAppletElement"); } @@ -571,9 +574,8 @@ public void _Element_HTMLCanvasElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _Element_HTMLContentElement() throws Exception { test("Element", "HTMLContentElement"); } @@ -612,8 +614,7 @@ public void _Element_HTMLDDElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _Element_HTMLDetailsElement() throws Exception { test("Element", "HTMLDetailsElement"); } @@ -851,7 +852,7 @@ public void _Element_HTMLMapElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - FF = "false") + FF60 = "false") public void _Element_HTMLMarqueeElement() throws Exception { test("Element", "HTMLMarqueeElement"); } @@ -1055,9 +1056,8 @@ public void _Element_HTMLSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _Element_HTMLShadowElement() throws Exception { test("Element", "HTMLShadowElement"); } @@ -1067,7 +1067,8 @@ public void _Element_HTMLShadowElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _Element_HTMLSlotElement() throws Exception { test("Element", "HTMLSlotElement"); } @@ -1274,16 +1275,6 @@ public void _Element_SVGAElement() throws Exception { test("Element", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _Element_SVGAltGlyphElement() throws Exception { - test("Element", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -1656,7 +1647,8 @@ public void _Element_SVGGElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _Element_SVGGeometryElement() throws Exception { test("Element", "SVGGeometryElement"); } @@ -1949,9 +1941,8 @@ public void _Enumerator_Enumerator() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") - @NotYetImplemented({CHROME, FF52}) + IE = "false") + @NotYetImplemented({CHROME, FF}) public void _Error_DOMException() throws Exception { test("Error", "DOMException"); } @@ -2074,7 +2065,7 @@ public void _Event_CustomEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _Event_DeviceLightEvent() throws Exception { test("Event", "DeviceLightEvent"); } @@ -2104,7 +2095,7 @@ public void _Event_DeviceOrientationEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _Event_DeviceProximityEvent() throws Exception { test("Event", "DeviceProximityEvent"); } @@ -2228,7 +2219,8 @@ public void _Event_MediaKeyMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _Event_MediaQueryListEvent() throws Exception { test("Event", "MediaQueryListEvent"); } @@ -2311,26 +2303,6 @@ public void _Event_MouseWheelEvent() throws Exception { test("Event", "MouseWheelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _Event_MozContactChangeEvent() throws Exception { - test("Event", "MozContactChangeEvent"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _Event_MozSettingsEvent() throws Exception { - test("Event", "MozSettingsEvent"); - } - /** * @throws Exception if the test fails */ @@ -2373,8 +2345,7 @@ public void _Event_PageTransitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _Event_PointerEvent() throws Exception { test("Event", "PointerEvent"); } @@ -2452,7 +2423,8 @@ public void _Event_RTCPeerConnectionIceEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _Event_SecurityPolicyViolationEvent() throws Exception { test("Event", "SecurityPolicyViolationEvent"); } @@ -2462,8 +2434,7 @@ public void _Event_SecurityPolicyViolationEvent() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _Event_SpeechSynthesisEvent() throws Exception { test("Event", "SpeechSynthesisEvent"); } @@ -2482,7 +2453,8 @@ public void _Event_StorageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _Event_SVGZoomEvent() throws Exception { test("Event", "SVGZoomEvent"); } @@ -2549,7 +2521,7 @@ public void _Event_UIEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _Event_UserProximityEvent() throws Exception { test("Event", "UserProximityEvent"); } @@ -2558,22 +2530,11 @@ public void _Event_UserProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF45 = "false") + @Alerts("true") public void _Event_WebGLContextEvent() throws Exception { test("Event", "WebGLContextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Event_WebKitAnimationEvent() throws Exception { - test("Event", "WebKitAnimationEvent"); - } - /** * @throws Exception if the test fails */ @@ -2594,16 +2555,6 @@ public void _Event_webkitSpeechRecognitionEvent() throws Exception { test("Event", "webkitSpeechRecognitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Event_WebKitTransitionEvent() throws Exception { - test("Event", "WebKitTransitionEvent"); - } - /** * @throws Exception if the test fails */ @@ -2633,6 +2584,16 @@ public void _EventTarget_AnalyserNode() throws Exception { test("EventTarget", "AnalyserNode"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _EventTarget_Animation() throws Exception { + test("EventTarget", "Animation"); + } + /** * @throws Exception if the test fails */ @@ -2708,7 +2669,8 @@ public void _EventTarget_AudioNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _EventTarget_AudioScheduledSourceNode() throws Exception { test("EventTarget", "AudioScheduledSourceNode"); } @@ -2718,7 +2680,8 @@ public void _EventTarget_AudioScheduledSourceNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _EventTarget_BaseAudioContext() throws Exception { test("EventTarget", "BaseAudioContext"); } @@ -2828,9 +2791,7 @@ public void _EventTarget_Comment() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") - @NotYetImplemented(FF52) + IE = "false") public void _EventTarget_ConstantSourceNode() throws Exception { test("EventTarget", "ConstantSourceNode"); } @@ -2890,7 +2851,7 @@ public void _EventTarget_DocumentType() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _EventTarget_DOMCursor() throws Exception { test("EventTarget", "DOMCursor"); } @@ -2989,8 +2950,7 @@ public void _EventTarget_HTMLAnchorElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF = "true") + @Alerts("false") public void _EventTarget_HTMLAppletElement() throws Exception { test("EventTarget", "HTMLAppletElement"); } @@ -3069,9 +3029,8 @@ public void _EventTarget_HTMLCanvasElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _EventTarget_HTMLContentElement() throws Exception { test("EventTarget", "HTMLContentElement"); } @@ -3101,8 +3060,7 @@ public void _EventTarget_HTMLDataListElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _EventTarget_HTMLDetailsElement() throws Exception { test("EventTarget", "HTMLDetailsElement"); } @@ -3352,7 +3310,8 @@ public void _EventTarget_HTMLMapElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _EventTarget_HTMLMarqueeElement() throws Exception { test("EventTarget", "HTMLMarqueeElement"); } @@ -3551,9 +3510,8 @@ public void _EventTarget_HTMLSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _EventTarget_HTMLShadowElement() throws Exception { test("EventTarget", "HTMLShadowElement"); } @@ -3563,7 +3521,8 @@ public void _EventTarget_HTMLShadowElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _EventTarget_HTMLSlotElement() throws Exception { test("EventTarget", "HTMLSlotElement"); } @@ -3793,8 +3752,7 @@ public void _EventTarget_IDBTransaction() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _EventTarget_IIRFilterNode() throws Exception { test("EventTarget", "IIRFilterNode"); } @@ -3814,7 +3772,7 @@ public void _EventTarget_Image() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _EventTarget_LocalMediaStream() throws Exception { test("EventTarget", "LocalMediaStream"); } @@ -3854,9 +3812,7 @@ public void _EventTarget_MediaKeySession() throws Exception { */ @Test @Alerts(DEFAULT = "true", - FF52 = "false", IE = "false") - @NotYetImplemented(FF52) public void _EventTarget_MediaQueryList() throws Exception { test("EventTarget", "MediaQueryList"); } @@ -4021,6 +3977,17 @@ public void _EventTarget_OfflineAudioContext() throws Exception { test("EventTarget", "OfflineAudioContext"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + CHROME = "false", + IE = "false") + public void _EventTarget_OfflineResourceList() throws Exception { + test("EventTarget", "OfflineResourceList"); + } + /** * @throws Exception if the test fails */ @@ -4061,14 +4028,22 @@ public void _EventTarget_PaymentRequest() throws Exception { test("EventTarget", "PaymentRequest"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true") + public void _EventTarget_PaymentResponse() throws Exception { + test("EventTarget", "PaymentResponse"); + } + /** * @throws Exception if the test fails */ @Test @Alerts(DEFAULT = "true", - FF52 = "false", IE = "false") - @NotYetImplemented(FF52) public void _EventTarget_Performance() throws Exception { test("EventTarget", "Performance"); } @@ -4078,8 +4053,7 @@ public void _EventTarget_Performance() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _EventTarget_PermissionStatus() throws Exception { test("EventTarget", "PermissionStatus"); } @@ -4149,8 +4123,8 @@ public void _EventTarget_RTCPeerConnection() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") - @NotYetImplemented(FF52) + FF = "true") + @NotYetImplemented(FF) public void _EventTarget_Screen() throws Exception { test("EventTarget", "Screen"); } @@ -4210,7 +4184,8 @@ public void _EventTarget_ServiceWorkerRegistration() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _EventTarget_ShadowRoot() throws Exception { test("EventTarget", "ShadowRoot"); } @@ -4250,7 +4225,7 @@ public void _EventTarget_SourceBufferList() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") public void _EventTarget_SpeechSynthesis() throws Exception { test("EventTarget", "SpeechSynthesis"); } @@ -4260,8 +4235,7 @@ public void _EventTarget_SpeechSynthesis() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _EventTarget_SpeechSynthesisUtterance() throws Exception { test("EventTarget", "SpeechSynthesisUtterance"); } @@ -4286,16 +4260,6 @@ public void _EventTarget_SVGAElement() throws Exception { test("EventTarget", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _EventTarget_SVGAltGlyphElement() throws Exception { - test("EventTarget", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -4396,16 +4360,6 @@ public void _EventTarget_SVGDiscardElement() throws Exception { test("EventTarget", "SVGDiscardElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _EventTarget_SVGDocument() throws Exception { - test("EventTarget", "SVGDocument"); - } - /** * @throws Exception if the test fails */ @@ -4711,7 +4665,8 @@ public void _EventTarget_SVGGElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _EventTarget_SVGGeometryElement() throws Exception { test("EventTarget", "SVGGeometryElement"); } @@ -5176,6 +5131,17 @@ public void _EventTarget_XMLHttpRequestUpload() throws Exception { test("EventTarget", "XMLHttpRequestUpload"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true", + FF = "true") + public void _Event_SpeechSynthesisErrorEvent() throws Exception { + test("Event", "SpeechSynthesisErrorEvent"); + } + /** * @throws Exception if the test fails */ @@ -5191,7 +5157,7 @@ public void _EXT_texture_filter_anisotropic_EXT_texture_filter_anisotropic() thr */ @Test @Alerts(DEFAULT = "false", - FF = "true") + CHROME = "true") public void _External_External() throws Exception { test("External", "External"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java index 756cfef4b17..6b56b7f39b9 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfFTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ * This class handles all host names which starts by character 'F' to 'G'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfFTest extends HostParentOf { @@ -88,7 +89,7 @@ public void _FileReader_FileReader() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") public void _FileSystem_FileSystem() throws Exception { test("FileSystem", "FileSystem"); } @@ -98,7 +99,7 @@ public void _FileSystem_FileSystem() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") public void _FileSystemDirectoryEntry_FileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry", "FileSystemDirectoryEntry"); } @@ -108,7 +109,7 @@ public void _FileSystemDirectoryEntry_FileSystemDirectoryEntry() throws Exceptio */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") public void _FileSystemDirectoryReader_FileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader", "FileSystemDirectoryReader"); } @@ -118,7 +119,17 @@ public void _FileSystemDirectoryReader_FileSystemDirectoryReader() throws Except */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") + public void _FileSystemEntry_FileSystemDirectoryEntry() throws Exception { + test("FileSystemEntry", "FileSystemDirectoryEntry"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF = "true") public void _FileSystemEntry_FileSystemEntry() throws Exception { test("FileSystemEntry", "FileSystemEntry"); } @@ -128,7 +139,17 @@ public void _FileSystemEntry_FileSystemEntry() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") + public void _FileSystemEntry_FileSystemFileEntry() throws Exception { + test("FileSystemEntry", "FileSystemFileEntry"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF = "true") public void _FileSystemFileEntry_FileSystemFileEntry() throws Exception { test("FileSystemFileEntry", "FileSystemFileEntry"); } @@ -234,6 +255,7 @@ public void _GamepadEvent_GamepadEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", + CHROME = "true", IE = "true") public void _Geolocation_Geolocation() throws Exception { test("Geolocation", "Geolocation"); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java index 1182cbb0dd9..902a844c091 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfHTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'H'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfHTest extends HostParentOf { @@ -102,7 +103,8 @@ public void _HTMLAnchorElement_HTMLAnchorElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _HTMLAppletElement_HTMLAppletElement() throws Exception { test("HTMLAppletElement", "HTMLAppletElement"); } @@ -254,9 +256,8 @@ public void _HTMLCollection_HTMLOptionsCollection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _HTMLContentElement_HTMLContentElement() throws Exception { test("HTMLContentElement", "HTMLContentElement"); } @@ -294,9 +295,8 @@ public void _HTMLDDElement_HTMLDDElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _HTMLDetailsElement_HTMLDetailsElement() throws Exception { test("HTMLDetailsElement", "HTMLDetailsElement"); } @@ -380,7 +380,8 @@ public void _HTMLElement_HTMLAnchorElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _HTMLElement_HTMLAppletElement() throws Exception { test("HTMLElement", "HTMLAppletElement"); } @@ -482,9 +483,8 @@ public void _HTMLElement_HTMLCanvasElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _HTMLElement_HTMLContentElement() throws Exception { test("HTMLElement", "HTMLContentElement"); } @@ -522,9 +522,8 @@ public void _HTMLElement_HTMLDDElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _HTMLElement_HTMLDetailsElement() throws Exception { test("HTMLElement", "HTMLDetailsElement"); } @@ -762,7 +761,7 @@ public void _HTMLElement_HTMLMapElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - FF = "false") + FF60 = "false") public void _HTMLElement_HTMLMarqueeElement() throws Exception { test("HTMLElement", "HTMLMarqueeElement"); } @@ -966,9 +965,8 @@ public void _HTMLElement_HTMLSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _HTMLElement_HTMLShadowElement() throws Exception { test("HTMLElement", "HTMLShadowElement"); } @@ -978,7 +976,8 @@ public void _HTMLElement_HTMLShadowElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _HTMLElement_HTMLSlotElement() throws Exception { test("HTMLElement", "HTMLSlotElement"); } @@ -1373,7 +1372,7 @@ public void _HTMLMapElement_HTMLMapElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - FF = "false") + FF60 = "false") public void _HTMLMarqueeElement_HTMLMarqueeElement() throws Exception { test("HTMLMarqueeElement", "HTMLMarqueeElement"); } @@ -1624,9 +1623,8 @@ public void _HTMLSelectElement_HTMLSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") + @Alerts(DEFAULT = "false", + CHROME = "true") public void _HTMLShadowElement_HTMLShadowElement() throws Exception { test("HTMLShadowElement", "HTMLShadowElement"); } @@ -1636,7 +1634,8 @@ public void _HTMLShadowElement_HTMLShadowElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _HTMLSlotElement_HTMLSlotElement() throws Exception { test("HTMLSlotElement", "HTMLSlotElement"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java index 964a5de56b4..ed65b588a40 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.general.huge; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import java.util.Collection; @@ -32,6 +33,7 @@ * This class handles all host names which starts by character 'I' to 'L'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfITest extends HostParentOf { @@ -196,7 +198,8 @@ public void _IDBVersionChangeEvent_IDBVersionChangeEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _IdleDeadline_IdleDeadline() throws Exception { test("IdleDeadline", "IdleDeadline"); } @@ -206,8 +209,7 @@ public void _IdleDeadline_IdleDeadline() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _IIRFilterNode_IIRFilterNode() throws Exception { test("IIRFilterNode", "IIRFilterNode"); } @@ -218,6 +220,7 @@ public void _IIRFilterNode_IIRFilterNode() throws Exception { */ @Test @Alerts("true") + @NotYetImplemented(CHROME) public void _Image_HTMLImageElement() throws Exception { // although Image != HTMLImageElement, they seem to be synonyms!!! test("Image", "HTMLImageElement"); @@ -249,8 +252,7 @@ public void _ImageBitmap_ImageBitmap() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _ImageBitmapRenderingContext_ImageBitmapRenderingContext() throws Exception { test("ImageBitmapRenderingContext", "ImageBitmapRenderingContext"); } @@ -331,7 +333,8 @@ public void _Int8Array_Int8Array() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _IntersectionObserver_IntersectionObserver() throws Exception { test("IntersectionObserver", "IntersectionObserver"); } @@ -341,7 +344,8 @@ public void _IntersectionObserver_IntersectionObserver() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _IntersectionObserverEntry_IntersectionObserverEntry() throws Exception { test("IntersectionObserverEntry", "IntersectionObserverEntry"); } @@ -362,7 +366,19 @@ public void _KeyboardEvent_KeyboardEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + CHROME = "true", + FF68 = "true") + public void _KeyframeEffect_KeyframeEffect() throws Exception { + test("KeyframeEffect", "KeyframeEffect"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF60 = "true") public void _LocalMediaStream_LocalMediaStream() throws Exception { test("LocalMediaStream", "LocalMediaStream"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java index 5014bf7fbe1..237809461da 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfMTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'M' to 'O'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfMTest extends HostParentOf { @@ -48,7 +49,7 @@ public class HostParentOfMTest extends HostParentOf { public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); - return ch >= 'M' && ch <= 'O'; + return ch == 'M'; }); } @@ -206,7 +207,8 @@ public void _MediaQueryList_MediaQueryList() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _MediaQueryListEvent_MediaQueryListEvent() throws Exception { test("MediaQueryListEvent", "MediaQueryListEvent"); } @@ -249,7 +251,7 @@ public void _MediaStream_CanvasCaptureMediaStream() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _MediaStream_LocalMediaStream() throws Exception { test("MediaStream", "LocalMediaStream"); } @@ -549,8 +551,7 @@ public void _MouseEvent_MouseWheelEvent() throws Exception { * if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _MouseEvent_PointerEvent() throws Exception { test("MouseEvent", "PointerEvent"); } @@ -587,43 +588,10 @@ public void _MouseWheelEvent_MouseWheelEvent() throws Exception { test("MouseWheelEvent", "MouseWheelEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _MozContactChangeEvent_MozContactChangeEvent() throws Exception { - test("MozContactChangeEvent", "MozContactChangeEvent"); - } - /** * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _MozCSSKeyframesRule_MozCSSKeyframesRule() throws Exception { - test("MozCSSKeyframesRule", "MozCSSKeyframesRule"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _MozPowerManager_MozPowerManager() throws Exception { - test("MozPowerManager", "MozPowerManager"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test @Alerts(DEFAULT = "false", FF = "true") public void _mozRTCIceCandidate_mozRTCIceCandidate() throws Exception { @@ -652,17 +620,6 @@ public void _mozRTCSessionDescription_mozRTCSessionDescription() throws Exceptio test("mozRTCSessionDescription", "mozRTCSessionDescription"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _MozSettingsEvent_MozSettingsEvent() throws Exception { - test("MozSettingsEvent", "MozSettingsEvent"); - } - /** * @throws Exception if the test fails */ @@ -723,1973 +680,4 @@ public void _MutationRecord_MutationRecord() throws Exception { public void _NamedNodeMap_NamedNodeMap() throws Exception { test("NamedNodeMap", "NamedNodeMap"); } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Navigator_Navigator() throws Exception { - test("Navigator", "Navigator"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _NetworkInformation_NetworkInformation() throws Exception { - test("NetworkInformation", "NetworkInformation"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Attr() throws Exception { - test("Node", "Attr"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Audio() throws Exception { - test("Node", "Audio"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_CDATASection() throws Exception { - test("Node", "CDATASection"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_CharacterData() throws Exception { - test("Node", "CharacterData"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Comment() throws Exception { - test("Node", "Comment"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Document() throws Exception { - test("Node", "Document"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_DocumentFragment() throws Exception { - test("Node", "DocumentFragment"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_DocumentType() throws Exception { - test("Node", "DocumentType"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Element() throws Exception { - test("Node", "Element"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLAnchorElement() throws Exception { - test("Node", "HTMLAnchorElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - CHROME = "false") - public void _Node_HTMLAppletElement() throws Exception { - test("Node", "HTMLAppletElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLAreaElement() throws Exception { - test("Node", "HTMLAreaElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLAudioElement() throws Exception { - test("Node", "HTMLAudioElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLBaseElement() throws Exception { - test("Node", "HTMLBaseElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLBaseFontElement() throws Exception { - test("Node", "HTMLBaseFontElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLBGSoundElement() throws Exception { - test("Node", "HTMLBGSoundElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLBlockElement() throws Exception { - test("Node", "HTMLBlockElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLBodyElement() throws Exception { - test("Node", "HTMLBodyElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLBRElement() throws Exception { - test("Node", "HTMLBRElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLButtonElement() throws Exception { - test("Node", "HTMLButtonElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLCanvasElement() throws Exception { - test("Node", "HTMLCanvasElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") - public void _Node_HTMLContentElement() throws Exception { - test("Node", "HTMLContentElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_HTMLDataElement() throws Exception { - test("Node", "HTMLDataElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDataListElement() throws Exception { - test("Node", "HTMLDataListElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLDDElement() throws Exception { - test("Node", "HTMLDDElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") - public void _Node_HTMLDetailsElement() throws Exception { - test("Node", "HTMLDetailsElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Node_HTMLDialogElement() throws Exception { - test("Node", "HTMLDialogElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDirectoryElement() throws Exception { - test("Node", "HTMLDirectoryElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDivElement() throws Exception { - test("Node", "HTMLDivElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDListElement() throws Exception { - test("Node", "HTMLDListElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDocument() throws Exception { - test("Node", "HTMLDocument"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLDTElement() throws Exception { - test("Node", "HTMLDTElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLElement() throws Exception { - test("Node", "HTMLElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLEmbedElement() throws Exception { - test("Node", "HTMLEmbedElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFieldSetElement() throws Exception { - test("Node", "HTMLFieldSetElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFontElement() throws Exception { - test("Node", "HTMLFontElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFormElement() throws Exception { - test("Node", "HTMLFormElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFrameElement() throws Exception { - test("Node", "HTMLFrameElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFrameSetElement() throws Exception { - test("Node", "HTMLFrameSetElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHeadElement() throws Exception { - test("Node", "HTMLHeadElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHeadingElement() throws Exception { - test("Node", "HTMLHeadingElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHRElement() throws Exception { - test("Node", "HTMLHRElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHtmlElement() throws Exception { - test("Node", "HTMLHtmlElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLIFrameElement() throws Exception { - test("Node", "HTMLIFrameElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLImageElement() throws Exception { - test("Node", "HTMLImageElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLInputElement() throws Exception { - test("Node", "HTMLInputElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLIsIndexElement() throws Exception { - test("Node", "HTMLIsIndexElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLabelElement() throws Exception { - test("Node", "HTMLLabelElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLegendElement() throws Exception { - test("Node", "HTMLLegendElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLIElement() throws Exception { - test("Node", "HTMLLIElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLinkElement() throws Exception { - test("Node", "HTMLLinkElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMapElement() throws Exception { - test("Node", "HTMLMapElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false") - public void _Node_HTMLMarqueeElement() throws Exception { - test("Node", "HTMLMarqueeElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMediaElement() throws Exception { - test("Node", "HTMLMediaElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMenuElement() throws Exception { - test("Node", "HTMLMenuElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true") - public void _Node_HTMLMenuItemElement() throws Exception { - test("Node", "HTMLMenuItemElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMetaElement() throws Exception { - test("Node", "HTMLMetaElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_HTMLMeterElement() throws Exception { - test("Node", "HTMLMeterElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLModElement() throws Exception { - test("Node", "HTMLModElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLNextIdElement() throws Exception { - test("Node", "HTMLNextIdElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLObjectElement() throws Exception { - test("Node", "HTMLObjectElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOListElement() throws Exception { - test("Node", "HTMLOListElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOptGroupElement() throws Exception { - test("Node", "HTMLOptGroupElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOptionElement() throws Exception { - test("Node", "HTMLOptionElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_HTMLOutputElement() throws Exception { - test("Node", "HTMLOutputElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLParagraphElement() throws Exception { - test("Node", "HTMLParagraphElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLParamElement() throws Exception { - test("Node", "HTMLParamElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLPhraseElement() throws Exception { - test("Node", "HTMLPhraseElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_HTMLPictureElement() throws Exception { - test("Node", "HTMLPictureElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLPreElement() throws Exception { - test("Node", "HTMLPreElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLProgressElement() throws Exception { - test("Node", "HTMLProgressElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLQuoteElement() throws Exception { - test("Node", "HTMLQuoteElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLScriptElement() throws Exception { - test("Node", "HTMLScriptElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSelectElement() throws Exception { - test("Node", "HTMLSelectElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF52 = "false", - IE = "false") - public void _Node_HTMLShadowElement() throws Exception { - test("Node", "HTMLShadowElement"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Node_HTMLSlotElement() throws Exception { - test("Node", "HTMLSlotElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSourceElement() throws Exception { - test("Node", "HTMLSourceElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSpanElement() throws Exception { - test("Node", "HTMLSpanElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLStyleElement() throws Exception { - test("Node", "HTMLStyleElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableCaptionElement() throws Exception { - test("Node", "HTMLTableCaptionElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableCellElement() throws Exception { - test("Node", "HTMLTableCellElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableColElement() throws Exception { - test("Node", "HTMLTableColElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLTableDataCellElement() throws Exception { - test("Node", "HTMLTableDataCellElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableElement() throws Exception { - test("Node", "HTMLTableElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _Node_HTMLTableHeaderCellElement() throws Exception { - test("Node", "HTMLTableHeaderCellElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableRowElement() throws Exception { - test("Node", "HTMLTableRowElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableSectionElement() throws Exception { - test("Node", "HTMLTableSectionElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_HTMLTemplateElement() throws Exception { - test("Node", "HTMLTemplateElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTextAreaElement() throws Exception { - test("Node", "HTMLTextAreaElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_HTMLTimeElement() throws Exception { - test("Node", "HTMLTimeElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTitleElement() throws Exception { - test("Node", "HTMLTitleElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTrackElement() throws Exception { - test("Node", "HTMLTrackElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLUListElement() throws Exception { - test("Node", "HTMLUListElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLUnknownElement() throws Exception { - test("Node", "HTMLUnknownElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLVideoElement() throws Exception { - test("Node", "HTMLVideoElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Image() throws Exception { - test("Node", "Image"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Node() throws Exception { - test("Node", "Node"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Option() throws Exception { - test("Node", "Option"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_ProcessingInstruction() throws Exception { - test("Node", "ProcessingInstruction"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Node_ShadowRoot() throws Exception { - test("Node", "ShadowRoot"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGAElement() throws Exception { - test("Node", "SVGAElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _Node_SVGAltGlyphElement() throws Exception { - test("Node", "SVGAltGlyphElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGAnimateElement() throws Exception { - test("Node", "SVGAnimateElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGAnimateMotionElement() throws Exception { - test("Node", "SVGAnimateMotionElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGAnimateTransformElement() throws Exception { - test("Node", "SVGAnimateTransformElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGAnimationElement() throws Exception { - test("Node", "SVGAnimationElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGCircleElement() throws Exception { - test("Node", "SVGCircleElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGClipPathElement() throws Exception { - test("Node", "SVGClipPathElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGComponentTransferFunctionElement() throws Exception { - test("Node", "SVGComponentTransferFunctionElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGDefsElement() throws Exception { - test("Node", "SVGDefsElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGDescElement() throws Exception { - test("Node", "SVGDescElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Node_SVGDiscardElement() throws Exception { - test("Node", "SVGDiscardElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _Node_SVGDocument() throws Exception { - test("Node", "SVGDocument"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGElement() throws Exception { - test("Node", "SVGElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGEllipseElement() throws Exception { - test("Node", "SVGEllipseElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEBlendElement() throws Exception { - test("Node", "SVGFEBlendElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEColorMatrixElement() throws Exception { - test("Node", "SVGFEColorMatrixElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEComponentTransferElement() throws Exception { - test("Node", "SVGFEComponentTransferElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFECompositeElement() throws Exception { - test("Node", "SVGFECompositeElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEConvolveMatrixElement() throws Exception { - test("Node", "SVGFEConvolveMatrixElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDiffuseLightingElement() throws Exception { - test("Node", "SVGFEDiffuseLightingElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDisplacementMapElement() throws Exception { - test("Node", "SVGFEDisplacementMapElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDistantLightElement() throws Exception { - test("Node", "SVGFEDistantLightElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGFEDropShadowElement() throws Exception { - test("Node", "SVGFEDropShadowElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFloodElement() throws Exception { - test("Node", "SVGFEFloodElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncAElement() throws Exception { - test("Node", "SVGFEFuncAElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncBElement() throws Exception { - test("Node", "SVGFEFuncBElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncGElement() throws Exception { - test("Node", "SVGFEFuncGElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncRElement() throws Exception { - test("Node", "SVGFEFuncRElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEGaussianBlurElement() throws Exception { - test("Node", "SVGFEGaussianBlurElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEImageElement() throws Exception { - test("Node", "SVGFEImageElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEMergeElement() throws Exception { - test("Node", "SVGFEMergeElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEMergeNodeElement() throws Exception { - test("Node", "SVGFEMergeNodeElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEMorphologyElement() throws Exception { - test("Node", "SVGFEMorphologyElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEOffsetElement() throws Exception { - test("Node", "SVGFEOffsetElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEPointLightElement() throws Exception { - test("Node", "SVGFEPointLightElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFESpecularLightingElement() throws Exception { - test("Node", "SVGFESpecularLightingElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFESpotLightElement() throws Exception { - test("Node", "SVGFESpotLightElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFETileElement() throws Exception { - test("Node", "SVGFETileElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFETurbulenceElement() throws Exception { - test("Node", "SVGFETurbulenceElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFilterElement() throws Exception { - test("Node", "SVGFilterElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGForeignObjectElement() throws Exception { - test("Node", "SVGForeignObjectElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGGElement() throws Exception { - test("Node", "SVGGElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _Node_SVGGeometryElement() throws Exception { - test("Node", "SVGGeometryElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGGradientElement() throws Exception { - test("Node", "SVGGradientElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGGraphicsElement() throws Exception { - test("Node", "SVGGraphicsElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGImageElement() throws Exception { - test("Node", "SVGImageElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGLinearGradientElement() throws Exception { - test("Node", "SVGLinearGradientElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGLineElement() throws Exception { - test("Node", "SVGLineElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMarkerElement() throws Exception { - test("Node", "SVGMarkerElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMaskElement() throws Exception { - test("Node", "SVGMaskElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMetadataElement() throws Exception { - test("Node", "SVGMetadataElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGMPathElement() throws Exception { - test("Node", "SVGMPathElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPathElement() throws Exception { - test("Node", "SVGPathElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPatternElement() throws Exception { - test("Node", "SVGPatternElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPolygonElement() throws Exception { - test("Node", "SVGPolygonElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPolylineElement() throws Exception { - test("Node", "SVGPolylineElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGRadialGradientElement() throws Exception { - test("Node", "SVGRadialGradientElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGRectElement() throws Exception { - test("Node", "SVGRectElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGScriptElement() throws Exception { - test("Node", "SVGScriptElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Node_SVGSetElement() throws Exception { - test("Node", "SVGSetElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGStopElement() throws Exception { - test("Node", "SVGStopElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGStyleElement() throws Exception { - test("Node", "SVGStyleElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSVGElement() throws Exception { - test("Node", "SVGSVGElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSwitchElement() throws Exception { - test("Node", "SVGSwitchElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSymbolElement() throws Exception { - test("Node", "SVGSymbolElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextContentElement() throws Exception { - test("Node", "SVGTextContentElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextElement() throws Exception { - test("Node", "SVGTextElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextPathElement() throws Exception { - test("Node", "SVGTextPathElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextPositioningElement() throws Exception { - test("Node", "SVGTextPositioningElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTitleElement() throws Exception { - test("Node", "SVGTitleElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTSpanElement() throws Exception { - test("Node", "SVGTSpanElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGUseElement() throws Exception { - test("Node", "SVGUseElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGViewElement() throws Exception { - test("Node", "SVGViewElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Text() throws Exception { - test("Node", "Text"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_XMLDocument() throws Exception { - test("Node", "XMLDocument"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - @NotYetImplemented - public void _NodeFilter_NodeFilter() throws Exception { - test("NodeFilter", "NodeFilter"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _NodeIterator_NodeIterator() throws Exception { - test("NodeIterator", "NodeIterator"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _NodeList_NodeList() throws Exception { - test("NodeList", "NodeList"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _NodeList_RadioNodeList() throws Exception { - test("NodeList", "RadioNodeList"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _Notification_Notification() throws Exception { - test("Notification", "Notification"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _OES_element_index_uint_OES_element_index_uint() throws Exception { - test("OES_element_index_uint", "OES_element_index_uint"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _OES_standard_derivatives_OES_standard_derivatives() throws Exception { - test("OES_standard_derivatives", "OES_standard_derivatives"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _OES_texture_float_linear_OES_texture_float_linear() throws Exception { - test("OES_texture_float_linear", "OES_texture_float_linear"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - IE = "true") - public void _OES_texture_float_OES_texture_float() throws Exception { - test("OES_texture_float", "OES_texture_float"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _OfflineAudioCompletionEvent_OfflineAudioCompletionEvent() throws Exception { - test("OfflineAudioCompletionEvent", "OfflineAudioCompletionEvent"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _OfflineAudioContext_OfflineAudioContext() throws Exception { - test("OfflineAudioContext", "OfflineAudioContext"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Option_HTMLOptionElement() throws Exception { - // although Option != HTMLOptionElement, they seem to be synonyms!!! - test("Option", "HTMLOptionElement"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Option_Option() throws Exception { - test("Option", "Option"); - } - - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - IE = "false") - public void _OscillatorNode_OscillatorNode() throws Exception { - test("OscillatorNode", "OscillatorNode"); - } - } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfNTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfNTest.java new file mode 100644 index 00000000000..bab44a342c3 --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfNTest.java @@ -0,0 +1,2022 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.general.huge; + +import java.util.Collection; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized.Parameters; + +import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; + +/** + * Tests two Host classes, if one prototype is parent of another. + * + * This class handles all host names which starts by character 'M' to 'O'. + * + * @author Ahmed Ashour + * @author Ronald Brill + */ +@RunWith(BrowserParameterizedRunner.class) +public class HostParentOfNTest extends HostParentOf { + + /** + * Returns the parameterized data. + * + * @return the parameterized data + * @throws Exception + * if an error occurs + */ + @Parameters + public static Collection data() throws Exception { + return HostParentOf.data(input -> { + final char ch = Character.toUpperCase(input.charAt(0)); + return ch >= 'N' && ch <= 'O'; + }); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _NamedNodeMap_NamedNodeMap() throws Exception { + test("NamedNodeMap", "NamedNodeMap"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Navigator_Navigator() throws Exception { + test("Navigator", "Navigator"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true") + public void _NetworkInformation_NetworkInformation() throws Exception { + test("NetworkInformation", "NetworkInformation"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Attr() throws Exception { + test("Node", "Attr"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Audio() throws Exception { + test("Node", "Audio"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_CDATASection() throws Exception { + test("Node", "CDATASection"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_CharacterData() throws Exception { + test("Node", "CharacterData"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Comment() throws Exception { + test("Node", "Comment"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Document() throws Exception { + test("Node", "Document"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_DocumentFragment() throws Exception { + test("Node", "DocumentFragment"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_DocumentType() throws Exception { + test("Node", "DocumentType"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Element() throws Exception { + test("Node", "Element"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLAnchorElement() throws Exception { + test("Node", "HTMLAnchorElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + CHROME = "false", + FF = "false") + public void _Node_HTMLAppletElement() throws Exception { + test("Node", "HTMLAppletElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLAreaElement() throws Exception { + test("Node", "HTMLAreaElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLAudioElement() throws Exception { + test("Node", "HTMLAudioElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLBaseElement() throws Exception { + test("Node", "HTMLBaseElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLBaseFontElement() throws Exception { + test("Node", "HTMLBaseFontElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLBGSoundElement() throws Exception { + test("Node", "HTMLBGSoundElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLBlockElement() throws Exception { + test("Node", "HTMLBlockElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLBodyElement() throws Exception { + test("Node", "HTMLBodyElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLBRElement() throws Exception { + test("Node", "HTMLBRElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLButtonElement() throws Exception { + test("Node", "HTMLButtonElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLCanvasElement() throws Exception { + test("Node", "HTMLCanvasElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true") + public void _Node_HTMLContentElement() throws Exception { + test("Node", "HTMLContentElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLDataElement() throws Exception { + test("Node", "HTMLDataElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLDataListElement() throws Exception { + test("Node", "HTMLDataListElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLDDElement() throws Exception { + test("Node", "HTMLDDElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLDetailsElement() throws Exception { + test("Node", "HTMLDetailsElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true") + public void _Node_HTMLDialogElement() throws Exception { + test("Node", "HTMLDialogElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLDirectoryElement() throws Exception { + test("Node", "HTMLDirectoryElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLDivElement() throws Exception { + test("Node", "HTMLDivElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLDListElement() throws Exception { + test("Node", "HTMLDListElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLDocument() throws Exception { + test("Node", "HTMLDocument"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLDTElement() throws Exception { + test("Node", "HTMLDTElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLElement() throws Exception { + test("Node", "HTMLElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLEmbedElement() throws Exception { + test("Node", "HTMLEmbedElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLFieldSetElement() throws Exception { + test("Node", "HTMLFieldSetElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLFontElement() throws Exception { + test("Node", "HTMLFontElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLFormElement() throws Exception { + test("Node", "HTMLFormElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLFrameElement() throws Exception { + test("Node", "HTMLFrameElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLFrameSetElement() throws Exception { + test("Node", "HTMLFrameSetElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLHeadElement() throws Exception { + test("Node", "HTMLHeadElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLHeadingElement() throws Exception { + test("Node", "HTMLHeadingElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLHRElement() throws Exception { + test("Node", "HTMLHRElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLHtmlElement() throws Exception { + test("Node", "HTMLHtmlElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLIFrameElement() throws Exception { + test("Node", "HTMLIFrameElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLImageElement() throws Exception { + test("Node", "HTMLImageElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLInputElement() throws Exception { + test("Node", "HTMLInputElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLIsIndexElement() throws Exception { + test("Node", "HTMLIsIndexElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLLabelElement() throws Exception { + test("Node", "HTMLLabelElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLLegendElement() throws Exception { + test("Node", "HTMLLegendElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLLIElement() throws Exception { + test("Node", "HTMLLIElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLLinkElement() throws Exception { + test("Node", "HTMLLinkElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLMapElement() throws Exception { + test("Node", "HTMLMapElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + FF60 = "false") + public void _Node_HTMLMarqueeElement() throws Exception { + test("Node", "HTMLMarqueeElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLMediaElement() throws Exception { + test("Node", "HTMLMediaElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLMenuElement() throws Exception { + test("Node", "HTMLMenuElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + FF = "true") + public void _Node_HTMLMenuItemElement() throws Exception { + test("Node", "HTMLMenuItemElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLMetaElement() throws Exception { + test("Node", "HTMLMetaElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLMeterElement() throws Exception { + test("Node", "HTMLMeterElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLModElement() throws Exception { + test("Node", "HTMLModElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLNextIdElement() throws Exception { + test("Node", "HTMLNextIdElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLObjectElement() throws Exception { + test("Node", "HTMLObjectElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLOListElement() throws Exception { + test("Node", "HTMLOListElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLOptGroupElement() throws Exception { + test("Node", "HTMLOptGroupElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLOptionElement() throws Exception { + test("Node", "HTMLOptionElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLOutputElement() throws Exception { + test("Node", "HTMLOutputElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLParagraphElement() throws Exception { + test("Node", "HTMLParagraphElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLParamElement() throws Exception { + test("Node", "HTMLParamElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLPhraseElement() throws Exception { + test("Node", "HTMLPhraseElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLPictureElement() throws Exception { + test("Node", "HTMLPictureElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLPreElement() throws Exception { + test("Node", "HTMLPreElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLProgressElement() throws Exception { + test("Node", "HTMLProgressElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLQuoteElement() throws Exception { + test("Node", "HTMLQuoteElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLScriptElement() throws Exception { + test("Node", "HTMLScriptElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLSelectElement() throws Exception { + test("Node", "HTMLSelectElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true") + public void _Node_HTMLShadowElement() throws Exception { + test("Node", "HTMLShadowElement"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true", + FF68 = "true") + public void _Node_HTMLSlotElement() throws Exception { + test("Node", "HTMLSlotElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLSourceElement() throws Exception { + test("Node", "HTMLSourceElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLSpanElement() throws Exception { + test("Node", "HTMLSpanElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLStyleElement() throws Exception { + test("Node", "HTMLStyleElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTableCaptionElement() throws Exception { + test("Node", "HTMLTableCaptionElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTableCellElement() throws Exception { + test("Node", "HTMLTableCellElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTableColElement() throws Exception { + test("Node", "HTMLTableColElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLTableDataCellElement() throws Exception { + test("Node", "HTMLTableDataCellElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTableElement() throws Exception { + test("Node", "HTMLTableElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _Node_HTMLTableHeaderCellElement() throws Exception { + test("Node", "HTMLTableHeaderCellElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTableRowElement() throws Exception { + test("Node", "HTMLTableRowElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTableSectionElement() throws Exception { + test("Node", "HTMLTableSectionElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLTemplateElement() throws Exception { + test("Node", "HTMLTemplateElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTextAreaElement() throws Exception { + test("Node", "HTMLTextAreaElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_HTMLTimeElement() throws Exception { + test("Node", "HTMLTimeElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTitleElement() throws Exception { + test("Node", "HTMLTitleElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLTrackElement() throws Exception { + test("Node", "HTMLTrackElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLUListElement() throws Exception { + test("Node", "HTMLUListElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLUnknownElement() throws Exception { + test("Node", "HTMLUnknownElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_HTMLVideoElement() throws Exception { + test("Node", "HTMLVideoElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Image() throws Exception { + test("Node", "Image"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Node() throws Exception { + test("Node", "Node"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Option() throws Exception { + test("Node", "Option"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_ProcessingInstruction() throws Exception { + test("Node", "ProcessingInstruction"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true", + FF68 = "true") + public void _Node_ShadowRoot() throws Exception { + test("Node", "ShadowRoot"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGAElement() throws Exception { + test("Node", "SVGAElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGAnimateElement() throws Exception { + test("Node", "SVGAnimateElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGAnimateMotionElement() throws Exception { + test("Node", "SVGAnimateMotionElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGAnimateTransformElement() throws Exception { + test("Node", "SVGAnimateTransformElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGAnimationElement() throws Exception { + test("Node", "SVGAnimationElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGCircleElement() throws Exception { + test("Node", "SVGCircleElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGClipPathElement() throws Exception { + test("Node", "SVGClipPathElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGComponentTransferFunctionElement() throws Exception { + test("Node", "SVGComponentTransferFunctionElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGDefsElement() throws Exception { + test("Node", "SVGDefsElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGDescElement() throws Exception { + test("Node", "SVGDescElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true") + public void _Node_SVGDiscardElement() throws Exception { + test("Node", "SVGDiscardElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGElement() throws Exception { + test("Node", "SVGElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGEllipseElement() throws Exception { + test("Node", "SVGEllipseElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEBlendElement() throws Exception { + test("Node", "SVGFEBlendElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEColorMatrixElement() throws Exception { + test("Node", "SVGFEColorMatrixElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEComponentTransferElement() throws Exception { + test("Node", "SVGFEComponentTransferElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFECompositeElement() throws Exception { + test("Node", "SVGFECompositeElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEConvolveMatrixElement() throws Exception { + test("Node", "SVGFEConvolveMatrixElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEDiffuseLightingElement() throws Exception { + test("Node", "SVGFEDiffuseLightingElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEDisplacementMapElement() throws Exception { + test("Node", "SVGFEDisplacementMapElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEDistantLightElement() throws Exception { + test("Node", "SVGFEDistantLightElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGFEDropShadowElement() throws Exception { + test("Node", "SVGFEDropShadowElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEFloodElement() throws Exception { + test("Node", "SVGFEFloodElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEFuncAElement() throws Exception { + test("Node", "SVGFEFuncAElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEFuncBElement() throws Exception { + test("Node", "SVGFEFuncBElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEFuncGElement() throws Exception { + test("Node", "SVGFEFuncGElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEFuncRElement() throws Exception { + test("Node", "SVGFEFuncRElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEGaussianBlurElement() throws Exception { + test("Node", "SVGFEGaussianBlurElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEImageElement() throws Exception { + test("Node", "SVGFEImageElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEMergeElement() throws Exception { + test("Node", "SVGFEMergeElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEMergeNodeElement() throws Exception { + test("Node", "SVGFEMergeNodeElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEMorphologyElement() throws Exception { + test("Node", "SVGFEMorphologyElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEOffsetElement() throws Exception { + test("Node", "SVGFEOffsetElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFEPointLightElement() throws Exception { + test("Node", "SVGFEPointLightElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFESpecularLightingElement() throws Exception { + test("Node", "SVGFESpecularLightingElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFESpotLightElement() throws Exception { + test("Node", "SVGFESpotLightElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFETileElement() throws Exception { + test("Node", "SVGFETileElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFETurbulenceElement() throws Exception { + test("Node", "SVGFETurbulenceElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGFilterElement() throws Exception { + test("Node", "SVGFilterElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGForeignObjectElement() throws Exception { + test("Node", "SVGForeignObjectElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGGElement() throws Exception { + test("Node", "SVGGElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + CHROME = "true", + FF = "true") + public void _Node_SVGGeometryElement() throws Exception { + test("Node", "SVGGeometryElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGGradientElement() throws Exception { + test("Node", "SVGGradientElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGGraphicsElement() throws Exception { + test("Node", "SVGGraphicsElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGImageElement() throws Exception { + test("Node", "SVGImageElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGLinearGradientElement() throws Exception { + test("Node", "SVGLinearGradientElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGLineElement() throws Exception { + test("Node", "SVGLineElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGMarkerElement() throws Exception { + test("Node", "SVGMarkerElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGMaskElement() throws Exception { + test("Node", "SVGMaskElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGMetadataElement() throws Exception { + test("Node", "SVGMetadataElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGMPathElement() throws Exception { + test("Node", "SVGMPathElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGPathElement() throws Exception { + test("Node", "SVGPathElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGPatternElement() throws Exception { + test("Node", "SVGPatternElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGPolygonElement() throws Exception { + test("Node", "SVGPolygonElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGPolylineElement() throws Exception { + test("Node", "SVGPolylineElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGRadialGradientElement() throws Exception { + test("Node", "SVGRadialGradientElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGRectElement() throws Exception { + test("Node", "SVGRectElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGScriptElement() throws Exception { + test("Node", "SVGScriptElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Node_SVGSetElement() throws Exception { + test("Node", "SVGSetElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGStopElement() throws Exception { + test("Node", "SVGStopElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGStyleElement() throws Exception { + test("Node", "SVGStyleElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGSVGElement() throws Exception { + test("Node", "SVGSVGElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGSwitchElement() throws Exception { + test("Node", "SVGSwitchElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGSymbolElement() throws Exception { + test("Node", "SVGSymbolElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGTextContentElement() throws Exception { + test("Node", "SVGTextContentElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGTextElement() throws Exception { + test("Node", "SVGTextElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGTextPathElement() throws Exception { + test("Node", "SVGTextPathElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGTextPositioningElement() throws Exception { + test("Node", "SVGTextPositioningElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGTitleElement() throws Exception { + test("Node", "SVGTitleElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGTSpanElement() throws Exception { + test("Node", "SVGTSpanElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGUseElement() throws Exception { + test("Node", "SVGUseElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_SVGViewElement() throws Exception { + test("Node", "SVGViewElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_Text() throws Exception { + test("Node", "Text"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Node_XMLDocument() throws Exception { + test("Node", "XMLDocument"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("false") + @NotYetImplemented + public void _NodeFilter_NodeFilter() throws Exception { + test("NodeFilter", "NodeFilter"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _NodeIterator_NodeIterator() throws Exception { + test("NodeIterator", "NodeIterator"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _NodeList_NodeList() throws Exception { + test("NodeList", "NodeList"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _NodeList_RadioNodeList() throws Exception { + test("NodeList", "RadioNodeList"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _Notification_Notification() throws Exception { + test("Notification", "Notification"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _OES_element_index_uint_OES_element_index_uint() throws Exception { + test("OES_element_index_uint", "OES_element_index_uint"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _OES_standard_derivatives_OES_standard_derivatives() throws Exception { + test("OES_standard_derivatives", "OES_standard_derivatives"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _OES_texture_float_linear_OES_texture_float_linear() throws Exception { + test("OES_texture_float_linear", "OES_texture_float_linear"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "false", + IE = "true") + public void _OES_texture_float_OES_texture_float() throws Exception { + test("OES_texture_float", "OES_texture_float"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _OfflineAudioCompletionEvent_OfflineAudioCompletionEvent() throws Exception { + test("OfflineAudioCompletionEvent", "OfflineAudioCompletionEvent"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _OfflineAudioContext_OfflineAudioContext() throws Exception { + test("OfflineAudioContext", "OfflineAudioContext"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + CHROME = "false", + IE = "false") + public void _OfflineResourceList_OfflineResourceList() throws Exception { + test("OfflineResourceList", "OfflineResourceList"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Option_HTMLOptionElement() throws Exception { + // although Option != HTMLOptionElement, they seem to be synonyms!!! + test("Option", "HTMLOptionElement"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts("true") + public void _Option_Option() throws Exception { + test("Option", "Option"); + } + + /** + * @throws Exception + * if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") + public void _OscillatorNode_OscillatorNode() throws Exception { + test("OscillatorNode", "OscillatorNode"); + } + +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java index 4c274078e67..45497dfb50e 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfPTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import java.util.Collection; @@ -33,6 +34,7 @@ * This class handles all host names which starts by character 'P' to 'R'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfPTest extends HostParentOf { @@ -173,8 +175,9 @@ public void _PerformanceEntry_PerformanceMeasure() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") - @NotYetImplemented(CHROME) + CHROME = "true", + FF = "true") + @NotYetImplemented(IE) public void _PerformanceEntry_PerformanceNavigationTiming() throws Exception { test("PerformanceEntry", "PerformanceNavigationTiming"); } @@ -223,8 +226,7 @@ public void _PerformanceNavigation_PerformanceNavigation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _PerformanceNavigationTiming_PerformanceNavigationTiming() throws Exception { test("PerformanceNavigationTiming", "PerformanceNavigationTiming"); } @@ -235,7 +237,8 @@ public void _PerformanceNavigationTiming_PerformanceNavigationTiming() throws Ex */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _PerformanceObserver_PerformanceObserver() throws Exception { test("PerformanceObserver", "PerformanceObserver"); } @@ -246,7 +249,8 @@ public void _PerformanceObserver_PerformanceObserver() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _PerformanceObserverEntryList_PerformanceObserverEntryList() throws Exception { test("PerformanceObserverEntryList", "PerformanceObserverEntryList"); } @@ -257,8 +261,9 @@ public void _PerformanceObserverEntryList_PerformanceObserverEntryList() throws */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") - @NotYetImplemented(CHROME) + CHROME = "true", + FF = "true") + @NotYetImplemented(IE) public void _PerformanceResourceTiming_PerformanceNavigationTiming() throws Exception { test("PerformanceResourceTiming", "PerformanceNavigationTiming"); } @@ -299,9 +304,8 @@ public void _PeriodicWave_PeriodicWave() throws Exception { * if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _Permissions_Permissions() throws Exception { test("Permissions", "Permissions"); } @@ -311,9 +315,8 @@ public void _Permissions_Permissions() throws Exception { * if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true", - CHROME = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _PermissionStatus_PermissionStatus() throws Exception { test("PermissionStatus", "PermissionStatus"); } @@ -343,8 +346,7 @@ public void _PluginArray_PluginArray() throws Exception { * if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _PointerEvent_PointerEvent() throws Exception { test("PointerEvent", "PointerEvent"); } @@ -541,7 +543,8 @@ public void _Range_Range() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _ReadableStream_ReadableStream() throws Exception { test("ReadableStream", "ReadableStream"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java index fef6d025a68..f1f8699331c 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfSTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF60; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import java.util.Collection; @@ -34,6 +35,7 @@ * This class handles all host names which starts by character 'S'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfSTest extends HostParentOf { @@ -85,7 +87,8 @@ public void _ScriptProcessorNode_ScriptProcessorNode() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _SecurityPolicyViolationEvent_SecurityPolicyViolationEvent() throws Exception { test("SecurityPolicyViolationEvent", "SecurityPolicyViolationEvent"); } @@ -153,7 +156,8 @@ public void _SharedArrayBuffer_SharedArrayBuffer() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") public void _ShadowRoot_ShadowRoot() throws Exception { test("ShadowRoot", "ShadowRoot"); } @@ -193,7 +197,7 @@ public void _SourceBufferList_SourceBufferList() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") public void _SpeechSynthesis_SpeechSynthesis() throws Exception { test("SpeechSynthesis", "SpeechSynthesis"); } @@ -202,8 +206,8 @@ public void _SpeechSynthesis_SpeechSynthesis() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "false", - FF52 = "true") + @Alerts(DEFAULT = "true", + IE = "false") public void _SpeechSynthesisErrorEvent_SpeechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent", "SpeechSynthesisErrorEvent"); } @@ -213,8 +217,17 @@ public void _SpeechSynthesisErrorEvent_SpeechSynthesisErrorEvent() throws Except */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") + public void _SpeechSynthesisEvent_SpeechSynthesisErrorEvent() throws Exception { + test("SpeechSynthesisEvent", "SpeechSynthesisErrorEvent"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "true", + IE = "false") public void _SpeechSynthesisEvent_SpeechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent", "SpeechSynthesisEvent"); } @@ -224,8 +237,7 @@ public void _SpeechSynthesisEvent_SpeechSynthesisEvent() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _SpeechSynthesisUtterance_SpeechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance", "SpeechSynthesisUtterance"); } @@ -235,7 +247,7 @@ public void _SpeechSynthesisUtterance_SpeechSynthesisUtterance() throws Exceptio */ @Test @Alerts(DEFAULT = "false", - FF52 = "true") + FF = "true") public void _SpeechSynthesisVoice_SpeechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice", "SpeechSynthesisVoice"); } @@ -273,7 +285,8 @@ public void _StorageEvent_StorageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _StorageManager_StorageManager() throws Exception { test("StorageManager", "StorageManager"); } @@ -333,16 +346,6 @@ public void _SVGAElement_SVGAElement() throws Exception { test("SVGAElement", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _SVGAltGlyphElement_SVGAltGlyphElement() throws Exception { - test("SVGAltGlyphElement", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -631,16 +634,6 @@ public void _SVGDiscardElement_SVGDiscardElement() throws Exception { test("SVGDiscardElement", "SVGDiscardElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _SVGDocument_SVGDocument() throws Exception { - test("SVGDocument", "SVGDocument"); - } - /** * @throws Exception if the test fails */ @@ -650,16 +643,6 @@ public void _SVGElement_SVGAElement() throws Exception { test("SVGElement", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _SVGElement_SVGAltGlyphElement() throws Exception { - test("SVGElement", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -1032,7 +1015,8 @@ public void _SVGElement_SVGGElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _SVGElement_SVGGeometryElement() throws Exception { test("SVGElement", "SVGGeometryElement"); } @@ -1578,7 +1562,9 @@ public void _SVGGElement_SVGGElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGCircleElement() throws Exception { test("SVGGeometryElement", "SVGCircleElement"); } @@ -1588,7 +1574,9 @@ public void _SVGGeometryElement_SVGCircleElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGEllipseElement() throws Exception { test("SVGGeometryElement", "SVGEllipseElement"); } @@ -1598,7 +1586,8 @@ public void _SVGGeometryElement_SVGEllipseElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _SVGGeometryElement_SVGGeometryElement() throws Exception { test("SVGGeometryElement", "SVGGeometryElement"); } @@ -1608,7 +1597,9 @@ public void _SVGGeometryElement_SVGGeometryElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGLineElement() throws Exception { test("SVGGeometryElement", "SVGLineElement"); } @@ -1618,7 +1609,8 @@ public void _SVGGeometryElement_SVGLineElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _SVGGeometryElement_SVGPathElement() throws Exception { test("SVGGeometryElement", "SVGPathElement"); } @@ -1628,7 +1620,9 @@ public void _SVGGeometryElement_SVGPathElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGPolygonElement() throws Exception { test("SVGGeometryElement", "SVGPolygonElement"); } @@ -1638,7 +1632,9 @@ public void _SVGGeometryElement_SVGPolygonElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGPolylineElement() throws Exception { test("SVGGeometryElement", "SVGPolylineElement"); } @@ -1648,7 +1644,9 @@ public void _SVGGeometryElement_SVGPolylineElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF68 = "true") + @NotYetImplemented(FF60) public void _SVGGeometryElement_SVGRectElement() throws Exception { test("SVGGeometryElement", "SVGRectElement"); } @@ -1690,16 +1688,6 @@ public void _SVGGraphicsElement_SVGAElement() throws Exception { test("SVGGraphicsElement", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _SVGGraphicsElement_SVGAltGlyphElement() throws Exception { - test("SVGGraphicsElement", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -1766,7 +1754,8 @@ public void _SVGGraphicsElement_SVGGElement() throws Exception { */ @Test @Alerts(DEFAULT = "false", - CHROME = "true") + CHROME = "true", + FF = "true") public void _SVGGraphicsElement_SVGGeometryElement() throws Exception { test("SVGGraphicsElement", "SVGGeometryElement"); } @@ -2044,7 +2033,8 @@ public void _SVGPathElement_SVGPathElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSeg() throws Exception { test("SVGPathSeg", "SVGPathSeg"); } @@ -2054,7 +2044,8 @@ public void _SVGPathSeg_SVGPathSeg() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegArcAbs() throws Exception { test("SVGPathSeg", "SVGPathSegArcAbs"); } @@ -2064,7 +2055,8 @@ public void _SVGPathSeg_SVGPathSegArcAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegArcRel() throws Exception { test("SVGPathSeg", "SVGPathSegArcRel"); } @@ -2074,7 +2066,8 @@ public void _SVGPathSeg_SVGPathSegArcRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegClosePath() throws Exception { test("SVGPathSeg", "SVGPathSegClosePath"); } @@ -2084,7 +2077,8 @@ public void _SVGPathSeg_SVGPathSegClosePath() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicAbs"); } @@ -2094,7 +2088,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoCubicAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoCubicRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicRel"); } @@ -2104,7 +2099,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoCubicRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicSmoothAbs"); } @@ -2114,7 +2110,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicSmoothRel"); } @@ -2124,7 +2121,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticAbs"); } @@ -2134,7 +2132,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoQuadraticAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticRel"); } @@ -2144,7 +2143,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoQuadraticRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -2154,7 +2154,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -2164,7 +2165,8 @@ public void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegLinetoAbs() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoAbs"); } @@ -2174,7 +2176,8 @@ public void _SVGPathSeg_SVGPathSegLinetoAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoHorizontalAbs"); } @@ -2184,7 +2187,8 @@ public void _SVGPathSeg_SVGPathSegLinetoHorizontalAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoHorizontalRel"); } @@ -2194,7 +2198,8 @@ public void _SVGPathSeg_SVGPathSegLinetoHorizontalRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegLinetoRel() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoRel"); } @@ -2204,7 +2209,8 @@ public void _SVGPathSeg_SVGPathSegLinetoRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoVerticalAbs"); } @@ -2214,7 +2220,8 @@ public void _SVGPathSeg_SVGPathSegLinetoVerticalAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegLinetoVerticalRel() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoVerticalRel"); } @@ -2224,7 +2231,8 @@ public void _SVGPathSeg_SVGPathSegLinetoVerticalRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegMovetoAbs() throws Exception { test("SVGPathSeg", "SVGPathSegMovetoAbs"); } @@ -2234,7 +2242,8 @@ public void _SVGPathSeg_SVGPathSegMovetoAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSeg_SVGPathSegMovetoRel() throws Exception { test("SVGPathSeg", "SVGPathSegMovetoRel"); } @@ -2244,7 +2253,8 @@ public void _SVGPathSeg_SVGPathSegMovetoRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegArcAbs_SVGPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs", "SVGPathSegArcAbs"); } @@ -2254,7 +2264,8 @@ public void _SVGPathSegArcAbs_SVGPathSegArcAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegArcRel_SVGPathSegArcRel() throws Exception { test("SVGPathSegArcRel", "SVGPathSegArcRel"); } @@ -2264,7 +2275,8 @@ public void _SVGPathSegArcRel_SVGPathSegArcRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegClosePath_SVGPathSegClosePath() throws Exception { test("SVGPathSegClosePath", "SVGPathSegClosePath"); } @@ -2274,7 +2286,8 @@ public void _SVGPathSegClosePath_SVGPathSegClosePath() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoCubicAbs_SVGPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicAbs"); } @@ -2284,7 +2297,8 @@ public void _SVGPathSegCurvetoCubicAbs_SVGPathSegCurvetoCubicAbs() throws Except */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoCubicRel_SVGPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicRel"); } @@ -2294,7 +2308,8 @@ public void _SVGPathSegCurvetoCubicRel_SVGPathSegCurvetoCubicRel() throws Except */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoCubicSmoothAbs_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothAbs"); } @@ -2304,7 +2319,8 @@ public void _SVGPathSegCurvetoCubicSmoothAbs_SVGPathSegCurvetoCubicSmoothAbs() t */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoCubicSmoothRel_SVGPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoCubicSmoothRel"); } @@ -2314,7 +2330,8 @@ public void _SVGPathSegCurvetoCubicSmoothRel_SVGPathSegCurvetoCubicSmoothRel() t */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoQuadraticAbs_SVGPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticAbs"); } @@ -2324,7 +2341,8 @@ public void _SVGPathSegCurvetoQuadraticAbs_SVGPathSegCurvetoQuadraticAbs() throw */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoQuadraticRel_SVGPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticRel"); } @@ -2334,7 +2352,8 @@ public void _SVGPathSegCurvetoQuadraticRel_SVGPathSegCurvetoQuadraticRel() throw */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoQuadraticSmoothAbs_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -2344,7 +2363,8 @@ public void _SVGPathSegCurvetoQuadraticSmoothAbs_SVGPathSegCurvetoQuadraticSmoot */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegCurvetoQuadraticSmoothRel_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -2354,7 +2374,8 @@ public void _SVGPathSegCurvetoQuadraticSmoothRel_SVGPathSegCurvetoQuadraticSmoot */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegLinetoAbs_SVGPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs", "SVGPathSegLinetoAbs"); } @@ -2364,7 +2385,8 @@ public void _SVGPathSegLinetoAbs_SVGPathSegLinetoAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegLinetoHorizontalAbs_SVGPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalAbs"); } @@ -2374,7 +2396,8 @@ public void _SVGPathSegLinetoHorizontalAbs_SVGPathSegLinetoHorizontalAbs() throw */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegLinetoHorizontalRel_SVGPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoHorizontalRel"); } @@ -2384,7 +2407,8 @@ public void _SVGPathSegLinetoHorizontalRel_SVGPathSegLinetoHorizontalRel() throw */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegLinetoRel_SVGPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel", "SVGPathSegLinetoRel"); } @@ -2394,7 +2418,8 @@ public void _SVGPathSegLinetoRel_SVGPathSegLinetoRel() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegLinetoVerticalAbs_SVGPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalAbs"); } @@ -2404,7 +2429,8 @@ public void _SVGPathSegLinetoVerticalAbs_SVGPathSegLinetoVerticalAbs() throws Ex */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegLinetoVerticalRel_SVGPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel", "SVGPathSegLinetoVerticalRel"); } @@ -2424,7 +2450,8 @@ public void _SVGPathSegList_SVGPathSegList() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegMovetoAbs_SVGPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs", "SVGPathSegMovetoAbs"); } @@ -2434,7 +2461,8 @@ public void _SVGPathSegMovetoAbs_SVGPathSegMovetoAbs() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGPathSegMovetoRel_SVGPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel", "SVGPathSegMovetoRel"); } @@ -2593,16 +2621,6 @@ public void _SVGSymbolElement_SVGSymbolElement() throws Exception { test("SVGSymbolElement", "SVGSymbolElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _SVGTextContentElement_SVGAltGlyphElement() throws Exception { - test("SVGTextContentElement", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -2666,16 +2684,6 @@ public void _SVGTextPathElement_SVGTextPathElement() throws Exception { test("SVGTextPathElement", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF45 = "true") - public void _SVGTextPositioningElement_SVGAltGlyphElement() throws Exception { - test("SVGTextPositioningElement", "SVGAltGlyphElement"); - } - /** * @throws Exception if the test fails */ @@ -2773,7 +2781,8 @@ public void _SVGViewElement_SVGViewElement() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _SVGZoomEvent_SVGZoomEvent() throws Exception { test("SVGZoomEvent", "SVGZoomEvent"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java index bd64bbcd3c9..4cbcc9d6cf4 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfTTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ * This class handles all host names which starts by character 'T' to 'V'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfTTest extends HostParentOf { @@ -226,16 +227,6 @@ public void _TransitionEvent_TransitionEvent() throws Exception { test("TransitionEvent", "TransitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _TransitionEvent_WebKitTransitionEvent() throws Exception { - test("TransitionEvent", "WebKitTransitionEvent"); - } - /** * @throws Exception if the test fails */ @@ -324,8 +315,7 @@ public void _UIEvent_MouseWheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF = "false") + @Alerts("true") public void _UIEvent_PointerEvent() throws Exception { test("UIEvent", "PointerEvent"); } @@ -335,7 +325,8 @@ public void _UIEvent_PointerEvent() throws Exception { */ @Test @Alerts(DEFAULT = "true", - CHROME = "false") + CHROME = "false", + FF = "false") public void _UIEvent_SVGZoomEvent() throws Exception { test("UIEvent", "SVGZoomEvent"); } @@ -457,7 +448,7 @@ public void _URLSearchParams_URLSearchParams() throws Exception { */ @Test @Alerts(DEFAULT = "false", - FF = "true") + FF60 = "true") public void _UserProximityEvent_UserProximityEvent() throws Exception { test("UserProximityEvent", "UserProximityEvent"); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java index 67c52f75c2a..56a7e591c87 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/general/huge/HostParentOfWTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ * This class handles all host names which starts by character 'W' to 'Z'. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserParameterizedRunner.class) public class HostParentOfWTest extends HostParentOf { @@ -104,8 +105,7 @@ public void _WEBGL_debug_renderer_info_WEBGL_debug_renderer_info() throws Except */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebGL2RenderingContext_WebGL2RenderingContext() throws Exception { test("WebGL2RenderingContext", "WebGL2RenderingContext"); } @@ -132,8 +132,7 @@ public void _WebGLBuffer_WebGLBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "true", - FF45 = "false") + @Alerts("true") public void _WebGLContextEvent_WebGLContextEvent() throws Exception { test("WebGLContextEvent", "WebGLContextEvent"); } @@ -161,8 +160,7 @@ public void _WebGLProgram_WebGLProgram() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebGLQuery_WebGLQuery() throws Exception { test("WebGLQuery", "WebGLQuery"); } @@ -190,8 +188,7 @@ public void _WebGLRenderingContext_WebGLRenderingContext() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebGLSampler_WebGLSampler() throws Exception { test("WebGLSampler", "WebGLSampler"); } @@ -219,8 +216,7 @@ public void _WebGLShaderPrecisionFormat_WebGLShaderPrecisionFormat() throws Exce */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebGLSync_WebGLSync() throws Exception { test("WebGLSync", "WebGLSync"); } @@ -239,8 +235,7 @@ public void _WebGLTexture_WebGLTexture() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebGLTransformFeedback_WebGLTransformFeedback() throws Exception { test("WebGLTransformFeedback", "WebGLTransformFeedback"); } @@ -259,32 +254,11 @@ public void _WebGLUniformLocation_WebGLUniformLocation() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebGLVertexArrayObject_WebGLVertexArrayObject() throws Exception { test("WebGLVertexArrayObject", "WebGLVertexArrayObject"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _WebKitAnimationEvent_AnimationEvent() throws Exception { - test("WebKitAnimationEvent", "AnimationEvent"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _WebKitAnimationEvent_WebKitAnimationEvent() throws Exception { - test("WebKitAnimationEvent", "WebKitAnimationEvent"); - } - /** * @throws Exception if the test fails */ @@ -301,8 +275,7 @@ public void _WebKitCSSMatrix_DOMMatrix() throws Exception { */ @Test @Alerts(DEFAULT = "true", - IE = "false", - FF45 = "false") + IE = "false") public void _WebKitCSSMatrix_WebKitCSSMatrix() throws Exception { test("WebKitCSSMatrix", "WebKitCSSMatrix"); } @@ -419,26 +392,6 @@ public void _webkitSpeechRecognitionEvent_webkitSpeechRecognitionEvent() throws test("webkitSpeechRecognitionEvent", "webkitSpeechRecognitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _WebKitTransitionEvent_TransitionEvent() throws Exception { - test("WebKitTransitionEvent", "TransitionEvent"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true") - public void _WebKitTransitionEvent_WebKitTransitionEvent() throws Exception { - test("WebKitTransitionEvent", "WebKitTransitionEvent"); - } - /** * @throws Exception if the test fails */ diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java index c86b42061f7..304df2aae42 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import com.gargoylesoftware.htmlunit.MockWebConnection; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebTestCase; +import com.gargoylesoftware.htmlunit.html.parser.HTMLParser; import junit.framework.Test; import junit.framework.TestCase; @@ -145,6 +146,7 @@ public static Test suite() throws Exception { } supportedTags.remove("keygen"); + supportedTags.remove("input"); if (!supportedTags.isEmpty()) { throw new RuntimeException("Missing tag class(es) " + supportedTags); @@ -258,22 +260,23 @@ protected void runTest() throws Exception { * @throws Exception if the new object cannot be created */ private DomElement getNewInstanceForClassUnderTest(final HtmlPage page) throws Exception { + final HTMLParser htmlParser = page.getWebClient().getPageCreator().getHtmlParser(); final DomElement newInstance; if (classUnderTest_ == HtmlTableRow.class) { - newInstance = HTMLParser.getFactory(HtmlTableRow.TAG_NAME).createElement( - page, HtmlTableRow.TAG_NAME, null); + newInstance = htmlParser.getFactory(HtmlTableRow.TAG_NAME) + .createElement(page, HtmlTableRow.TAG_NAME, null); } else if (classUnderTest_ == HtmlTableHeaderCell.class) { - newInstance = HTMLParser.getFactory(HtmlTableHeaderCell.TAG_NAME).createElement( - page, HtmlTableHeaderCell.TAG_NAME, null); + newInstance = htmlParser.getFactory(HtmlTableHeaderCell.TAG_NAME) + .createElement(page, HtmlTableHeaderCell.TAG_NAME, null); } else if (classUnderTest_ == HtmlTableDataCell.class) { - newInstance = HTMLParser.getFactory(HtmlTableDataCell.TAG_NAME).createElement( - page, HtmlTableDataCell.TAG_NAME, null); + newInstance = htmlParser.getFactory(HtmlTableDataCell.TAG_NAME) + .createElement(page, HtmlTableDataCell.TAG_NAME, null); } else { final String tagName = (String) classUnderTest_.getField("TAG_NAME").get(null); - newInstance = HTMLParser.getFactory(tagName).createElement(page, tagName, null); + newInstance = htmlParser.getFactory(tagName).createElement(page, tagName, null); } return newInstance; diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement2Test.java index b693f7df4fe..8a891106b91 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElement2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,6 +59,24 @@ public void windowEventListenersContainer() throws Exception { + ""; final WebDriver driver = loadPage2(html); - assertEquals(getExpectedAlerts()[0], driver.getTitle()); + assertTitle(driver, getExpectedAlerts()[0]); + } + + /** + * @throws Exception if the test fails + */ + @Test + public void doNotLoopEndless() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + ""; + + getMockWebConnection().setDefaultResponse(html); + + loadPage2(html); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElementTest.java index 7c8c40f18b3..07229e56e45 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/BaseFrameElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElement2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElement2Test.java index 7fcc42ac0c8..1339222e559 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElement2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElement2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; - import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -25,7 +22,6 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; -import com.gargoylesoftware.htmlunit.BrowserRunner.BuggyWebDriver; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -64,7 +60,6 @@ public void clickOnFocus() throws Exception { */ @Test @Alerts("click click dblclick ") - @BuggyWebDriver({CHROME, FF}) public void dblClick() throws Exception { final String content = "\n" + "\n" diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElementTest.java index 336db78c28c..3fdbd3e69d9 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/ClickableElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; - import java.util.ArrayList; import java.util.List; @@ -578,7 +576,7 @@ public void object_onClick() throws Exception { @Test @Alerts(DEFAULT = "foo", IE = "") - @BuggyWebDriver(CHROME) + @BuggyWebDriver(CHROME = "") // ChromeDriver does not generate a "foo" but it occurs manually public void option_onClick() throws Exception { final String htmlContent = "foo\n" diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactoryTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactoryTest.java index 35e616204b7..f76d5ee308e 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactoryTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DefaultElementFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DisabledElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DisabledElementTest.java index 46917acea89..222f4f81fd1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DisabledElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DisabledElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomAttrTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomAttrTest.java index c675313336a..6f7a86af3e6 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomAttrTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomAttrTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomCommentTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomCommentTest.java index 57e306814b4..38a7609270f 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomCommentTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomCommentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragmentTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragmentTest.java index 7a918066848..e162afb1c7d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragmentTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomDocumentFragmentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomElement2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomElement2Test.java index 35a59a230fe..c0f32841ad2 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomElement2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomElement2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.SimpleWebTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.xml.XmlPage; /** @@ -94,7 +95,7 @@ public void getChildElements() throws Exception { final String xml = "\n" + " \n" + ""; - getMockWebConnection().setDefaultResponse(xml, "text/xml"); + getMockWebConnection().setDefaultResponse(xml, MimeType.TEXT_XML); getWebClient().setWebConnection(getMockWebConnection()); final XmlPage page = getWebClient().getPage(URL_FIRST); final DomElement root = page.getDocumentElement(); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomElementTest.java index 6bd61c5466b..b2bc449d39b 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNodeTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNodeTest.java index 38a36d25903..4f7706cf115 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNodeTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNamespaceNodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNode2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNode2Test.java index 46c95302a4a..82111c2ed1d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNode2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNode2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator2Test.java new file mode 100644 index 00000000000..35dbf50ccd5 --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIterator2Test.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.w3c.dom.traversal.NodeFilter; +import org.w3c.dom.traversal.NodeIterator; + +import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.SimpleWebTestCase; + +/** + * Tests for {@link DomNodeIterator}. + * + * @author Ahmed Ashour + * @author Ronald Brill + */ +@RunWith(BrowserRunner.class) +public final class DomNodeIterator2Test extends SimpleWebTestCase { + + /** + * Test case for issue 1982. + * @throws Exception if the test fails + */ + @Test + public void subroot() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
    1112
    2122
    \n" + + ""; + + final HtmlPage page = loadPage(html); + + final HtmlElement subroot = (HtmlElement) page.getElementById("1"); + final NodeIterator iterator = page.createNodeIterator(subroot, NodeFilter.SHOW_ELEMENT, null, true); + + HtmlElement element = (HtmlElement) iterator.nextNode(); + Assert.assertEquals("1", element.getId()); + + element = (HtmlElement) iterator.nextNode(); + Assert.assertEquals("11", element.getId()); + + element = (HtmlElement) iterator.nextNode(); + Assert.assertEquals("12", element.getId()); + + Assert.assertNull(iterator.nextNode()); + } +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIteratorTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIteratorTest.java index 0756f313616..cd64123413a 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIteratorTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeIteratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; +import org.w3c.dom.traversal.NodeFilter; import org.w3c.dom.traversal.NodeIterator; import com.gargoylesoftware.htmlunit.BrowserRunner; @@ -31,6 +32,7 @@ * Tests for {@link DomNodeIterator}. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public final class DomNodeIteratorTest extends WebDriverTestCase { @@ -55,8 +57,7 @@ public void nextNode() throws Exception { if (driver instanceof HtmlUnitDriver) { final WebWindow webWindow = getWebWindowOf((HtmlUnitDriver) driver); final HtmlPage page = (HtmlPage) webWindow.getEnclosedPage(); - final NodeIterator iterator = page.createNodeIterator(page.getDocumentElement(), - org.w3c.dom.traversal.NodeFilter.SHOW_ALL, null, + final NodeIterator iterator = page.createNodeIterator(page.getDocumentElement(), NodeFilter.SHOW_ALL, null, true); assertThat(iterator.nextNode(), instanceOf(HtmlHtml.class)); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeListTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeListTest.java index 8b5691bcc86..116fc62e8a0 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeListTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeListTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java index 28e6c4f76ef..4e35a186462 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomNodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import com.gargoylesoftware.htmlunit.SimpleWebTestCase; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.DomNode.DescendantElementsIterator; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.xml.XmlPage; /** @@ -190,8 +191,9 @@ public void replace() throws Exception { final DomNode node2 = page.getHtmlElementById("tag2"); assertEquals("div", node2.getNodeName()); - final DomNode node3 = HTMLParser.getFactory(HtmlSpan.TAG_NAME).createElement( - page, HtmlSpan.TAG_NAME, attributes); + final DomNode node3 = page.getWebClient().getPageCreator().getHtmlParser() + .getFactory(HtmlSpan.TAG_NAME) + .createElement(page, HtmlSpan.TAG_NAME, attributes); node2.replace(node3); assertEquals("span", page.getHtmlElementById("tag2").getTagName()); } @@ -210,8 +212,9 @@ public void getNewNodeById() throws Exception { final AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute(null, "id", "id", null, "newElt"); - final DomNode newNode = HTMLParser.getFactory(HtmlDivision.TAG_NAME).createElement( - page, HtmlDivision.TAG_NAME, attributes); + final DomNode newNode = page.getWebClient().getPageCreator().getHtmlParser() + .getFactory(HtmlDivision.TAG_NAME) + .createElement(page, HtmlDivision.TAG_NAME, attributes); try { page.getHtmlElementById("newElt"); fail("Element should not exist yet"); @@ -319,10 +322,20 @@ private static int readPositionAmongParentChildren(final DomNode node) { @Test public void getByXPath() throws Exception { final String htmlContent - = "my title\n" - + "
    • foo 1
    • foo 2
    \n" - + "
    bla
    \n" - + ""; + = "\n" + + " \n" + + " my title\n" + + " " + + " \n" + + "
    \n" + + "
      \n" + + "
    • foo 1
    • \n" + + "
    • foo 2
    • \n" + + "
    \n" + + "
    \n" + + "
    bla
    \n" + + "\n" + + ""; final HtmlPage page = loadPage(htmlContent); final List results = page.getByXPath("//title"); @@ -345,6 +358,31 @@ public void getByXPath() throws Exception { assertEquals(2, div.getFirstByXPath("count(//li)").intValue()); } + /** + * @throws Exception if the test fails + */ + @Test + public void getByXPathSelectedNode() throws Exception { + final String htmlContent + = "\n" + + " \n" + + " my title\n" + + " " + + " \n" + + "

    HtmlUnit

    \n" + + "
    \n" + + "

    HtmlUnit

    \n" + + "
    \n" + + "\n" + + ""; + final HtmlPage page = loadPage(htmlContent); + + final HtmlDivision divNode = (HtmlDivision) page.getElementById("d1"); + + assertEquals(page.getElementById("h1"), divNode.getByXPath(".//h1").get(0)); + assertEquals(page.getElementById("outer_h1"), divNode.getByXPath("//h1").get(0)); + } + /** * Regression test for bug #1149: xmlns value has to be trimmed. * @throws Exception if the test fails @@ -361,6 +399,32 @@ public void getByXPath_trim_namespace() throws Exception { assertEquals(1, results.size()); } + /** + * Make sure display: none has no effect for xpath expressions. + * @throws Exception if the test fails + */ + @Test + public void getFirstByXPathDisplayNone() throws Exception { + final String htmlContent + = "\n" + + " \n" + + " my title\n" + + " " + + " \n" + + "
    bla
    \n" + + "\n" + + ""; + final HtmlPage page = loadPage(htmlContent); + + HtmlElement span = page.getFirstByXPath("//div/span"); + assertEquals("\r\n bla\r\n\r\n", span.asXml()); + assertFalse(span.isDisplayed()); + + span = page.getFirstByXPath("//span[text()=\"bla\"]"); + assertEquals("\r\n bla\r\n\r\n", span.asXml()); + assertFalse(span.isDisplayed()); + } + /** * @throws Exception if the test fails */ @@ -621,7 +685,7 @@ public void getByXPath_XML() throws Exception { + " \n" + ""; - getMockWebConnection().setResponse(URL_FIRST, xml, "text/xml"); + getMockWebConnection().setResponse(URL_FIRST, xml, MimeType.TEXT_XML); final WebClient client = getWebClientWithMockWebConnection(); final XmlPage page = (XmlPage) client.getPage(URL_FIRST); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomTextTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomTextTest.java index 1d5be946af6..e31ba448fd8 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomTextTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,9 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.MockWebConnection; import com.gargoylesoftware.htmlunit.SimpleWebTestCase; -import com.gargoylesoftware.htmlunit.TextUtil; import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.util.MimeType; +import com.gargoylesoftware.htmlunit.util.TextUtils; /** * Tests for {@link DomText}. @@ -161,7 +162,7 @@ public void asXml() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - webConnection.setDefaultResponse(TextUtil.stringToByteArray(html, UTF_8), 200, "OK", "text/html"); + webConnection.setDefaultResponse(TextUtils.stringToByteArray(html, UTF_8), 200, "OK", MimeType.TEXT_HTML); client.setWebConnection(webConnection); final HtmlPage page = client.getPage(URL_FIRST); diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/DomTreeWalkerTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/DomTreeWalkerTest.java index 9598dddd0de..ed7b8832d5e 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/DomTreeWalkerTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/DomTreeWalkerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/FocusableElement2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/FocusableElement2Test.java index f6a581ea9c2..98478d048c1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/FocusableElement2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/FocusableElement2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -255,8 +255,8 @@ public void focusOnNonFocusableElementShouldNotTriggerDocumentFocus() throws Exc * @throws Exception if the test fails */ @Test - @BuggyWebDriver(IE) @Alerts({"input1", "focus1", "div", "input2", "blur1", "focus2"}) + @BuggyWebDriver(IE = {"input1", "div", "input2", "focus1", "blur1", "focus2"}) public void focusOnNonFocusableElementShouldNotChangeCurrentFocus() throws Exception { final String html = "\n" + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInputTest.java index 3f062bd35a6..74ec086480f 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonTest.java index 0d47726f362..65f6eb5f780 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlButtonTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCanvasTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCanvasTest.java index 693ff7ad012..31188c7d956 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCanvasTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCanvasTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCaptionTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCaptionTest.java index cc78b13389f..68edee88752 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCaptionTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCaptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput2Test.java index 4fb87589084..ef371ca392b 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInput2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -534,7 +534,7 @@ public void setChecked() throws Exception { final WebDriver driver = loadPage2(firstHtml); driver.findElement(By.id("myCheckbox")).click(); - assertEquals(getExpectedAlerts()[0], driver.getTitle()); + assertTitle(driver, getExpectedAlerts()[0]); } /** @@ -558,7 +558,7 @@ public void setChecked2() throws Exception { final WebDriver driver = loadPage2(firstHtml); driver.findElement(By.id("myCheckbox")).click(); - assertEquals(getExpectedAlerts()[0], driver.getTitle()); + assertTitle(driver, getExpectedAlerts()[0]); } /** @@ -975,4 +975,29 @@ public void defaultCheckedAttribute() throws Exception { loadPageWithAlerts2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("--") + public void minMaxStep() throws Exception { + final String html = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInputTest.java index 4a8062dec55..9ce41a8c229 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlCheckBoxInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput2Test.java new file mode 100644 index 00000000000..297238a3ea8 --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInput2Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.SimpleWebTestCase; + +/** + * Tests for {@link HtmlColorInput}. + * + * @author Ronald Brill + */ +@RunWith(BrowserRunner.class) +public class HtmlColorInput2Test extends SimpleWebTestCase { + + /** + * Verifies that a asText() returns the value string. + * @throws Exception if the test fails + */ + @Test + @Alerts("#ff0000") + public void asText() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final HtmlPage page = loadPage(html); + assertEquals(getExpectedAlerts()[0], page.getBody().asText()); + } +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInputTest.java index 4f191349ad4..2bd6c313241 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlColorInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,10 @@ import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.htmlunit.HtmlUnitDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** @@ -32,20 +34,149 @@ public class HtmlColorInputTest extends WebDriverTestCase { /** - * Verifies that a asText() returns the value string. * @throws Exception if the test fails */ @Test - public void asText() throws Exception { + @Alerts(DEFAULT = {"#000000--null", "#000000--null", "#000000--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValues() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"#000000--null", "#000000--null", "#000000--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValuesAfterClone() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * Verifies getVisibleText(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void getVisibleText() throws Exception { final String htmlContent - = "foo\n" + = "\n" + + "\n" + + "\n" + "
    \n" - + " \n" - + "
    "; + + " \n" + + "\n" + + ""; final WebDriver driver = loadPage2(htmlContent); + final String text = driver.findElement(By.id("tester")).getText(); + assertEquals(getExpectedAlerts()[0], text); + + if (driver instanceof HtmlUnitDriver) { + final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); + assertEquals(getExpectedAlerts()[0], page.getBody().getVisibleText()); + } + } + + /** + * Verifies clear(). + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "#000000", + IE = "") + public void clearInput() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final WebElement element = driver.findElement(By.id("tester")); + + element.clear(); + assertEquals(getExpectedAlerts()[0], element.getAttribute("value")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("--") + public void minMaxStep() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; - final WebElement input = driver.findElement(By.id("foo")); - assertEquals("", input.getText()); + loadPageWithAlerts2(html); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateInputTest.java index be43adee838..866440b4d82 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,25 +16,102 @@ import org.junit.Test; import org.junit.runner.RunWith; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.BrowserRunner.BuggyWebDriver; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import org.openqa.selenium.WebElement; /** * Tests for {@link HtmlDateInput}. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class HtmlDateInputTest extends WebDriverTestCase { + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"--null", "--null", "--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValues() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"--null", "--null", "--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValuesAfterClone() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + /** * @throws Exception if an error occurs */ @Test @Alerts(DEFAULT = {"text-datetime", "text-Date"}, - CHROME = {"text-datetime", "date-Date"}) + CHROME = {"text-datetime", "date-Date"}, + FF = {"text-datetime", "date-Date"}) public void type() throws Exception { final String html = "\n" @@ -56,4 +133,79 @@ public void type() throws Exception { loadPageWithAlerts2(html); } + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts("2018-03-22") + @BuggyWebDriver(CHROME = "80322-02-01", + IE = "") + public void typeInto() throws Exception { + final String html = + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + ""; + + final WebDriver driver = loadPage2(html); + driver.findElement(By.id("input")).sendKeys("2018-03-22"); + driver.findElement(By.id("tester")).click(); + + verifyAlerts(driver, getExpectedAlerts()); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts("") + public void clearInput() throws Exception { + final String html = + "\n" + + "\n" + + " \n" + + ""; + + final WebDriver driver = loadPage2(html); + final WebElement input = driver.findElement(By.id("input")); + + assertEquals("2018-03-22", input.getAttribute("value")); + + input.clear(); + assertEquals("", input.getAttribute("value")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("--") + public void minMaxStep() throws Exception { + final String html = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInputTest.java new file mode 100644 index 00000000000..06d28a9c7d9 --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDateTimeLocalInputTest.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.htmlunit.HtmlUnitDriver; + +import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.WebDriverTestCase; + +/** + * Tests for {@link HtmlDateTimeLocalInput}. + * + * @author Ronald Brill + */ +@RunWith(BrowserRunner.class) +public class HtmlDateTimeLocalInputTest extends WebDriverTestCase { + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"--null", "--null", "--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValues() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"--null", "--null", "--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValuesAfterClone() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * Verifies getVisibleText(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void getVisibleText() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final String text = driver.findElement(By.id("tester")).getText(); + assertEquals(getExpectedAlerts()[0], text); + + if (driver instanceof HtmlUnitDriver) { + final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); + assertEquals(getExpectedAlerts()[0], page.getBody().getVisibleText()); + } + } + + /** + * Verifies clear(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void clearInput() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final WebElement element = driver.findElement(By.id("tester")); + + element.clear(); + assertEquals(getExpectedAlerts()[0], element.getAttribute("value")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("--") + public void minMaxStep() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescriptionTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescriptionTest.java index 2ba889d89f6..1a21e8f53f2 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescriptionTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionDescriptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionListTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionListTest.java index 2395649e14d..59d7de0dcde 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionListTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionListTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDirectoryTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDirectoryTest.java index c882e7fbe75..8b568e20977 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDirectoryTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDirectoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivision2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivision2Test.java index 367ff1c6729..9a86c3637d2 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivision2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivision2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivisionTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivisionTest.java index c9103ccfce9..1e9238889a2 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivisionTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlDivisionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElement2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElement2Test.java index 0de05e50a76..85b1a57a590 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElement2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElement2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import org.junit.Test; @@ -184,7 +183,10 @@ public void contentEditable() throws Exception { FF = "down: 16,0 down: 49,0 press: 0,33 up: 49,0 up: 16,0" + " down: 16,0 down: 220,0 press: 0,124 up: 220,0 up: 16,0") //https://github.com/SeleniumHQ/selenium/issues/639 - @BuggyWebDriver(FF) + @BuggyWebDriver(FF60 = "down: 49,0 press: 0,33 up: 49,0 down: 220,0 press: 0,124 up: 220,0", + FF68 = "down: 49,0 press: 33,33 up: 49,0 down: 220,0 press: 124,124 up: 220,0", + IE = "down: 16,0 down: 49,0 press: 33,33 up: 49,0 up: 16,0 down: 17,0 " + + "down: 18,0 down: 226,0 press: 124,124 up: 226,0 up: 17,0 up: 18,0") public void shiftKeys() throws Exception { final String html = "\n" + + "\n" + + " \n" + + "
    Hello
    \n" + + ""; + + final WebDriver driver = loadPage2(html); + final WebElement div = driver.findElement(By.id("myInput")); + div.sendKeys("-world"); + + assertEquals(getExpectedAlerts()[0], div.getText()); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts("Hello-world") + @BuggyWebDriver(FF = "-worldHello") + public void typeAtEndOfEditableDivWithParagraphInside() throws Exception { + final String html = "\n" + + "\n" + + " \n" + + "

    Hello

    \n" + + ""; + + final WebDriver driver = loadPage2(html); + final WebElement div = driver.findElement(By.id("myInput")); + div.sendKeys("-world"); + + assertEquals(getExpectedAlerts()[0], div.getText()); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java index 40d6f387074..29e967dc689 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -814,7 +814,7 @@ public void mouseUp() throws Exception { */ @Test @Alerts(DEFAULT = "mousedown-2-mouseup-2-contextmenu-2-", - FF = "mousedown-3-mouseup-3-contextmenu-3-") + FF60 = "mousedown-3-mouseup-3-contextmenu-3-") public void rightClick() throws Exception { final String html = "\n" + "\n" @@ -852,7 +852,7 @@ public void rightClick() throws Exception { */ @Test @Alerts(DEFAULT = "mousedown-0-mouseup-0-", - FF = "mousedown-1-mouseup-1-") + FF60 = "mousedown-1-mouseup-1-") public void mouse_Down_Up() throws Exception { final String html = "\n" + "\n" diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java index 4062e23c706..22d06bc159d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInput2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,4 +49,29 @@ public void typingAndClone() throws Exception { input.type("abc@email.com"); assertEquals("abc@email.com", input.getValueAttribute()); } + + /** + * @throws Exception if the test fails + */ + @Test + public void typingAndReset() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final HtmlPage page = loadPage(htmlContent); + + final HtmlEmailInput input = (HtmlEmailInput) page.getElementById("foo"); + + input.type("abc@email.com"); + input.reset(); + input.type("xyz@email.com"); + + assertEquals("xyz@email.com", input.getValueAttribute()); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInputTest.java index ab7699ce067..9d7e60b2804 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmailInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,18 +19,139 @@ import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.htmlunit.HtmlUnitDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.WebDriverTestCase; /** * Tests for {@link HtmlEmailInput}. * * @author Ahmed Ashour + * @author Ronald Brill */ @RunWith(BrowserRunner.class) public class HtmlEmailInputTest extends WebDriverTestCase { + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"--null", "--null", "--null"}) + public void defaultValues() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"--null", "--null", "--null"}) + public void defaultValuesAfterClone() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * Verifies getVisibleText(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void getVisibleText() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final String text = driver.findElement(By.id("tester")).getText(); + assertEquals(getExpectedAlerts()[0], text); + + if (driver instanceof HtmlUnitDriver) { + final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); + assertEquals(getExpectedAlerts()[0], page.getBody().getVisibleText()); + } + } + + /** + * Verifies clear(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void clearInput() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final WebElement element = driver.findElement(By.id("tester")); + + element.clear(); + assertEquals(getExpectedAlerts()[0], element.getAttribute("value")); + } + /** * @throws Exception if the test fails */ @@ -48,4 +169,29 @@ public void typing() throws Exception { input.sendKeys("hello"); assertEquals("hello", input.getAttribute("value")); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("--") + public void minMaxStep() throws Exception { + final String html = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmbedTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmbedTest.java index 53539e34bc8..f8fe58b4408 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmbedTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlEmbedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,7 @@ public void saveAs() throws Exception { final File file = new File(System.getProperty("user.home"), "htmlunit-embed.bin"); element.saveAs(file); final long length = file.length(); - file.delete(); + assertTrue(file.delete()); assertTrue(length > 0); } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSetTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSetTest.java index 36fe24756f3..1bd8bbfac03 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSetTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFieldSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput2Test.java index ffe958670bc..8b2c1ac8397 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInput2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,6 +61,7 @@ import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebServerTestCase; import com.gargoylesoftware.htmlunit.util.KeyDataPair; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link HtmlFileInput}. @@ -78,10 +79,13 @@ public class HtmlFileInput2Test extends WebServerTestCase { */ @Test public void fileInput() throws Exception { - String path = getClass().getClassLoader().getResource("testfiles/" + "tiny-png.img").getPath(); - final File file = new File(path); + final URL fileURL = getClass().getClassLoader().getResource("testfiles/tiny-png.img"); + final File file = new File(fileURL.toURI()); + assertTrue("File '" + file.getAbsolutePath() + "' does not exist", file.exists()); + testFileInput(file); + String path = fileURL.getPath(); if (path.startsWith("file:")) { path = path.substring("file:".length()); } @@ -329,16 +333,28 @@ public void contentType() throws Exception { final HtmlFileInput fileInput = f.getInputByName("image"); final URL fileURL = getClass().getClassLoader().getResource("testfiles/empty.png"); + final File file = new File(fileURL.toURI()); + assertTrue("File '" + file.getAbsolutePath() + "' does not exist", file.exists()); - fileInput.setFiles(new File(fileURL.getPath())); + fileInput.setFiles(file); f.getInputByName("mysubmit").click(); - final KeyDataPair pair = (KeyDataPair) webConnection.getLastParameters().get(0); + + assertEquals(2, webConnection.getLastParameters().size()); + KeyDataPair pair = (KeyDataPair) webConnection.getLastParameters().get(0); + if ("mysubmit".equals(pair.getName())) { + pair = (KeyDataPair) webConnection.getLastParameters().get(1); + } assertNotNull(pair.getFile()); assertFalse("Content type: " + pair.getMimeType(), "text/webtest".equals(pair.getMimeType())); fileInput.setContentType("text/webtest"); f.getInputByName("mysubmit").click(); - final KeyDataPair pair2 = (KeyDataPair) webConnection.getLastParameters().get(0); + + assertEquals(2, webConnection.getLastParameters().size()); + KeyDataPair pair2 = (KeyDataPair) webConnection.getLastParameters().get(0); + if ("mysubmit".equals(pair2.getName())) { + pair2 = (KeyDataPair) webConnection.getLastParameters().get(1); + } assertNotNull(pair2.getFile()); assertEquals("text/webtest", pair2.getMimeType()); } @@ -354,9 +370,10 @@ public void contentType() throws Exception { @Test public void uploadFileWithNonASCIIName_HttpClient() throws Exception { final String filename = "\u6A94\u6848\uD30C\uC77C\u30D5\u30A1\u30A4\u30EB\u0645\u0644\u0641.txt"; - final String path = getClass().getClassLoader().getResource(filename).toExternalForm(); - final File file = new File(new URI(path)); - assertTrue(file.exists()); + final URL fileURL = getClass().getClassLoader().getResource(filename); + assertNotNull("Resource '" + filename + "' not found", fileURL); + final File file = new File(fileURL.toURI()); + assertTrue("File '" + file.getAbsolutePath() + "' does not exist", file.exists()); final Map> servlets = new HashMap<>(); servlets.put("/upload2", Upload2Servlet.class); @@ -395,9 +412,9 @@ public void uploadFileWithNonASCIIName() throws Exception { startWebServer("./", null, servlets); final String filename = "\u6A94\u6848\uD30C\uC77C\u30D5\u30A1\u30A4\u30EB\u0645\u0644\u0641.txt"; - final String path = getClass().getClassLoader().getResource(filename).toExternalForm(); - final File file = new File(new URI(path)); - assertTrue(file.exists()); + final URL fileURL = getClass().getClassLoader().getResource(filename); + final File file = new File(fileURL.toURI()); + assertTrue("File '" + file.getAbsolutePath() + "' does not exist", file.exists()); final WebClient client = getWebClient(); final HtmlPage firstPage = client.getPage(URL_FIRST + "upload1"); @@ -429,7 +446,7 @@ public static class Upload1Servlet extends HttpServlet { protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); + response.setContentType(MimeType.TEXT_HTML); response.getWriter().write("\n" + "
    \n" + "Name:
    \n" @@ -451,7 +468,7 @@ public static class Upload2Servlet extends HttpServlet { protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); + response.setContentType(MimeType.TEXT_HTML); final Writer writer = response.getWriter(); if (ServletFileUpload.isMultipartContent(request)) { try { @@ -527,7 +544,7 @@ public static class Multiple1Servlet extends HttpServlet { protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); + response.setContentType(MimeType.TEXT_HTML); response.getWriter().write("\n" + "\n" + "Name:
    \n" @@ -548,7 +565,7 @@ public static class PrintRequestServlet extends HttpServlet { protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); + response.setContentType(MimeType.TEXT_HTML); final Writer writer = response.getWriter(); final BufferedReader reader = request.getReader(); String line; @@ -587,9 +604,7 @@ public void onchangeMultiple() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = {"C:\\fakepath\\pom.xml-Hello world-Hello world", - ""}, - FF = {"pom.xml-Hello world-Hello world", + @Alerts({"C:\\fakepath\\pom.xml-Hello world-Hello world", ""}) public void value() throws Exception { final String html = diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInputTest.java index a3dd4c8a365..7285da66f2e 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFileInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,10 +44,11 @@ import org.openqa.selenium.ie.InternetExplorerDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; -import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.WebDriverTestCase; import com.gargoylesoftware.htmlunit.WebRequest; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link HtmlFileInput}. @@ -132,12 +133,22 @@ public void contentTypeJpg() throws Exception { contentType("jpg"); } + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts({"CONTENT_TYPE:image/png", "charset"}) + public void contentTypePng() throws Exception { + contentType("png"); + } + /** * @throws Exception if an error occurs */ @Test @Alerts(DEFAULT = {"CONTENT_TYPE:application/octet-stream", "charset"}, - CHROME = {"CONTENT_TYPE:image/webp", "charset"}) + CHROME = {"CONTENT_TYPE:image/webp", "charset"}, + FF68 = {"CONTENT_TYPE:image/webp", "charset"}) public void contentTypeWebp() throws Exception { contentType("webp"); } @@ -254,10 +265,8 @@ public void contentTypeWav() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = {"CONTENT_TYPE:audio/flac", "charset"}, - FF45 = {"CONTENT_TYPE:audio/x-flac", "charset"}, - FF52 = {"CONTENT_TYPE:application/octet-stream", "charset"}, - IE = {"CONTENT_TYPE:application/octet-stream", "charset"}) + @Alerts(DEFAULT = {"CONTENT_TYPE:application/octet-stream", "charset"}, + CHROME = {"CONTENT_TYPE:audio/flac", "charset"}) public void contentTypeFlac() throws Exception { contentType("flac"); } @@ -337,7 +346,7 @@ private void contentType(final String extension) throws Exception { driver.findElement(By.id("mySubmit")).click(); } finally { - tmpFile.delete(); + assertTrue(tmpFile.delete()); } final String pageSource = driver.getPageSource(); @@ -357,7 +366,7 @@ public static class Upload1Servlet extends HttpServlet { protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); + response.setContentType(MimeType.TEXT_HTML); response.getWriter().write("\n" + "\n" + "\n" @@ -381,22 +390,23 @@ public static class ContentTypeUpload2Servlet extends HttpServlet { protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); - final Writer writer = response.getWriter(); - if (ServletFileUpload.isMultipartContent(request)) { - try { - final ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory()); - for (final FileItem item : upload.parseRequest(request)) { - if ("myInput".equals(item.getFieldName())) { - writer.write("CONTENT_TYPE:" + item.getContentType()); + response.setContentType(MimeType.TEXT_HTML); + try (Writer writer = response.getWriter()) { + if (ServletFileUpload.isMultipartContent(request)) { + try { + final ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory()); + for (final FileItem item : upload.parseRequest(request)) { + if ("myInput".equals(item.getFieldName())) { + writer.write("CONTENT_TYPE:" + item.getContentType()); + } } } - } - catch (final FileUploadBase.SizeLimitExceededException e) { - writer.write("SizeLimitExceeded"); - } - catch (final Exception e) { - writer.write("error"); + catch (final FileUploadBase.SizeLimitExceededException e) { + writer.write("SizeLimitExceeded"); + } + catch (final Exception e) { + writer.write("error"); + } } } } @@ -416,12 +426,12 @@ public void contentTypeHeader() throws Exception { + "\n" + "
    \n" + "\n"; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final WebDriver driver = loadPage2(htmlContent); String path = getClass().getClassLoader().getResource("realm.properties").toExternalForm(); - if (driver instanceof InternetExplorerDriver || driver instanceof ChromeDriver) { - path = path.substring(path.indexOf('/') + 1).replace('/', '\\'); - } + path = path.substring(path.indexOf('/') + 1).replace('/', '\\'); + driver.findElement(By.name("myInput")).sendKeys(path); driver.findElement(By.id("mySubmit")).click(); @@ -446,6 +456,7 @@ public void empty() throws Exception { + "\n" + "\n" + "\n"; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final WebDriver driver = loadPage2(htmlContent); driver.findElement(By.id("mySubmit")).click(); @@ -474,13 +485,13 @@ public void realFile() throws Exception { + "\n" + "\n" + "\n"; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final WebDriver driver = loadPage2(htmlContent); String path = getClass().getClassLoader().getResource("realm.properties").toExternalForm(); - if (driver instanceof InternetExplorerDriver || driver instanceof ChromeDriver) { - path = path.substring(path.indexOf('/') + 1).replace('/', '\\'); - } + path = path.substring(path.indexOf('/') + 1).replace('/', '\\'); + driver.findElement(By.name("myInput")).sendKeys(path); driver.findElement(By.id("mySubmit")).click(); @@ -503,6 +514,7 @@ public void chunked() throws Exception { + "\n" + "\n" + "\n"; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); final WebDriver driver = loadPage2(htmlContent); @@ -827,9 +839,8 @@ public void textLength() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = {"ex start", "ex end", "exception"}, - CHROME = {"null", "null", "0"}, - FF52 = {"null", "null", "0"}) + @Alerts(DEFAULT = {"null", "null", "0"}, + IE = {"ex start", "ex end", "exception"}) public void selection() throws Exception { final String html = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFontTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFontTest.java index 94426605021..c9fd29a79a5 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFontTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFontTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlForm2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlForm2Test.java index e8594dd207c..0158f478a35 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlForm2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlForm2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; @@ -41,13 +40,13 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; -import com.gargoylesoftware.htmlunit.BrowserRunner.BuggyWebDriver; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.FormEncodingType; import com.gargoylesoftware.htmlunit.HttpHeader; import com.gargoylesoftware.htmlunit.HttpMethod; import com.gargoylesoftware.htmlunit.MockWebConnection; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; import com.gargoylesoftware.htmlunit.util.UrlUtils; @@ -144,7 +143,7 @@ public void asFunction() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = {"TypeError"}, + @Alerts(DEFAULT = "TypeError", IE = {"textfieldid", "textfieldname", "textfieldid"}) public void asFunctionFormsFunction() throws Exception { final String html @@ -167,35 +166,6 @@ public void asFunctionFormsFunction() throws Exception { loadPageWithAlerts2(html); } - /** - * @throws Exception if the test fails - */ - @Test - public void linkUrlEncoding() throws Exception { - final String html = "\n" - + "foo\n" - + " \n" - + "\n" - + "\n" - + " Click me\n" - + ""; - - final MockWebConnection webConnection = getMockWebConnection(); - webConnection.setDefaultResponse(html, "text/html", ISO_8859_1); - - final WebDriver driver = loadPage2(html); - assertEquals(URL_FIRST.toExternalForm(), driver.getCurrentUrl()); - driver.findElement(By.id("myLink")).click(); - final String linkSuffix; - if (getBrowserVersion().isIE()) { - linkSuffix = "bug.html?k\u00F6nig"; - } - else { - linkSuffix = "bug.html?k%F6nig"; - } - assertEquals(URL_FIRST + linkSuffix, driver.getCurrentUrl()); - } - /** * @throws Exception if the test fails */ @@ -339,11 +309,79 @@ public void encodingSubmit() throws Exception { assertEquals(getExpectedAlerts()[2], requestedParams.get(0).getValue()); } + /** + * Tests the 'Origin' and 'Referer' HTTP header. + * @throws Exception on test failure + */ + @Test + @Alerts({"null", "§§URL§§path?query"}) + public void originRefererHeaderGet() throws Exception { + final String firstHtml + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + final String secondHtml = ""; + + final MockWebConnection webConnection = getMockWebConnection(); + final URL requestUrl = new URL(URL_FIRST, "/path?query"); + webConnection.setResponse(URL_SECOND, secondHtml); + + expandExpectedAlertsVariables(URL_FIRST); + final WebDriver driver = loadPage2(firstHtml, requestUrl); + + driver.findElement(new ById("mySubmit")).click(); + + final Map lastAdditionalHeaders = webConnection.getLastAdditionalHeaders(); + assertEquals(getExpectedAlerts()[0], "" + lastAdditionalHeaders.get(HttpHeader.ORIGIN)); + assertEquals(getExpectedAlerts()[1], "" + lastAdditionalHeaders.get(HttpHeader.REFERER)); + } + + /** + * Tests the 'Origin' HTTP header. + * @throws Exception on test failure + */ + @Test + @Alerts(DEFAULT = {"null", "§§URL§§/path?query"}, + CHROME = {"§§URL§§", "§§URL§§/path?query"}) + public void originRefererHeaderPost() throws Exception { + final String firstHtml + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + final String secondHtml = ""; + + final MockWebConnection webConnection = getMockWebConnection(); + final URL requestUrl = new URL(URL_FIRST, "/path?query"); + webConnection.setResponse(URL_SECOND, secondHtml); + + String url = URL_FIRST.toExternalForm(); + url = url.substring(0, url.length() - 1); + expandExpectedAlertsVariables(url); + final WebDriver driver = loadPage2(firstHtml, requestUrl); + + driver.findElement(new ById("mySubmit")).click(); + + final Map lastAdditionalHeaders = webConnection.getLastAdditionalHeaders(); + assertEquals(getExpectedAlerts()[0], "" + lastAdditionalHeaders.get(HttpHeader.ORIGIN)); + assertEquals(getExpectedAlerts()[1], "" + lastAdditionalHeaders.get(HttpHeader.REFERER)); + } + /** * @throws Exception if an error occurs */ @Test - @Alerts(CHROME = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", + @Alerts(CHROME = "text/html,application/xhtml+xml,application/xml;q=0.9," + + "image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", FF = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", IE = "text/html, application/xhtml+xml, */*") public void acceptHeader() throws Exception { @@ -375,7 +413,7 @@ public static class AcceptHeaderServlet extends HttpServlet { protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding(UTF_8.name()); - response.setContentType("text/html"); + response.setContentType(MimeType.TEXT_HTML); final Writer writer = response.getWriter(); final String html = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRuleTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRuleTest.java index 42f917a5721..dbc845fc136 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRuleTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHorizontalRuleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHtmlTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHtmlTest.java index 62cb1a0658b..256fde30d07 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHtmlTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlHtmlTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImage2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImage2Test.java index 4838b97c2b2..c0aab571224 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImage2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImage2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ */ package com.gargoylesoftware.htmlunit.html; +import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import java.io.InputStream; @@ -32,6 +33,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -49,6 +51,8 @@ public class HtmlImage2Test extends WebDriverTestCase { @Alerts("1") public void loadImageWithoutSource() throws Exception { loadImage(""); + loadImageInnerHtml(""); + loadImageImportNodeHtml(""); } /** @@ -58,6 +62,8 @@ public void loadImageWithoutSource() throws Exception { @Alerts("1") public void loadImageEmptySource() throws Exception { loadImage("src=''"); + loadImageInnerHtml("src=''"); + loadImageImportNodeHtml("src=''"); } /** @@ -68,15 +74,21 @@ public void loadImageEmptySource() throws Exception { FF = "2") public void loadImageBlankSource() throws Exception { loadImage("src=' '"); + loadImageInnerHtml("src=' '"); + loadImageImportNodeHtml("src=' '"); } /** * @throws Exception if the test fails */ @Test - @Alerts("2") + @Alerts(DEFAULT = "2", + IE = "1") + @NotYetImplemented(IE) public void loadImage() throws Exception { loadImage("src='img.jpg'"); + loadImageInnerHtml("src='img.jpg'"); + loadImageImportNodeHtml("src='img.jpg'"); } /** @@ -86,6 +98,51 @@ public void loadImage() throws Exception { @Alerts("2") public void loadImageUnknown() throws Exception { loadImage("src='unknown'"); + loadImageInnerHtml("src='unknown'"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "2", + CHROME = "1") + @NotYetImplemented(CHROME) + public void loadImageUnknown2() throws Exception { + loadImageImportNodeHtml("src='unknown'"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("1") + public void loadImageBrokenUrl() throws Exception { + loadImage("src='rbri://nowhere'"); + loadImageInnerHtml("src='rbri://nowhere'"); + loadImageImportNodeHtml("src='rbri://nowhere'"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("1") + public void loadImageAboutBlank() throws Exception { + loadImage("src='about:blank'"); + loadImageInnerHtml("src='about:blank'"); + loadImageImportNodeHtml("src='about:blank'"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("1") + public void loadImageAboutX() throws Exception { + loadImage("src='about:x'"); + loadImageInnerHtml("src='about:x'"); + loadImageImportNodeHtml("src='about:x'"); } /** @@ -97,9 +154,23 @@ public void loadImageUnknown() throws Exception { @NotYetImplemented(IE) public void loadImageWrongType() throws Exception { loadImage("src='" + URL_FIRST + "'"); + loadImageInnerHtml("src='" + URL_FIRST + "'"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "2", + IE = "1") + @NotYetImplemented(IE) + public void loadImageWrongType2() throws Exception { + loadImageImportNodeHtml("src='" + URL_FIRST + "'"); } private void loadImage(final String src) throws Exception { + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); + try (InputStream is = getClass().getClassLoader().getResourceAsStream("testfiles/tiny-jpg.img")) { final byte[] directBytes = IOUtils.toByteArray(is); final URL urlImage = new URL(URL_FIRST, "img.jpg"); @@ -111,20 +182,92 @@ private void loadImage(final String src) throws Exception { + "\n" + "\n" + " \n" + ""; + final int count = getMockWebConnection().getRequestCount(); + final WebDriver driver = getWebDriver(); + if (driver instanceof HtmlUnitDriver) { + ((HtmlUnitDriver) driver).setDownloadImages(true); + } + loadPage2(html); + assertEquals(Integer.parseInt(getExpectedAlerts()[0]), getMockWebConnection().getRequestCount() - count); + } + + private void loadImageInnerHtml(final String src) throws Exception { + try (InputStream is = getClass().getClassLoader().getResourceAsStream("testfiles/tiny-jpg.img")) { + final byte[] directBytes = IOUtils.toByteArray(is); + final URL urlImage = new URL(URL_FIRST, "img.jpg"); + final List emptyList = Collections.emptyList(); + getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", emptyList); + } + + final String html = "\n" + + "\n" + + "\n" + + " \n" + + "
    \n" + + ""; + + final int count = getMockWebConnection().getRequestCount(); final WebDriver driver = getWebDriver(); if (driver instanceof HtmlUnitDriver) { ((HtmlUnitDriver) driver).setDownloadImages(true); } loadPage2(html); - assertEquals(Integer.parseInt(getExpectedAlerts()[0]), getMockWebConnection().getRequestCount()); + + driver.findElement(By.id("test")).click(); + assertEquals(Integer.parseInt(getExpectedAlerts()[0]), getMockWebConnection().getRequestCount() - count); + } + + private void loadImageImportNodeHtml(final String src) throws Exception { + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); + + try (InputStream is = getClass().getClassLoader().getResourceAsStream("testfiles/tiny-jpg.img")) { + final byte[] directBytes = IOUtils.toByteArray(is); + final URL urlImage = new URL(URL_FIRST, "img.jpg"); + final List emptyList = Collections.emptyList(); + getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", emptyList); + } + + final String html = "\n" + + "\n" + + "\n" + + " \n" + + "
    \n" + + ""; + + final int count = getMockWebConnection().getRequestCount(); + final WebDriver driver = getWebDriver(); + if (driver instanceof HtmlUnitDriver) { + ((HtmlUnitDriver) driver).setDownloadImages(true); + } + loadPage2(html); + + driver.findElement(By.id("test")).click(); + verifyAlerts(driver, "before"); + + assertEquals(Integer.parseInt(getExpectedAlerts()[0]), getMockWebConnection().getRequestCount() - count); } /** @@ -150,9 +293,8 @@ public void isDisplayedNoSource() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "true", - CHROME = "false", - FF52 = "false") + @Alerts(DEFAULT = "false", + IE = "true") public void isDisplayedEmptySource() throws Exception { isDisplayed("src=''"); } @@ -200,6 +342,8 @@ private void isDisplayed(final String src) throws Exception { final URL urlImage = new URL(URL_FIRST, "img.jpg"); final List emptyList = Collections.emptyList(); getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", emptyList); + + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); } final String html = "Page A\n" diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageDownloadTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageDownloadTest.java index c8e953aa603..a1be7084eb6 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageDownloadTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageDownloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java index c850fefa6bf..32d66042ea1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInput2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInputTest.java index b71a8b38fb1..a3bea01df70 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; import com.gargoylesoftware.htmlunit.util.NameValuePair; /** @@ -50,7 +51,7 @@ public class HtmlImageInputTest extends WebDriverTestCase { */ @Test @Alerts(DEFAULT = "§§URL§§?button.x=0&button.y=0", - CHROME = "§§URL§§?button.x=16&button.y=8&button=foo", + CHROME = "§§URL§§?button.x=16&button.y=8", IE = "§§URL§§?button.x=14&button.y=15") @NotYetImplemented({CHROME, IE}) public void click_NoPosition() throws Exception { @@ -73,7 +74,7 @@ public void click_NoPosition() throws Exception { */ @Test @Alerts(DEFAULT = "§§URL§§?button.x=0&button.y=0", - CHROME = "§§URL§§?button.x=30&button.y=8", + CHROME = "§§URL§§?button.x=28&button.y=8", IE = "§§URL§§?button.x=14&button.y=15") @NotYetImplemented({CHROME, IE}) public void click_NoPosition_NoValue() throws Exception { @@ -273,8 +274,8 @@ public void value() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"textLength not available"}, - FF = {"7"}) + @Alerts(DEFAULT = "textLength not available", + FF = "7") public void textLength() throws Exception { final String html = "foo\n" + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageTest.java index 2e5e7949561..639814512ee 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlImageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java index faa5fc76b38..76fe42a8333 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrame2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; -import com.gargoylesoftware.htmlunit.BrowserRunner.BuggyWebDriver; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.MockWebConnection; import com.gargoylesoftware.htmlunit.WebDriverTestCase; @@ -144,7 +143,7 @@ public void targetResolution() throws Exception { final WebDriver driver = loadPage2(framesContent); // top frame - assertEquals("Top Page", driver.getTitle()); + assertTitle(driver, "Top Page"); assertEquals("Body of top frame", driver.findElement(By.id("content")).getText()); // left frame @@ -241,9 +240,8 @@ public void aboutSrc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = {"false", "false", "true", "false"}, - IE = {"false", "false", "false", "false"}) - @BuggyWebDriver(CHROME) + @Alerts(DEFAULT = {"1:true", "2:false", "3:false", "4:false"}, + IE = {"1:false", "2:false", "3:false", "4:false"}) @NotYetImplemented({CHROME, FF}) public void createIframeFromStrictFunction() throws Exception { final String html = "\n" @@ -251,13 +249,13 @@ public void createIframeFromStrictFunction() throws Exception { + " function test() {\n" + " 'use strict';\n" + " var iframe = document.createElement('iframe');\n" - + " alert(!this);\n" - + " alert(!iframe);\n" + + " alert('1:' + !this);\n" + + " alert('2:' + !iframe);\n" + " }\n" + " function test2() {\n" + " var iframe = document.createElement('iframe');\n" - + " alert(!this);\n" - + " alert(!iframe);\n" + + " alert('3:' + !this);\n" + + " alert('4:' + !iframe);\n" + " }\n" + "\n" + "\n" diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrameTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrameTest.java index 616232ee980..0090e571f9d 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrameTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInlineFrameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInput2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInput2Test.java index a12f78560ed..4463d59d74b 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInput2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInput2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -187,7 +187,9 @@ public void clickTextEventSequence() throws Exception { */ @Test @Alerts({"mousedown; onfocus; mouseup; onchange; onclick;", ""}) - @BuggyWebDriver + @BuggyWebDriver(CHROME = {"onfocus; onchange; mouseup; onclick;", ""}, + FF = {"mousedown; onfocus; onchange; mouseup; onclick;", ""}, + IE = {"mousedown; onchange; mouseup; onclick; onfocus;", ""}) public void clickOptionEventSequence() throws Exception { testClickEventSequence("", false); } diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInputTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInputTest.java index 40be0d00b58..7626844e084 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInputTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedTextTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedTextTest.java index 0d9d8ec96c9..ad5add47ea1 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedTextTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlInsertedTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java index 2613d8389f0..a928399359c 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlIsIndex2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ */ package com.gargoylesoftware.htmlunit.html; -import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.IE; import org.junit.Test; @@ -44,8 +43,9 @@ public class HtmlIsIndex2Test extends WebDriverTestCase { */ @Test @Alerts(DEFAULT = "null", - CHROME = "[object HTMLUnknownElement]") - @NotYetImplemented({IE, FF}) + CHROME = "[object HTMLUnknownElement]", + FF = "[object HTMLUnknownElement]") + @NotYetImplemented(IE) public void simpleScriptable() throws Exception { final String html = "\n" + "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + final WebDriver driver = loadPage2(html); + driver.findElement(By.id("label1")).click(); + + assertEquals(Arrays.asList(getExpectedAlerts()).toString(), + '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts("labelclick,") + public void clickForSetFocusToDisabledInput() throws Exception { + final String html = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + final WebDriver driver = loadPage2(html); + driver.findElement(By.id("label1")).click(); + + assertEquals(Arrays.asList(getExpectedAlerts()).toString(), + '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + } + + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts("labelclick,") + public void clickForSetFocusToDisabledCheckbox() throws Exception { + final String html = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + ""; + final WebDriver driver = loadPage2(html); + driver.findElement(By.id("label1")).click(); + + assertEquals(Arrays.asList(getExpectedAlerts()).toString(), + '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + } + /** * @throws Exception if an error occurs */ diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLegendTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLegendTest.java index bbaa073cca9..84e0986c956 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLegendTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLegendTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLink2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLink2Test.java index 2d769f123b4..6963e0115d4 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLink2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlLink2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +22,14 @@ import org.junit.runner.RunWith; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; import org.openqa.selenium.htmlunit.HtmlUnitDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented; import com.gargoylesoftware.htmlunit.WebDriverTestCase; +import com.gargoylesoftware.htmlunit.util.MimeType; /** * Tests for {@link HtmlLink}. @@ -63,22 +65,28 @@ public void simpleScriptable() throws Exception { } /** - * @throws Exception if an error occurs + * Verifies getVisibleText(). + * @throws Exception if the test fails */ @Test - public void asText() throws Exception { - final String html - = "\n" - + "\n" - + " \n" - + "\n" - + "\n" - + "\n" - + ""; + @Alerts("") + public void getVisibleText() throws Exception { + final String htmlContent + = "\n" + + "\n" + + " \n" + + "\n" + + "\n" + + ""; - final WebDriver driver = loadPageWithAlerts2(html); - final String text = driver.findElement(By.id("l")).getText(); - assertEquals("", text); + final WebDriver driver = loadPage2(htmlContent); + final String text = driver.findElement(By.id("tester")).getText(); + assertEquals(getExpectedAlerts()[0], text); + + if (driver instanceof HtmlUnitDriver) { + final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); + assertEquals(getExpectedAlerts()[0], page.getBody().getVisibleText()); + } } /** @@ -200,6 +208,7 @@ private void onLoadOnError(final String attribs) throws Exception { + "\n" + "\n" + ""; + getMockWebConnection().setDefaultResponse("Error: not found", 404, "Not Found", MimeType.TEXT_HTML); loadPageWithAlerts2(html); } @@ -208,7 +217,9 @@ private void onLoadOnError(final String attribs) throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts({"onLoad1", "onLoadJs1", "onLoad2", "body onLoad;"}) + @Alerts(DEFAULT = {"onLoad1", "onLoadJs1", "onLoad2", "body onLoad;"}, + IE = {"onLoadJs1", "body onLoad", "onLoad1", "onLoad2;"}) + @NotYetImplemented(IE) public void onLoadOrder() throws Exception { getMockWebConnection().setResponse(new URL(URL_FIRST, "simple1.css"), ""); getMockWebConnection().setResponse(new URL(URL_FIRST, "simple2.css"), ""); @@ -231,16 +242,14 @@ public void onLoadOrder() throws Exception { + ""; final WebDriver driver = loadPage2(html); - Thread.sleep(200); - final String text = driver.getTitle(); - assertEquals(String.join(";", getExpectedAlerts()), text); + assertTitle(driver, String.join(";", getExpectedAlerts())); } /** * @throws Exception if an error occurs */ @Test - @Alerts({"onLoad [object Event]", "onError [object Event]"}) + @Alerts("onLoad [object Event]") public void onLoadDynamic() throws Exception { getMockWebConnection().setResponse(new URL(URL_FIRST, "simple.css"), ""); final String html @@ -255,7 +264,38 @@ public void onLoadDynamic() throws Exception { + " dynLink.onload = function (e) { log(\"onLoad \" + e) };\n" + " dynLink.onerror = function (e) { log(\"onError \" + e) };\n" + " document.head.appendChild(dynLink);\n" + + " }\n" + + + " function log(x) {\n" + + " document.getElementById('log').value += x + '\\n';\n" + + " }\n" + + " \n" + + "\n" + + "\n" + + " \n" + + "\n" + + ""; + + final WebDriver driver = loadPage2(html); + Thread.sleep(200); + final String text = driver.findElement(By.id("log")).getAttribute("value").trim().replaceAll("\r", ""); + assertEquals(String.join("\n", getExpectedAlerts()), text); + } + /** + * @throws Exception if an error occurs + */ + @Test + @Alerts(DEFAULT = "onError [object Event]", + IE = "onLoad [object Event]") + @NotYetImplemented(IE) + public void onLoadDynamicUnknown() throws Exception { + getMockWebConnection().setResponse(new URL(URL_FIRST, "simple.css"), ""); + final String html + = "\n" + + "\n" + + " \n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"--null", "--null", "--null"}, + IE = {"--null", "exception", "--null"}) + public void defaultValuesAfterClone() throws Exception { + final String html = "foo\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + loadPageWithAlerts2(html); + } + + /** + * Verifies getVisibleText(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void getVisibleText() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final String text = driver.findElement(By.id("tester")).getText(); + assertEquals(getExpectedAlerts()[0], text); + + if (driver instanceof HtmlUnitDriver) { + final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); + assertEquals(getExpectedAlerts()[0], page.getBody().getVisibleText()); + } + } + + /** + * Verifies clear(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void clearInput() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + ""; + + final WebDriver driver = loadPage2(htmlContent); + final WebElement element = driver.findElement(By.id("tester")); + + element.clear(); + assertEquals(getExpectedAlerts()[0], element.getAttribute("value")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = "8", + CHROME = "") + @NotYetImplemented({FF, IE}) + public void typing() throws Exception { + final String htmlContent + = "foo\n" + + "
    \n" + + " \n" + + "
    "; + + final WebDriver driver = loadPage2(htmlContent); + + final WebElement input = driver.findElement(By.id("foo")); + input.sendKeys("8"); + assertEquals(getExpectedAlerts()[0], input.getAttribute("value")); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("--") + public void minMaxStep() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
    \n" + + " \n" + + "
    \n" + + "\n" + + ""; + + loadPageWithAlerts2(html); + } +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames2Test.java new file mode 100644 index 00000000000..4bcbd628871 --- /dev/null +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFrames2Test.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2002-2020 Gargoyle 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 + * http://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 com.gargoylesoftware.htmlunit.html; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.htmlunit.HtmlUnitDriver; + +import com.gargoylesoftware.htmlunit.BrowserRunner; +import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; +import com.gargoylesoftware.htmlunit.WebDriverTestCase; + +/** + * Tests for {@link HtmlNoFrames}. + * + * @author Ronald Brill + */ +@RunWith(BrowserRunner.class) +public class HtmlNoFrames2Test extends WebDriverTestCase { + + /** + * Verifies getVisibleText(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void getVisibleText() throws Exception { + final String html + = "\n" + + " \n" + + " Some text\n" + + " \n" + + ""; + + final WebDriver driver = loadPage2(html); + final String text = driver.findElement(By.id("tester")).getText(); + assertEquals(getExpectedAlerts()[0], text); + + if (driver instanceof HtmlUnitDriver) { + final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage(); + assertEquals(getExpectedAlerts()[0], page.getElementById("tester").getVisibleText()); + } + } +} diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFramesTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFramesTest.java index 9d7e2873399..9b9eb30601a 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFramesTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoFramesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript2Test.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript2Test.java index 94f9eb05162..c270b60cb51 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript2Test.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScript2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScriptTest.java b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScriptTest.java index 840255c1f32..4786e7b41a4 100644 --- a/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScriptTest.java +++ b/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlNoScriptTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2018 Gargoyle Software Inc. + * Copyright (c) 2002-2020 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import org.junit.runner.RunWith; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.htmlunit.HtmlUnitDriver; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts; @@ -33,6 +34,30 @@ @RunWith(BrowserRunner.class) public class HtmlNoScriptTest extends WebDriverTestCase { + /** + * Verifies getVisibleText(). + * @throws Exception if the test fails + */ + @Test + @Alerts("") + public void getVisibleText() throws Exception { + final String htmlContent + = "\n" + + "\n" + + "\n" + + "