Skip to content

Commit

Permalink
Function initHashChangeEvent() is no longer available in FF_ESR
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Oct 14, 2024
1 parent 19f9754 commit 9eca590
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<body>
<release version="4.5.0" date="xxxx, 2024" description="Chrome/Edge 129, Firefox 131, FirefoxESR 128, WebWorker, Bugfixes">
<action type="fix" dev="rbri">
Function initHashChangeEvent() is no longer available in FF_ESR.
</action>
<action type="update" dev="rbri">
Location.query property always returns an empty string if the location has the about protocol and
the browser is FF/FF_ESR.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
*/
package org.htmlunit.javascript.host.event;

import static org.htmlunit.javascript.configuration.SupportedBrowser.FF_ESR;

import org.htmlunit.corejs.javascript.ScriptableObject;
import org.htmlunit.javascript.JavaScriptEngine;
import org.htmlunit.javascript.configuration.JsxClass;
import org.htmlunit.javascript.configuration.JsxConstructor;
import org.htmlunit.javascript.configuration.JsxFunction;
import org.htmlunit.javascript.configuration.JsxGetter;

/**
Expand Down Expand Up @@ -82,23 +79,6 @@ public void jsConstructor(final String type, final ScriptableObject details) {
newURL_ = newURL;
}

/**
* 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 oldURL the old URL
* @param newURL the new URL
*/
@JsxFunction(FF_ESR)
public void initHashChangeEvent(final String type, final boolean bubbles, final boolean cancelable,
final String oldURL, final String newURL) {
initEvent(type, bubbles, cancelable);
oldURL_ = oldURL;
newURL_ = newURL;
}

/**
* Returns the old URL.
* @return the old URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ public void create_createEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = {"[object HashChangeEvent]", "missing initHashChangeEvent"},
FF_ESR = {"[object HashChangeEvent]", "[object HashChangeEvent]",
"hashchange", "true", "false", "false", "§§URL§§", "§§URL§§#1"})
@Alerts({"[object HashChangeEvent]", "missing initHashChangeEvent"})
public void initHashChangeEvent() throws Exception {
final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_
+ "<html><head><script>\n"
Expand Down Expand Up @@ -155,8 +153,7 @@ public void initHashChangeEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = "exception",
FF_ESR = {"[object HashChangeEvent]", "hashchange", "true", "false", "false", "§§URL§§", "§§URL§§#1"})
@Alerts("exception")
public void dispatchEvent() throws Exception {
final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_
+ "<html><head><script>\n"
Expand Down

0 comments on commit 9eca590

Please sign in to comment.