private void position(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) { moveAllTheWayOver(current, direction); alignToLastOpposingFloat(cssCtx, bfc, current, direction); alignToLastFloat(cssCtx, bfc, current, direction); if (!fitsInContainingBlock(current) || overlaps(cssCtx, bfc, current, getFloats(direction))) { moveAllTheWayOver(current, direction); moveFloatBelow(cssCtx, bfc, current, getFloats(direction)); } if (overlaps(cssCtx, bfc, current, getOpposingFloats(direction))) { moveAllTheWayOver(current, direction); moveFloatBelow(cssCtx, bfc, current, getFloats(direction)); moveFloatBelow(cssCtx, bfc, current, getOpposingFloats(direction)); } if (current.getStyle().isCleared()) { if (current.getStyle().isClearLeft() && direction == LEFT) { moveAllTheWayOver(current, LEFT); } else if (current.getStyle().isClearRight() && direction == RIGHT) { moveAllTheWayOver(current, RIGHT); } moveFloatBelow(cssCtx, bfc, current, getFloats(direction)); } }
private void position(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) { moveAllTheWayOver(current, direction); alignToLastOpposingFloat(cssCtx, bfc, current, direction); alignToLastFloat(cssCtx, bfc, current, direction); if (!fitsInContainingBlock(current) || overlaps(cssCtx, bfc, current, getFloats(direction))) { moveAllTheWayOver(current, direction); moveFloatBelow(cssCtx, bfc, current, getFloats(direction)); } if (overlaps(cssCtx, bfc, current, getOpposingFloats(direction))) { moveAllTheWayOver(current, direction); moveFloatBelow(cssCtx, bfc, current, getFloats(direction)); moveFloatBelow(cssCtx, bfc, current, getOpposingFloats(direction)); } if (current.getStyle().isCleared()) { if (current.getStyle().isClearLeft() && direction == LEFT) { moveAllTheWayOver(current, LEFT); } else if (current.getStyle().isClearRight() && direction == RIGHT) { moveAllTheWayOver(current, RIGHT); } moveFloatBelow(cssCtx, bfc, current, getFloats(direction)); } }