#ifndef RenderScrollbarPart_h
#define RenderScrollbarPart_h
#include "core/rendering/RenderBlock.h"
#include "platform/scroll/ScrollTypes.h"
namespace WebCore {
class RenderScrollbar;
class RenderScrollbarPart FINAL : public RenderBlock {
public:
static RenderScrollbarPart* createAnonymous(Document*, RenderScrollbar* = 0, ScrollbarPart = NoPart);
virtual ~RenderScrollbarPart();
virtual const char* renderName() const OVERRIDE { return "RenderScrollbarPart"; }
virtual LayerType layerTypeRequired() const OVERRIDE { return NoLayer; }
virtual void layout() OVERRIDE;
void paintIntoRect(GraphicsContext*, const LayoutPoint&, const LayoutRect&);
virtual LayoutUnit marginTop() const OVERRIDE { ASSERT(isIntegerValue(m_marginBox.top())); return m_marginBox.top(); }
virtual LayoutUnit marginBottom() const OVERRIDE { ASSERT(isIntegerValue(m_marginBox.bottom())); return m_marginBox.bottom(); }
virtual LayoutUnit marginLeft() const OVERRIDE { ASSERT(isIntegerValue(m_marginBox.left())); return m_marginBox.left(); }
virtual LayoutUnit marginRight() const OVERRIDE { ASSERT(isIntegerValue(m_marginBox.right())); return m_marginBox.right(); }
virtual bool isRenderScrollbarPart() const OVERRIDE { return true; }
RenderObject* rendererOwningScrollbar() const;
protected:
virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) OVERRIDE;
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE;
private:
RenderScrollbarPart(RenderScrollbar*, ScrollbarPart);
virtual void computePreferredLogicalWidths() OVERRIDE;
virtual LayoutUnit paddingTop() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingBottom() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingLeft() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingRight() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingBefore() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingAfter() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingStart() const OVERRIDE { return LayoutUnit(); }
virtual LayoutUnit paddingEnd() const OVERRIDE { return LayoutUnit(); }
void layoutHorizontalPart();
void layoutVerticalPart();
void computeScrollbarWidth();
void computeScrollbarHeight();
RenderScrollbar* m_scrollbar;
ScrollbarPart m_part;
};
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderScrollbarPart, isRenderScrollbarPart());
}
#endif