RenderScrollbarPart.h [plain text]
#ifndef RenderScrollbarPart_h
#define RenderScrollbarPart_h
#include "RenderBlock.h"
#include "ScrollTypes.h"
namespace WebCore {
class RenderScrollbar;
class RenderScrollbarPart final : public RenderBlock {
public:
RenderScrollbarPart(Document&, PassRef<RenderStyle>, RenderScrollbar* = 0, ScrollbarPart = NoPart);
virtual ~RenderScrollbarPart();
virtual const char* renderName() const { return "RenderScrollbarPart"; }
virtual bool requiresLayer() const { return false; }
virtual void layout();
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 { return true; }
RenderBox* rendererOwningScrollbar() const;
protected:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
private:
virtual void computePreferredLogicalWidths();
void layoutHorizontalPart();
void layoutVerticalPart();
void computeScrollbarWidth();
void computeScrollbarHeight();
RenderScrollbar* m_scrollbar;
ScrollbarPart m_part;
};
RENDER_OBJECT_TYPE_CASTS(RenderScrollbarPart, isRenderScrollbarPart())
}
#endif // RenderScrollbarPart_h