Skip to content

Commit 684e362

Browse files
committed
document last additions from Lai Quang Duong
1 parent cc986a8 commit 684e362

File tree

8 files changed

+49
-11
lines changed

8 files changed

+49
-11
lines changed

src/changes/changes.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88

99
<body>
1010
<release version="5.0.0" date="April 01, 2026" description="jdk17, Bugfixes">
11+
<action type="add" dev="Lai Quang Duong">
12+
Intl: supportedLocalesOf() implementation added to DateTimeFormat and NumberFormat.
13+
</action>
14+
<action type="add" dev="Lai Quang Duong">
15+
Intl: getCanonicalLocales() implementation added
16+
</action>
17+
<action type="add" dev="Lai Quang Duong">
18+
Intl.Locale implementation added.
19+
</action>
20+
<action type="fix" dev="Kanoko Yamamoto">
21+
Storage: fix storeSize calculation when overwriting existing key
22+
</action>
1123
<action type="update" dev="Lai Quang Duong">
1224
In sync with the spec, a form now maintains a past names map at the form level, not on individual elements.
1325
The map is populated only when form.xyz resolves to a single element, and entries are invalidated when the element's form owner changes.

src/main/java/org/htmlunit/javascript/host/event/EventHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public Object call(final Context cx, final Scriptable scope,
6363
// compile "just in time"
6464
if (realFunction_ == null) {
6565
final String js = "function on" + eventName_ + "(event) { " + jsSnippet_ + " \n}";
66+
// HtmlUnitScriptable scope = scope.getTopLevelScope(scope);
6667
realFunction_ = cx.compileFunction(scope, js, eventName_ + " event for " + node_
6768
+ " in " + node_.getPage().getUrl(), 0, null);
6869
realFunction_.setParentScope(scope);

src/main/java/org/htmlunit/javascript/host/intl/DateTimeFormat.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
*
4747
* @author Ahmed Ashour
4848
* @author Ronald Brill
49+
* @author Lai Quang Duong
4950
*/
5051
@JsxClass
5152
public class DateTimeFormat extends HtmlUnitScriptable {

src/main/java/org/htmlunit/javascript/host/intl/Intl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ public static void init(final Scriptable scope, final ScriptableObject globalThi
6262
intl.defineProperties(scope, browserVersion);
6363

6464
// Configure static functions (getCanonicalLocales)
65-
final ClassConfiguration intlConfig = AbstractJavaScriptConfiguration.getClassConfiguration(Intl.class, browserVersion);
65+
final ClassConfiguration intlConfig =
66+
AbstractJavaScriptConfiguration.getClassConfiguration(Intl.class, browserVersion);
6667
if (intlConfig != null) {
6768
defineStaticFunctions(intlConfig, intl, intl);
6869
}

src/main/java/org/htmlunit/javascript/host/intl/Locale.java

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,61 +197,81 @@ private static void setUnicodeKeyword(final java.util.Locale.Builder builder,
197197
builder.setUnicodeLocaleKeyword(unicodeKey, s);
198198
}
199199

200-
/** @return the language */
200+
/**
201+
* @return the language
202+
*/
201203
@JsxGetter
202204
public Object getLanguage() {
203205
return language_ != null ? language_ : JavaScriptEngine.UNDEFINED;
204206
}
205207

206-
/** @return the script */
208+
/**
209+
* @return the script
210+
*/
207211
@JsxGetter
208212
public Object getScript() {
209213
return script_ != null ? script_ : JavaScriptEngine.UNDEFINED;
210214
}
211215

212-
/** @return the region */
216+
/**
217+
* @return the region
218+
*/
213219
@JsxGetter
214220
public Object getRegion() {
215221
return region_ != null ? region_ : JavaScriptEngine.UNDEFINED;
216222
}
217223

218-
/** @return the calendar type */
224+
/**
225+
* @return the calendar type
226+
*/
219227
@JsxGetter
220228
public Object getCalendar() {
221229
return calendar_ != null ? calendar_ : JavaScriptEngine.UNDEFINED;
222230
}
223231

224-
/** @return the collation type */
232+
/**
233+
* @return the collation type
234+
*/
225235
@JsxGetter
226236
public Object getCollation() {
227237
return collation_ != null ? collation_ : JavaScriptEngine.UNDEFINED;
228238
}
229239

230-
/** @return the numbering system */
240+
/**
241+
* @return the numbering system
242+
*/
231243
@JsxGetter
232244
public Object getNumberingSystem() {
233245
return numberingSystem_ != null ? numberingSystem_ : JavaScriptEngine.UNDEFINED;
234246
}
235247

236-
/** @return the case first setting */
248+
/**
249+
* @return the case first setting
250+
*/
237251
@JsxGetter
238252
public Object getCaseFirst() {
239253
return caseFirst_ != null ? caseFirst_ : JavaScriptEngine.UNDEFINED;
240254
}
241255

242-
/** @return the hour cycle */
256+
/**
257+
* @return the hour cycle
258+
*/
243259
@JsxGetter
244260
public Object getHourCycle() {
245261
return hourCycle_ != null ? hourCycle_ : JavaScriptEngine.UNDEFINED;
246262
}
247263

248-
/** @return whether numeric sorting is used */
264+
/**
265+
* @return whether numeric sorting is used
266+
*/
249267
@JsxGetter
250268
public boolean isNumeric() {
251269
return numeric_;
252270
}
253271

254-
/** @return the base name (without Unicode extensions) */
272+
/**
273+
* @return the base name (without Unicode extensions)
274+
*/
255275
@JsxGetter
256276
public Object getBaseName() {
257277
final String variant = locale_.getVariant().replace("_", "-");

src/main/java/org/htmlunit/javascript/host/intl/NumberFormat.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
*
4242
* @author Ahmed Ashour
4343
* @author Ronald Brill
44+
* @author Lai Quang Duong
4445
*/
4546
@JsxClass
4647
public class NumberFormat extends HtmlUnitScriptable {

src/test/java/org/htmlunit/javascript/host/intl/DateTimeFormatTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*
3030
* @author Ronald Brill
3131
* @author Ahmed Ashour
32+
* @author Lai Quang Duong
3233
*/
3334
public class DateTimeFormatTest extends WebDriverTestCase {
3435

src/test/java/org/htmlunit/javascript/host/intl/NumberFormatTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Tests for {@link NumberFormat}.
2424
*
2525
* @author Ronald Brill
26+
* @author Lai Quang Duong
2627
*/
2728
public class NumberFormatTest extends WebDriverTestCase {
2829

0 commit comments

Comments
 (0)