summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderTextControlSingleLine.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderTextControlSingleLine.h')
-rw-r--r--Source/WebCore/rendering/RenderTextControlSingleLine.h72
1 files changed, 28 insertions, 44 deletions
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.h b/Source/WebCore/rendering/RenderTextControlSingleLine.h
index bf9def4ef..73cbd5a69 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.h
@@ -20,25 +20,17 @@
*
*/
-#ifndef RenderTextControlSingleLine_h
-#define RenderTextControlSingleLine_h
+#pragma once
#include "HTMLInputElement.h"
#include "RenderTextControl.h"
namespace WebCore {
-class HTMLInputElement;
-
class RenderTextControlSingleLine : public RenderTextControl {
public:
- RenderTextControlSingleLine(HTMLInputElement&, PassRef<RenderStyle>);
+ RenderTextControlSingleLine(HTMLInputElement&, RenderStyle&&);
virtual ~RenderTextControlSingleLine();
- // FIXME: Move create*Style() to their classes.
- virtual PassRef<RenderStyle> createInnerTextStyle(const RenderStyle* startStyle) const override;
- PassRef<RenderStyle> createInnerBlockStyle(const RenderStyle* startStyle) const;
-
- void capsLockStateMayHaveChanged();
protected:
virtual void centerContainerIfNeeded(RenderBox*) const { }
@@ -51,40 +43,34 @@ protected:
private:
void textFormControlElement() const = delete;
- virtual bool hasControlClip() const override;
- virtual LayoutRect controlClipRect(const LayoutPoint&) const override;
- virtual bool isTextField() const override final { return true; }
+ bool hasControlClip() const override;
+ LayoutRect controlClipRect(const LayoutPoint&) const override;
+ bool isTextField() const final { return true; }
- virtual void paint(PaintInfo&, const LayoutPoint&) override;
- virtual void layout() override;
+ void layout() override;
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
+ bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
- virtual void autoscroll(const IntPoint&) override;
+ void autoscroll(const IntPoint&) override;
// Subclassed to forward to our inner div.
- virtual int scrollLeft() const override;
- virtual int scrollTop() const override;
- virtual int scrollWidth() const override;
- virtual int scrollHeight() const override;
- virtual void setScrollLeft(int) override;
- virtual void setScrollTop(int) override;
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) override final;
- virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) override final;
+ int scrollLeft() const override;
+ int scrollTop() const override;
+ int scrollWidth() const override;
+ int scrollHeight() const override;
+ void setScrollLeft(int) override;
+ void setScrollTop(int) override;
+ bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) final;
+ bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) final;
int textBlockWidth() const;
- virtual float getAvgCharWidth(AtomicString family) override;
- virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const override;
- virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
+ float getAverageCharWidth() override;
+ LayoutUnit preferredContentLogicalWidth(float charWidth) const override;
+ LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const override;
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
-
- bool textShouldBeTruncated() const;
+ void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
HTMLElement* innerSpinButtonElement() const;
-
- bool m_shouldDrawCapsLockIndicator;
- LayoutUnit m_desiredInnerTextLogicalHeight;
};
inline HTMLElement* RenderTextControlSingleLine::containerElement() const
@@ -97,24 +83,22 @@ inline HTMLElement* RenderTextControlSingleLine::innerBlockElement() const
return inputElement().innerBlockElement();
}
-RENDER_OBJECT_TYPE_CASTS(RenderTextControlSingleLine, isTextField())
-
// ----------------------------
class RenderTextControlInnerBlock final : public RenderBlockFlow {
public:
- RenderTextControlInnerBlock(Element& element, PassRef<RenderStyle> style)
- : RenderBlockFlow(element, std::move(style))
+ RenderTextControlInnerBlock(Element& element, RenderStyle&& style)
+ : RenderBlockFlow(element, WTFMove(style))
{
}
private:
- virtual bool hasLineIfEmpty() const override { return true; }
- virtual bool isTextControlInnerBlock() const override { return true; }
+ bool hasLineIfEmpty() const override { return true; }
+ bool isTextControlInnerBlock() const override { return true; }
+ bool canBeProgramaticallyScrolled() const override { return true; }
};
-RENDER_OBJECT_TYPE_CASTS(RenderTextControlInnerBlock, isTextControlInnerBlock())
-
-}
+} // namespace WebCore
-#endif
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTextControlSingleLine, isTextField())
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTextControlInnerBlock, isTextControlInnerBlock())