From 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 11 Aug 2009 17:01:47 +0100 Subject: Merge in WebKit r47029. --- WebCore/rendering/RenderListBox.h | 44 +++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'WebCore/rendering/RenderListBox.h') 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 createScrollbar(); @@ -126,6 +129,15 @@ private: RefPtr m_vBar; }; +inline RenderListBox* toRenderListBox(RenderObject* object) +{ + ASSERT(!object || object->isListBox()); + return static_cast(object); +} + +// This will catch anyone doing an unnecessary cast. +void toRenderListBox(const RenderListBox*); + } // namepace WebCore #endif // RenderListBox_h -- cgit v1.1