diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/RenderTextControlSingleLine.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/rendering/RenderTextControlSingleLine.h')
-rw-r--r-- | Source/WebCore/rendering/RenderTextControlSingleLine.h | 72 |
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()) |