summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderTextControl.h
diff options
context:
space:
mode:
authorFeng Qian <>2009-04-10 18:11:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 18:11:29 -0700
commit8f72e70a9fd78eec56623b3a62e68f16b7b27e28 (patch)
tree181bf9a400c30a1bf34ea6d72560e8d00111d549 /WebCore/rendering/RenderTextControl.h
parent7ed56f225e0ade046e1c2178977f72b2d896f196 (diff)
downloadexternal_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.zip
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.gz
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.bz2
AI 145796: Land the WebKit merge @r42026.
Automated import of CL 145796
Diffstat (limited to 'WebCore/rendering/RenderTextControl.h')
-rw-r--r--WebCore/rendering/RenderTextControl.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index 86d3f8a..e4f7747 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -27,7 +27,7 @@
namespace WebCore {
class FormControlElement;
-class Selection;
+class VisibleSelection;
class TextControlInnerElement;
class TextControlInnerTextElement;
@@ -36,6 +36,7 @@ public:
virtual ~RenderTextControl();
virtual const char* renderName() const { return "RenderTextControl"; }
+ virtual bool isTextControl() const { return true; }
virtual bool hasControlClip() const { return false; }
virtual IntRect controlClipRect(int tx, int ty) const;
virtual void calcHeight();
@@ -45,8 +46,8 @@ public:
virtual bool canHaveChildren() const { return false; }
virtual bool avoidsFloats() const { return true; }
- virtual bool isEdited() const { return m_edited; }
- virtual void setEdited(bool isEdited) { m_edited = isEdited; }
+ bool isEdited() const { return m_edited; }
+ void setEdited(bool isEdited) { m_edited = isEdited; }
bool isUserEdited() const { return m_userEdited; }
void setUserEdited(bool isUserEdited);
@@ -57,7 +58,7 @@ public:
void setSelectionEnd(int);
void select();
void setSelectionRange(int start, int end);
- Selection selection(int start, int end) const;
+ VisibleSelection selection(int start, int end) const;
virtual void subtreeHasChanged();
String text();
@@ -67,16 +68,6 @@ public:
virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
virtual bool canBeProgramaticallyScrolled(bool) const { return true; }
- virtual void autoscroll();
-
- // Subclassed to forward to our inner div.
- virtual int scrollLeft() const;
- virtual int scrollTop() const;
- virtual int scrollWidth() const;
- virtual int scrollHeight() const;
- virtual void setScrollLeft(int);
- virtual void setScrollTop(int);
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
VisiblePosition visiblePositionForIndex(int index);
int indexForVisiblePosition(const VisiblePosition&);
@@ -88,10 +79,10 @@ protected:
void adjustInnerTextStyle(const RenderStyle* startStyle, RenderStyle* textBlockStyle) const;
void setInnerTextValue(const String&);
- virtual void styleDidChange(RenderStyle::Diff, const RenderStyle* oldStyle);
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
void createSubtreeIfNeeded(TextControlInnerElement* innerBlock);
- void hitInnerTextBlock(HitTestResult&, int x, int y, int tx, int ty);
+ void hitInnerTextElement(HitTestResult&, int x, int y, int tx, int ty);
void forwardEvent(Event*);
int textBlockWidth() const;
@@ -115,6 +106,21 @@ private:
RefPtr<TextControlInnerTextElement> m_innerText;
};
+inline RenderTextControl* toRenderTextControl(RenderObject* o)
+{
+ ASSERT(!o || o->isTextControl());
+ return static_cast<RenderTextControl*>(o);
+}
+
+inline const RenderTextControl* toRenderTextControl(const RenderObject* o)
+{
+ ASSERT(!o || o->isTextControl());
+ return static_cast<const RenderTextControl*>(o);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderTextControl(const RenderTextControl*);
+
} // namespace WebCore
#endif // RenderTextControl_h