parent.setBPD(alignmentContext.getHeight());
if (parent instanceof InlineParent) {
parent.setOffset(alignmentContext.getOffset());
+ } else if (parent instanceof InlineBlockParent) {
+ // All inline elements are positioned by the renderers relative to
+ // the before edge of their content rectangle
+ if (borderProps != null) {
+ parent.setOffset(borderProps.getPaddingBefore(false, this)
+ + borderProps.getBorderBeforeWidth(false));
+ }
}
setCurrentArea(parent);
currentIPPosition += ibp.getBorderAndPaddingWidthStart();
// For inline content the BP position is updated by the enclosing line area
int saveBP = currentBPPosition;
+ currentBPPosition += ibp.getOffset();
renderBlock(ibp.getChildArea());
currentBPPosition = saveBP;
}
atts.clear();
addAreaAttributes(ibp);
addTraitAttributes(ibp);
+ addAttribute("offset", ibp.getOffset());
startElement("inlineblockparent", atts);
super.renderInlineBlockParent(ibp);
endElement("inlineblockparent");
<checks>
<eval expected="347000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@ipd"/>
<eval expected="350000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@offset"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-after"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-before"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-start"/>
<eval expected="2000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-start"/>
<eval expected="347000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@ipd"/>
<eval expected="350000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@offset"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-after"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-before"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-end"/>
<eval expected="2000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-start"/>
<eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@ipd"/>
<eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="2000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@offset"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-after"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-before"/>
<eval expected="1000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@padding-after"/>
<checks>
<eval expected="344000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@ipd"/>
<eval expected="350000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="3000" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@offset"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-after"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-before"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[2]/lineArea[2]/inlineblockparent/@border-start"/>
<eval expected="2000" xpath="//flow/block[5]/lineArea[1]/inlineparent/@padding-end"/>
<eval expected="344000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@ipd"/>
<eval expected="350000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="3000" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@offset"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-after"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-before"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[5]/lineArea[2]/inlineblockparent/@border-start"/>
<eval expected="2000" xpath="//flow/block[8]/lineArea[1]/inlineparent/@padding-end"/>
<eval expected="344000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@ipd"/>
<eval expected="350000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@ipda"/>
+ <eval expected="3000" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@offset"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-after"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-before"/>
<eval expected="(solid,#ff0000,1000)" xpath="//flow/block[8]/lineArea[2]/inlineblockparent/@border-start"/>