Skip to content

Commit

Permalink
avoid ConcurrentModificationExceptions in frame processing
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Dec 25, 2024
1 parent a60cc55 commit 5a3a468
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,21 @@

<body>
<release version="4.8.0" date="December xx, 2024" description="Bugfixes">
<action type="fix" dev="rbri">
Avoid ConcurrentModificationExceptions in frame processing.
</action>
<action type="fix" dev="RhinoTeam">
core-js: handle stack frames in the correct order.
</action>
<action type="add" dev="rbri">
cssparser: support hwb(), lab(), lch(), oklab(), and oklch() color definitions.
</action>
<action type="add" dev="rbri">
cssparser: add support for 'none' in modern color definitions.
</action>
<action type="fix" dev="rbri">
core-js: fix border checks for typedarray set-method (see https://github.com/HtmlUnit/htmlunit-core-js/issues/27)
</action>
<action type="add" dev="RhinoTeam">
core-js: Allow symbol keys in getter/setter in object literal syntax like 'var o = { get [aSymbol]: value }'.
</action>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/htmlunit/html/HtmlPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void initialize() throws IOException, FailingHttpStatusCodeException {
executeEventHandlersIfNeeded(Event.TYPE_LOAD);
}

for (final BaseFrameElement frameElement : frameElements_) {
for (final BaseFrameElement frameElement : new ArrayList<>(frameElements_)) {
if (frameElement instanceof HtmlFrame) {
final Page page = frameElement.getEnclosedWindow().getEnclosedPage();
if (page != null && page.isHtmlPage()) {
Expand Down Expand Up @@ -1896,7 +1896,7 @@ private void calculateBase() {
* {@link WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set to {@code true}
*/
void loadFrames() throws FailingHttpStatusCodeException {
for (final BaseFrameElement frameElement : frameElements_) {
for (final BaseFrameElement frameElement : new ArrayList<>(frameElements_)) {
// test if the frame should really be loaded:
// if a script has already changed its content, it should be skipped
// use == and not equals(...) to identify initial content (versus URL set to "about:blank")
Expand Down

0 comments on commit 5a3a468

Please sign in to comment.