Buggy code:
protected TermFunction clipRegion ; public BlockBox ( Element n , Graphics2D g , VisualContext ctx ) { } public BlockBox ( InlineBox src ) { } public void copyValues ( BlockBox src ) { } @ Override public BlockBox copyBox ( ) { } @ Override public void initBox ( ) { } @ Override public void addSubBox ( Box box ) { } @ Override public void setStyle ( NodeData s ) { } @ Override public String toString ( ) { } @ Override public boolean mayContainBlocks ( ) { } public boolean containsBlocks ( ) { } public void setFloats ( FloatList left , FloatList right , int xl , int xr , int y ) { } public void setOwnerFloatList ( FloatList list ) { } public FloatList getOwnerFloatList ( ) { } public Float getFloating ( ) { } public String getFloatingString ( ) { } public Clear getClearing ( ) { } public String getClearingString ( ) { } public Overflow getOverflow ( ) { } public String getOverflowString ( ) { } public int getFloatY ( ) { } @ Override public boolean isInFlow ( ) { } public boolean isPositioned ( ) { } public boolean isFloating ( ) { } @ Override public boolean containsFlow ( ) { } @ Override public boolean isWhitespace ( ) { } @ Override public boolean marginsAdjoin ( ) { } @ Override public boolean affectsDisplay ( ) { } @ Override public boolean canSplitInside ( ) { } @ Override public boolean canSplitBefore ( ) { } @ Override public boolean canSplitAfter ( ) { } @ Override public boolean startsWithWhitespace ( ) { } @ Override public boolean endsWithWhitespace ( ) { } @ Override public void setIgnoreInitialWhitespace ( boolean b ) { } public boolean canIncreaseWidth ( ) { } protected boolean encloseFloats ( ) { } public int getPreferredWidth ( ) { } public Box getAbsReference ( ) { } public ElementBox getDomParent ( ) { } public void setContentWidth ( int width ) { } public void setContentHeight ( int height ) { } @ Override public int totalHeight ( ) { } public int getIndent ( ) { } protected void moveFloatsDown ( int ofs ) { } private void alignLineHorizontally ( LineBox line ) { } private void alignLineVertically ( LineBox line ) { } @ Override public void computeEfficientMargins ( ) { } @ Override public boolean doLayout ( int availw , boolean force , boolean linestart ) { } protected void layoutInline ( ) { } protected void layoutBlocks ( ) { } protected void layoutBlockInFlow ( BlockBox subbox , int wlimit , BlockLayoutStatus stat ) { } protected void layoutBlockFloating ( BlockBox subbox , int wlimit , BlockLayoutStatus stat ) { } protected void layoutBlockPositioned ( BlockBox subbox , BlockLayoutStatus stat ) { } public void initFirstLine ( ElementBox box ) { } @ Override public void absolutePositions ( ) { } private void updateStaticPosition ( ) { if ( ( topstatic ) || ( leftstatic ) ) { if ( ( absReference ) != null ) { final Rectangle cb = cblock . getAbsoluteBounds ( ) ; if ( topstatic ) { Rectangle ab = new Rectangle ( absReference . getAbsoluteBounds ( ) ) ; ab . x = ( ab . x ) - ( cb . x ) ; ab . y = ( ab . y ) - ( cb . y ) ; if ( ( ! ( absReference . isblock ) ) || ( ( ( ( BlockBox ) ( absReference ) ) . getFloating ( ) ) == ( BlockBox . FLOAT_NONE ) ) ) <START_BUG> coords . top = ( ( ( ( ab . y ) + ( ab . height ) ) - 1 ) - ( emargin . top ) ) - ( border . top ) ; <END_BUG> else coords . top = ( ( ab . y ) - ( emargin . top ) ) - ( border . top ) ; } if ( leftstatic ) { final BlockBox refcblock = absReference . getContainingBlock ( ) ; if ( refcblock != null ) coords . left = ( ( ( refcblock . getAbsoluteContentBounds ( ) . x ) - ( cb . x ) ) - ( emargin . left ) ) - ( border . left ) ; else coords . left = 0 ; } viewport . requireRecomputePositions ( ) ; } else if ( ( domParent ) != null ) { ElementBox dparent = domParent ; while ( ( dparent != null ) && ( ( dparent . getContainingBlock ( ) ) == null ) ) dparent = dparent . getParent ( ) ; Rectangle ab = new Rectangle ( dparent . getAbsoluteContentBounds ( ) ) ; Rectangle cb = cblock . getAbsoluteBounds ( ) ; ab . x = ( ab . x ) - ( cb . x ) ; ab . y = ( ab . y ) - ( cb . y ) ; if ( topstatic ) { coords . top = ( ( ab . y ) - ( emargin . top ) ) - ( border . top ) ; } if ( leftstatic ) { coords . left = ( ( ab . x ) - ( emargin . left ) ) - ( border . left ) ; } viewport . requireRecomputePositions ( ) ; } else { BlockBox . log . warn ( ( "No<seq2seq4repair_space>static<seq2seq4repair_space>position<seq2seq4repair_space>available<seq2seq4repair_space>for<seq2seq4repair_space>" + ( this . toString ( ) ) ) ) ; if ( topstatic ) coords . top = padding . top ; if ( leftstatic ) coords . left = padding . left ; } } } @ Override public int getAvailableContentWidth ( ) { } @ Override public int getMinimalWidth ( ) { } protected int getMinimalContentWidth ( ) { } @ Override public int getMaximalWidth ( ) { }

Fix:
coords . top = ( ( ( ab . y ) + ( ab . height ) ) - ( emargin . top ) ) - ( border . top ) ;