Esempio n. 1
0
bool ShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
{
    ShapeValue* shapeValue = renderer->style().resolvedShapeInside();
    if (!shapeValue)
        return false;

    switch (shapeValue->type()) {
    case ShapeValue::Shape:
        return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType;
    case ShapeValue::Image:
        return shapeValue->isImageValid() && checkShapeImageOrigin(renderer->document(), *(shapeValue->image()->cachedImage()));
    default:
        return false;
    }
}
Esempio n. 2
0
bool ShapeOutsideInfo::isEnabledFor(const RenderBox& box)
{
    ShapeValue* shapeValue = box.style().shapeOutside();
    if (!box.isFloating() || !shapeValue)
        return false;

    switch (shapeValue->type()) {
    case ShapeValue::Shape: return shapeValue->shape();
    case ShapeValue::Image: return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()));
    case ShapeValue::Box: return true;
    }

    ASSERT_NOT_REACHED();
    return false;
}
Esempio n. 3
0
bool ShapeOutsideInfo::isEnabledFor(const RenderBox* box)
{
    ShapeValue* shapeValue = box->style().shapeOutside();
    if (!box->isFloating() || !shapeValue)
        return false;

    switch (shapeValue->type()) {
    case ShapeValue::Shape:
        return shapeValue->shape();
    case ShapeValue::Image:
        return shapeValue->isImageValid() && checkShapeImageOrigin(box->document(), *(shapeValue->image()->cachedImage()));
    default:
        return false;
    }
}
Esempio n. 4
0
bool ShapeInsideInfo::isEnabledFor(const RenderBlock& renderer)
{
    ShapeValue* shapeValue = renderer.style().resolvedShapeInside();
    if (!shapeValue)
        return false;

    switch (shapeValue->type()) {
    case ShapeValue::Shape:
        return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType && shapeValue->shape()->type() != BasicShape::BasicShapeInsetType;
    case ShapeValue::Image:
        return shapeValue->isImageValid() && checkShapeImageOrigin(renderer.document(), *(shapeValue->image()->cachedImage()));
    case ShapeValue::Box:
        return false;
    case ShapeValue::Outside:
        // Outside value must already be resolved
        break;
    }
    ASSERT_NOT_REACHED();
    return false;
}