@@ -82,7 +82,6 @@ protected BlockRenderer(IElement modelElement) {
82
82
@ Override
83
83
public LayoutResult layout (LayoutContext layoutContext ) {
84
84
this .isLastRendererForModelElement = true ;
85
-
86
85
Map <Integer , IRenderer > waitingFloatsSplitRenderers = new LinkedHashMap <>();
87
86
List <IRenderer > waitingOverflowFloatRenderers = new ArrayList <>();
88
87
boolean floatOverflowedCompletely = false ;
@@ -113,25 +112,26 @@ public LayoutResult layout(LayoutContext layoutContext) {
113
112
blockWidth = RotationUtils .retrieveRotatedLayoutWidth (parentBBox .getWidth (), this );
114
113
}
115
114
boolean includeFloatsInOccupiedArea = BlockFormattingContextUtil .isRendererCreateBfc (this );
116
- float clearHeightCorrection = FloatingHelper .calculateClearHeightCorrection (this , floatRendererAreas , parentBBox );
117
- FloatingHelper .applyClearance (parentBBox , marginsCollapseHandler , clearHeightCorrection , FloatingHelper .isRendererFloating (this ));
115
+ float clearHeightCorrection = FloatingHelper .calculateClearHeightCorrection (this , floatRendererAreas ,
116
+ parentBBox );
117
+ FloatingHelper .applyClearance (parentBBox , marginsCollapseHandler , clearHeightCorrection ,
118
+ FloatingHelper .isRendererFloating (this ));
118
119
if (FloatingHelper .isRendererFloating (this , floatPropertyValue )) {
119
120
blockWidth = FloatingHelper .adjustFloatedBlockLayoutBox (this , parentBBox , blockWidth , floatRendererAreas ,
120
121
floatPropertyValue , overflowX );
121
122
floatRendererAreas = new ArrayList <>();
122
123
}
123
124
boolean wasHeightDecreased = clearHeightCorrection > 0 &&
124
125
(marginsCollapseHandler == null || FloatingHelper .isRendererFloating (this ));
125
- float bfcHeightCorrection = FloatingHelper .adjustBlockFormattingContextLayoutBox (this , floatRendererAreas , parentBBox ,
126
+ float bfcHeightCorrection = FloatingHelper .adjustBlockFormattingContextLayoutBox (this , floatRendererAreas ,
127
+ parentBBox ,
126
128
blockWidth == null ? 0 : (float ) blockWidth , wasHeightDecreased ? 0 : clearHeightCorrection );
127
129
boolean isCellRenderer = this instanceof CellRenderer ;
128
130
if (marginsCollapsingEnabled ) {
129
131
marginsCollapseHandler .startMarginsCollapse (parentBBox );
130
132
}
131
133
132
- if (Boolean .TRUE .equals (this .<Boolean >getProperty (Property .TREAT_AS_CONTINUOUS_CONTAINER ))) {
133
- ContinuousContainer .setupContinuousContainer (this );
134
- }
134
+ ContinuousContainer .setupContinuousContainerIfNeeded (this );
135
135
136
136
Border [] borders = getBorders ();
137
137
UnitValue [] paddings = getPaddings ();
@@ -440,7 +440,7 @@ public LayoutResult layout(LayoutContext layoutContext) {
440
440
}
441
441
final ContinuousContainer continuousContainer = this .<ContinuousContainer >getProperty (
442
442
Property .TREAT_AS_CONTINUOUS_CONTAINER_RESULT );
443
- if (continuousContainer != null ) {
443
+ if (continuousContainer != null && overflowRenderer == null ) {
444
444
continuousContainer .reApplyProperties (this );
445
445
paddings = getPaddings ();
446
446
borders = getBorders ();
@@ -469,14 +469,19 @@ public LayoutResult layout(LayoutContext layoutContext) {
469
469
470
470
FloatingHelper .removeFloatsAboveRendererBottom (floatRendererAreas , this );
471
471
472
+ ContinuousContainer .clearPropertiesFromOverFlowRenderer (overflowRenderer );
473
+
472
474
if (layoutResult != LayoutResult .NOTHING ) {
473
- LayoutArea editedArea = FloatingHelper .adjustResultOccupiedAreaForFloatAndClear (this , layoutContext .getFloatRendererAreas (), layoutContext .getArea ().getBBox (), clearHeightCorrection , bfcHeightCorrection , marginsCollapsingEnabled );
475
+ LayoutArea editedArea = FloatingHelper .adjustResultOccupiedAreaForFloatAndClear (this ,
476
+ layoutContext .getFloatRendererAreas (), layoutContext .getArea ().getBBox (), clearHeightCorrection ,
477
+ bfcHeightCorrection , marginsCollapsingEnabled );
474
478
return new LayoutResult (layoutResult , editedArea , splitRenderer , overflowRenderer , causeOfNothing );
475
479
} else {
476
480
if (positionedRenderers .size () > 0 ) {
477
481
overflowRenderer .positionedRenderers = new ArrayList <>(positionedRenderers );
478
482
}
479
483
floatRendererAreas .retainAll (nonChildFloatingRendererAreas );
484
+
480
485
return new LayoutResult (LayoutResult .NOTHING , null , null , overflowRenderer , causeOfNothing );
481
486
}
482
487
}
@@ -666,9 +671,7 @@ AbstractRenderer[] createSplitAndOverflowRenderers(int childPos, int layoutStatu
666
671
}
667
672
overflowRenderer .childRenderers .addAll (childRenderers .subList (childPos + 1 , childRenderers .size ()));
668
673
669
- if (Boolean .TRUE .equals (this .<Boolean >getProperty (Property .TREAT_AS_CONTINUOUS_CONTAINER ))) {
670
- ContinuousContainer .clearPropertiesFromOverFlowRenderer (overflowRenderer );
671
- }
674
+ ContinuousContainer .clearPropertiesFromOverFlowRenderer (overflowRenderer );
672
675
673
676
if (childResult .getStatus () == LayoutResult .PARTIAL ) {
674
677
// Apply forced placement only on split renderer
0 commit comments