#pragma once
#include "RenderFlexibleBox.h"
#include <memory>
namespace WebCore {
class HTMLFormControlElement;
class RenderTextFragment;
class RenderButton final : public RenderFlexibleBox {
public:
RenderButton(HTMLFormControlElement&, RenderStyle&&);
virtual ~RenderButton();
HTMLFormControlElement& formControlElement() const;
bool canBeSelectionLeaf() const override;
void addChild(RenderObject* newChild, RenderObject *beforeChild = 0) override;
void removeChild(RenderObject&) override;
void removeLeftoverAnonymousBlock(RenderBlock*) override { }
bool createsAnonymousWrapper() const override { return true; }
void updateFromElement() override;
bool canHaveGeneratedChildren() const override;
bool hasControlClip() const override { return true; }
LayoutRect controlClipRect(const LayoutPoint&) const override;
void updateAnonymousChildStyle(const RenderObject& anonymousChild, RenderStyle&) const override;
void setText(const String&);
String text() const;
#if PLATFORM(IOS)
void layout() override;
#endif
private:
void element() const = delete;
const char* renderName() const override { return "RenderButton"; }
bool isRenderButton() const override { return true; }
bool hasLineIfEmpty() const override;
bool isFlexibleBoxImpl() const override { return true; }
RenderTextFragment* m_buttonText;
RenderBlock* m_inner;
};
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderButton, isRenderButton())