Skip to content

Commit

Permalink
#429 [bugfix] make a copy of BFCs
Browse files Browse the repository at this point in the history
otherwise they will disappear when the caller calls "clear" on its own collection.
  • Loading branch information
asolntsev committed Oct 28, 2024
1 parent 6e72d1e commit 962adc5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.jspecify.annotations.Nullable;
import org.xhtmlrenderer.render.MarkerData;

import java.util.ArrayDeque;
import java.util.Collection;
import java.util.Deque;

/**
Expand All @@ -47,8 +49,8 @@ public Deque<BlockFormattingContext> getBFCs() {
return _BFCs;
}

public void setBFCs(Deque<BlockFormattingContext> s) {
_BFCs = s;
public void setBFCs(Collection<BlockFormattingContext> s) {
_BFCs = new ArrayDeque<>(s);
}

@Nullable
Expand Down

0 comments on commit 962adc5

Please sign in to comment.