TextControlInnerElements.h [plain text]
#pragma once
#include "HTMLDivElement.h"
#include <wtf/Forward.h>
namespace WebCore {
class RenderTextControlInnerBlock;
class TextControlInnerContainer final : public HTMLDivElement {
public:
static Ref<TextControlInnerContainer> create(Document&);
protected:
TextControlInnerContainer(Document&);
RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
};
class TextControlInnerElement final : public HTMLDivElement {
public:
static Ref<TextControlInnerElement> create(Document&);
protected:
TextControlInnerElement(Document&);
std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
private:
bool isMouseFocusable() const override { return false; }
};
class TextControlInnerTextElement final : public HTMLDivElement {
public:
static Ref<TextControlInnerTextElement> create(Document&);
void defaultEventHandler(Event&) override;
RenderTextControlInnerBlock* renderer() const;
private:
TextControlInnerTextElement(Document&);
RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
bool isMouseFocusable() const override { return false; }
bool isTextControlInnerTextElement() const override { return true; }
};
class TextControlPlaceholderElement final : public HTMLDivElement {
public:
static Ref<TextControlPlaceholderElement> create(Document& document) { return adoptRef(*new TextControlPlaceholderElement(document)); }
private:
TextControlPlaceholderElement(Document&);
std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
};
class SearchFieldResultsButtonElement final : public HTMLDivElement {
public:
static Ref<SearchFieldResultsButtonElement> create(Document&);
void defaultEventHandler(Event&) override;
#if !PLATFORM(IOS)
bool willRespondToMouseClickEvents() override;
#endif
private:
SearchFieldResultsButtonElement(Document&);
bool isMouseFocusable() const override { return false; }
};
class SearchFieldCancelButtonElement final : public HTMLDivElement {
public:
static Ref<SearchFieldCancelButtonElement> create(Document&);
void defaultEventHandler(Event&) override;
#if !PLATFORM(IOS)
bool willRespondToMouseClickEvents() override;
#endif
private:
SearchFieldCancelButtonElement(Document&);
bool isMouseFocusable() const override { return false; }
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::TextControlInnerTextElement)
static bool isType(const WebCore::HTMLElement& element) { return element.isTextControlInnerTextElement(); }
static bool isType(const WebCore::Node& node) { return is<WebCore::HTMLElement>(node) && isType(downcast<WebCore::HTMLElement>(node)); }
SPECIALIZE_TYPE_TRAITS_END()