float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate& center, float boxDimension) { float offset = floatValueForLength(center.length(), boxDimension); if (center.direction() == BasicShapeCenterCoordinate::TopLeft) return offset; return boxDimension - offset; }
static PassRefPtr<CSSPrimitiveValue> valueForCenterCoordinate(CSSValuePool& pool, const RenderStyle* style, const BasicShapeCenterCoordinate& center, EBoxOrient orientation) { if (center.direction() == BasicShapeCenterCoordinate::TopLeft) return pool.createValue(center.length(), style); CSSValueID keyword = orientation == HORIZONTAL ? CSSValueRight : CSSValueBottom; return pool.createValue(Pair::create(pool.createIdentifierValue(keyword), pool.createValue(center.length(), style))); }