summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderListBox.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/rendering/RenderListBox.h
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/rendering/RenderListBox.h')
-rw-r--r--WebCore/rendering/RenderListBox.h44
1 files changed, 28 insertions, 16 deletions
diff --git a/WebCore/rendering/RenderListBox.h b/WebCore/rendering/RenderListBox.h
index b8c0540..e5454e5 100644
--- a/WebCore/rendering/RenderListBox.h
+++ b/WebCore/rendering/RenderListBox.h
@@ -1,7 +1,7 @@
/*
* This file is part of the select element renderer in WebCore.
*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,8 +39,21 @@ namespace WebCore {
class RenderListBox : public RenderBlock, private ScrollbarClient {
public:
RenderListBox(Element*);
- ~RenderListBox();
+ virtual ~RenderListBox();
+ void selectionChanged();
+
+ void setOptionsChanged(bool changed) { m_optionsChanged = changed; }
+
+ int listIndexAtOffset(int x, int y);
+ IntRect itemBoundingBoxRect(int tx, int ty, int index);
+
+ bool scrollToRevealElementAtListIndex(int index);
+ bool listIndexIsVisible(int index);
+
+ int scrollToward(const IntPoint&); // Returns the new index or -1 if no scroll occurred
+
+private:
virtual const char* renderName() const { return "RenderListBox"; }
virtual bool isListBox() const { return true; }
@@ -63,16 +76,6 @@ public:
virtual void layout();
- void selectionChanged();
-
- void setOptionsChanged(bool changed) { m_optionsChanged = changed; }
-
- int listIndexAtOffset(int x, int y);
- IntRect itemBoundingBoxRect(int tx, int ty, int index);
-
- bool scrollToRevealElementAtListIndex(int index);
- bool listIndexIsVisible(int index);
-
virtual bool canBeProgramaticallyScrolled(bool) const { return true; }
virtual void autoscroll();
virtual void stopAutoscroll();
@@ -80,8 +83,6 @@ public:
virtual bool shouldPanScroll() const { return true; }
virtual void panScroll(const IntPoint&);
- int scrollToward(const IntPoint&); // Returns the new index or -1 if no scroll occurred
-
virtual int verticalScrollbarWidth() const;
virtual int scrollLeft() const;
virtual int scrollTop() const;
@@ -92,15 +93,17 @@ public:
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
-protected:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
-private:
// ScrollbarClient interface.
virtual void valueChanged(Scrollbar*);
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
virtual bool isActive() const;
virtual bool scrollbarCornerPresent() const { return false; } // We don't support resize on list boxes yet. If we did this would have to change.
+ virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const;
+ virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const;
+ virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const;
+ virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
void setHasVerticalScrollbar(bool hasScrollbar);
PassRefPtr<Scrollbar> createScrollbar();
@@ -126,6 +129,15 @@ private:
RefPtr<Scrollbar> m_vBar;
};
+inline RenderListBox* toRenderListBox(RenderObject* object)
+{
+ ASSERT(!object || object->isListBox());
+ return static_cast<RenderListBox*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderListBox(const RenderListBox*);
+
} // namepace WebCore
#endif // RenderListBox_h