#ifndef RenderReplaced_h
#define RenderReplaced_h
#include "core/rendering/RenderBox.h"
namespace WebCore {
class RenderReplaced : public RenderBox {
public:
RenderReplaced(Element*);
RenderReplaced(Element*, const LayoutSize& intrinsicSize);
virtual ~RenderReplaced();
virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const OVERRIDE;
virtual LayoutUnit computeReplacedLogicalHeight() const OVERRIDE;
bool hasReplacedLogicalWidth() const;
bool hasReplacedLogicalHeight() const;
LayoutRect replacedContentRect(const LayoutSize* overriddenIntrinsicSize = 0) const;
virtual bool needsPreferredWidthsRecalculation() const OVERRIDE;
protected:
virtual void willBeDestroyed() OVERRIDE;
virtual void layout() OVERRIDE;
virtual LayoutSize intrinsicSize() const OVERRIDE FINAL { return m_intrinsicSize; }
virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const OVERRIDE;
virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE FINAL;
virtual LayoutUnit minimumReplacedHeight() const { return LayoutUnit(); }
virtual void setSelectionState(SelectionState) OVERRIDE FINAL;
bool isSelected() const;
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
void setIntrinsicSize(const LayoutSize& intrinsicSize) { m_intrinsicSize = intrinsicSize; }
virtual void intrinsicSizeChanged();
virtual bool hasRelativeIntrinsicLogicalWidth() const { return false; }
virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
bool shouldPaint(PaintInfo&, const LayoutPoint&);
LayoutRect localSelectionRect(bool checkWhetherSelected = true) const;
private:
virtual RenderBox* embeddedContentBox() const { return 0; }
virtual const char* renderName() const OVERRIDE { return "RenderReplaced"; }
virtual bool canHaveChildren() const OVERRIDE { return false; }
virtual void computePreferredLogicalWidths() OVERRIDE FINAL;
virtual void paintReplaced(PaintInfo&, const LayoutPoint&) { }
virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE;
virtual PositionWithAffinity positionForPoint(const LayoutPoint&) OVERRIDE FINAL;
virtual bool canBeSelectionLeaf() const OVERRIDE { return true; }
virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent = true) OVERRIDE FINAL;
void computeAspectRatioInformationForRenderBox(RenderBox*, FloatSize& constrainedSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const;
mutable LayoutSize m_intrinsicSize;
};
}
#endif