private int getKeywordValue(final FoContext context, final FObj fobj) {
final FoValue foValue = this.convertValueToFoValue(value());
final AbsoluteCompass direction = this.getAbsoluteCompass();
switch (foValue) {
case INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
if (direction == AbsoluteCompass.LEFT) {
return effectiveParent.getMarginLeft(context);
}
if (direction == AbsoluteCompass.RIGHT) {
return effectiveParent.getMarginRight(context);
}
if (direction == AbsoluteCompass.TOP) {
return effectiveParent.getMarginTop(context);
}
if (direction == AbsoluteCompass.BOTTOM) {
return effectiveParent.getMarginBottom(context);
}
}
case AUTO: {
if (direction == AbsoluteCompass.LEFT) {
/* TODO: This needs to conform to the CSS2 Spec, Section 10.3.