Esempio n. 1
0
bool ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(const RenderBlock* block)
{
    // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
    ExclusionShapeValue* shapeValue = block->style()->shapeInside();
    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
    return shape && (shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE || shape->type() == BasicShape::BASIC_SHAPE_POLYGON);
}
Esempio n. 2
0
bool ExclusionShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
{
    ExclusionShapeValue* shapeValue = renderer->style()->resolvedShapeInside();
    if (!shapeValue || shapeValue->type() != ExclusionShapeValue::Shape)
        return false;

    BasicShape* shape = shapeValue->shape();
    return shape && shape->type() != BasicShape::BasicShapeInsetRectangleType;
}
const ExclusionShape* ExclusionShapeInfo<RenderType, shapeGetter, intervalGetter>::computedShape() const
{
    if (ExclusionShape* exclusionShape = m_shape.get())
        return exclusionShape;

    ExclusionShapeValue* shapeValue = (m_renderer->style()->*shapeGetter)();
    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::Shape) ? shapeValue->shape() : 0;

    ASSERT(shape);

    m_shape = ExclusionShape::createExclusionShape(shape, LayoutSize(m_shapeLogicalWidth, m_shapeLogicalHeight), m_renderer->style()->writingMode(), m_renderer->style()->shapeMargin(), m_renderer->style()->shapePadding());
    ASSERT(m_shape);
    return m_shape.get();
}
Esempio n. 4
0
void ExclusionShapeInsideInfo::computeShapeSize(LayoutUnit logicalWidth, LayoutUnit logicalHeight)
{
    if (!m_shapeSizeDirty && logicalWidth == m_logicalWidth && logicalHeight == m_logicalHeight)
        return;

    m_shapeSizeDirty = false;
    m_logicalWidth = logicalWidth;
    m_logicalHeight = logicalHeight;

    // FIXME: Bug 89993: The wrap shape may come from the parent object
    ExclusionShapeValue* shapeValue = m_block->style()->shapeInside();
    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;

    ASSERT(shape);

    m_shape = ExclusionShape::createExclusionShape(shape, logicalWidth, logicalHeight, m_block->style()->writingMode());
    ASSERT(m_shape);
}
bool ExclusionShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
{
    ExclusionShapeValue* shapeValue = renderer->style()->resolvedShapeInside();
    return (shapeValue && shapeValue->type() == ExclusionShapeValue::Shape) ? shapeValue->shape() : 0;
}