ShapeOutsideInfo.h [plain text]
#ifndef ShapeOutsideInfo_h
#define ShapeOutsideInfo_h
#if ENABLE(CSS_SHAPES)
#include "LayoutSize.h"
#include "ShapeInfo.h"
namespace WebCore {
class RenderBox;
class ShapeOutsideInfo : public ShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Shape::getExcludedIntervals>, public MappedInfo<RenderBox, ShapeOutsideInfo> {
public:
LayoutSize shapeLogicalOffset() const { return LayoutSize(shapeLogicalLeft(), shapeLogicalTop()); }
LayoutUnit leftSegmentShapeBoundingBoxDelta() const { return m_leftSegmentShapeBoundingBoxDelta; }
LayoutUnit rightSegmentShapeBoundingBoxDelta() const { return m_rightSegmentShapeBoundingBoxDelta; }
virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight) OVERRIDE;
static PassOwnPtr<ShapeOutsideInfo> createInfo(const RenderBox* renderer) { return adoptPtr(new ShapeOutsideInfo(renderer)); }
static bool isEnabledFor(const RenderBox*);
protected:
virtual LayoutRect computedShapeLogicalBoundingBox() const OVERRIDE { return computedShape()->shapeMarginLogicalBoundingBox(); }
private:
ShapeOutsideInfo(const RenderBox* renderer) : ShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Shape::getExcludedIntervals>(renderer) { }
LayoutUnit m_leftSegmentShapeBoundingBoxDelta;
LayoutUnit m_rightSegmentShapeBoundingBoxDelta;
LayoutUnit m_lineTop;
};
}
#endif
#endif