Commit cd2cd536 authored by ggaren's avatar ggaren

Reviewed by Darin.

        
        Fixed <rdar://problem/4766987>
        
        - renamed ScrollBar to Scrollbar and scroll bar to scrollbar in every case
        except for file names.
        
        - fixed RenderLayer to properly tear down scrollbars, removing them from
        their parents.

        * bindings/js/kjs_window.cpp:
        (KJS::showModalDialog):
        (KJS::setWindowFeature):
        (KJS::parseWindowFeatures):
        * bridge/BrowserExtension.h:
        * dom/Document.cpp:
        (WebCore::Document::setInPageCache):
        * html/HTMLFrameElement.cpp:
        (WebCore::HTMLFrameElement::init):
        (WebCore::HTMLFrameElement::parseMappedAttribute):
        * html/HTMLFrameElement.h:
        (WebCore::HTMLFrameElement::scrollingMode):
        * page/Frame.cpp:
        (WebCore::Frame::finishedParsing):
        (WebCore::Frame::scrollbarsVisible):
        * page/FrameView.cpp:
        (WebCore::FrameViewPrivate::FrameViewPrivate):
        (WebCore::FrameViewPrivate::reset):
        (WebCore::FrameView::~FrameView):
        (WebCore::FrameView::resetScrollbars):
        (WebCore::FrameView::clear):
        (WebCore::FrameView::initScrollbars):
        (WebCore::FrameView::applyOverflowToViewport):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::handleMousePressEvent):
        (WebCore::selectCursor):
        (WebCore::FrameView::handleMouseMoveEvent):
        (WebCore::FrameView::setScrollbarsMode):
        (WebCore::FrameView::setVScrollbarMode):
        (WebCore::FrameView::setHScrollbarMode):
        (WebCore::FrameView::restoreScrollbar):
        (WebCore::FrameView::dispatchMouseEvent):
        (WebCore::FrameView::scrollbarMoved):
        * page/FrameView.h:
        * page/MouseEventWithHitTestResults.cpp:
        (WebCore::MouseEventWithHitTestResults::MouseEventWithHitTestResults):
        * page/MouseEventWithHitTestResults.h:
        (WebCore::MouseEventWithHitTestResults::scrollbar):
        * platform/ScrollBar.cpp:
        (WebCore::Scrollbar::Scrollbar):
        (WebCore::Scrollbar::setValue):
        (WebCore::Scrollbar::setProportion):
        (WebCore::Scrollbar::setSteps):
        (WebCore::Scrollbar::scroll):
        * platform/ScrollBar.h:
        (WebCore::):
        (WebCore::ScrollbarClient::~ScrollbarClient):
        (WebCore::Scrollbar::~Scrollbar):
        (WebCore::Scrollbar::orientation):
        (WebCore::Scrollbar::controlSize):
        (WebCore::Scrollbar::hasPlatformScrollbars):
        (WebCore::Scrollbar::client):
        * platform/ScrollBarMode.h:
        (WebCore::):
        * platform/ScrollView.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::isPointInScrollbar):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        (WebCore::RenderLayer::~RenderLayer):
        (WebCore::RenderLayer::scrollToOffset):
        (WebCore::RenderLayer::horizontaScrollbarWidget):
        (WebCore::RenderLayer::verticalScrollbarWidget):
        (WebCore::RenderLayer::valueChanged):
        (WebCore::RenderLayer::createScrollbar):
        (WebCore::RenderLayer::destroyScrollbar):
        (WebCore::RenderLayer::setHasHorizontalScrollbar):
        (WebCore::RenderLayer::setHasVerticalScrollbar):
        (WebCore::RenderLayer::verticalScrollbarWidth):
        (WebCore::RenderLayer::horizontalScrollbarHeight):
        (WebCore::RenderLayer::updateScrollInfoAfterLayout):
        * rendering/RenderLayer.h:
        (WebCore::RenderLayer::horizontalScrollbar):
        (WebCore::RenderLayer::verticalScrollbar):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::~RenderListBox):
        (WebCore::RenderListBox::calcMinMaxWidth):
        (WebCore::RenderListBox::isPointInScrollbar):
        (WebCore::RenderListBox::optionAtPoint):
        (WebCore::RenderListBox::valueChanged):
        * rendering/RenderListBox.h:
        * rendering/RenderObject.h:
        (WebCore::RenderObject::NodeInfo::scrollbar):
        (WebCore::RenderObject::NodeInfo::setScrollbar):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 20a0d293
2006-10-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin.
Fixed <rdar://problem/4766987>
- renamed ScrollBar to Scrollbar and scroll bar to scrollbar in every case
except for file names.
- fixed RenderLayer to properly tear down scrollbars, removing them from
their parents.
* bindings/js/kjs_window.cpp:
(KJS::showModalDialog):
(KJS::setWindowFeature):
(KJS::parseWindowFeatures):
* bridge/BrowserExtension.h:
* dom/Document.cpp:
(WebCore::Document::setInPageCache):
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::init):
(WebCore::HTMLFrameElement::parseMappedAttribute):
* html/HTMLFrameElement.h:
(WebCore::HTMLFrameElement::scrollingMode):
* page/Frame.cpp:
(WebCore::Frame::finishedParsing):
(WebCore::Frame::scrollbarsVisible):
* page/FrameView.cpp:
(WebCore::FrameViewPrivate::FrameViewPrivate):
(WebCore::FrameViewPrivate::reset):
(WebCore::FrameView::~FrameView):
(WebCore::FrameView::resetScrollbars):
(WebCore::FrameView::clear):
(WebCore::FrameView::initScrollbars):
(WebCore::FrameView::applyOverflowToViewport):
(WebCore::FrameView::layout):
(WebCore::FrameView::handleMousePressEvent):
(WebCore::selectCursor):
(WebCore::FrameView::handleMouseMoveEvent):
(WebCore::FrameView::setScrollbarsMode):
(WebCore::FrameView::setVScrollbarMode):
(WebCore::FrameView::setHScrollbarMode):
(WebCore::FrameView::restoreScrollbar):
(WebCore::FrameView::dispatchMouseEvent):
(WebCore::FrameView::scrollbarMoved):
* page/FrameView.h:
* page/MouseEventWithHitTestResults.cpp:
(WebCore::MouseEventWithHitTestResults::MouseEventWithHitTestResults):
* page/MouseEventWithHitTestResults.h:
(WebCore::MouseEventWithHitTestResults::scrollbar):
* platform/ScrollBar.cpp:
(WebCore::Scrollbar::Scrollbar):
(WebCore::Scrollbar::setValue):
(WebCore::Scrollbar::setProportion):
(WebCore::Scrollbar::setSteps):
(WebCore::Scrollbar::scroll):
* platform/ScrollBar.h:
(WebCore::):
(WebCore::ScrollbarClient::~ScrollbarClient):
(WebCore::Scrollbar::~Scrollbar):
(WebCore::Scrollbar::orientation):
(WebCore::Scrollbar::controlSize):
(WebCore::Scrollbar::hasPlatformScrollbars):
(WebCore::Scrollbar::client):
* platform/ScrollBarMode.h:
(WebCore::):
* platform/ScrollView.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::isPointInScrollbar):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::horizontaScrollbarWidget):
(WebCore::RenderLayer::verticalScrollbarWidget):
(WebCore::RenderLayer::valueChanged):
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::destroyScrollbar):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
(WebCore::RenderLayer::verticalScrollbarWidth):
(WebCore::RenderLayer::horizontalScrollbarHeight):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::horizontalScrollbar):
(WebCore::RenderLayer::verticalScrollbar):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::~RenderListBox):
(WebCore::RenderListBox::calcMinMaxWidth):
(WebCore::RenderListBox::isPointInScrollbar):
(WebCore::RenderListBox::optionAtPoint):
(WebCore::RenderListBox::valueChanged):
* rendering/RenderListBox.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::NodeInfo::scrollbar):
(WebCore::RenderObject::NodeInfo::setScrollbar):
2006-10-05 Don Gibson <dgibson77@gmail.com>
Reviewed by Adam.
......@@ -640,7 +640,7 @@ static JSValue* showModalDialog(ExecState* exec, Window* openerWindow, const Lis
wargs.dialog = true;
wargs.resizable = boolFeature(features, "resizable");
wargs.scrollBarsVisible = boolFeature(features, "scroll", true);
wargs.scrollbarsVisible = boolFeature(features, "scroll", true);
wargs.statusBarVisible = boolFeature(features, "status", !trusted);
wargs.menuBarVisible = false;
wargs.toolBarVisible = false;
......@@ -1383,7 +1383,7 @@ static void setWindowFeature(const String& keyString, const String& valueString,
else if (keyString == "fullscreen")
windowArgs.fullscreen = value;
else if (keyString == "scrollbars")
windowArgs.scrollBarsVisible = value;
windowArgs.scrollbarsVisible = value;
}
// Though isspace() considers \t and \v to be whitespace, Win IE doesn't.
......@@ -1415,7 +1415,7 @@ static void parseWindowFeatures(const String& features, WindowArgs& windowArgs)
windowArgs.statusBarVisible = true;
windowArgs.toolBarVisible = true;
windowArgs.locationBarVisible = true;
windowArgs.scrollBarsVisible = true;
windowArgs.scrollbarsVisible = true;
windowArgs.resizable = true;
return;
......@@ -1425,7 +1425,7 @@ static void parseWindowFeatures(const String& features, WindowArgs& windowArgs)
windowArgs.statusBarVisible = false;
windowArgs.toolBarVisible = false;
windowArgs.locationBarVisible = false;
windowArgs.scrollBarsVisible = false;
windowArgs.scrollbarsVisible = false;
windowArgs.resizable = false;
// Tread lightly in this code -- it was specifically designed to mimic Win IE's parsing behavior.
......
......@@ -46,7 +46,7 @@ struct WindowArgs {
bool statusBarVisible;
bool toolBarVisible;
bool locationBarVisible;
bool scrollBarsVisible;
bool scrollbarsVisible;
bool resizable;
bool fullscreen;
......
......@@ -2570,7 +2570,7 @@ void Document::setInPageCache(bool flag)
ASSERT(m_savedRenderer == 0);
m_savedRenderer = renderer();
if (m_view)
m_view->resetScrollBars();
m_view->resetScrollbars();
} else {
ASSERT(renderer() == 0 || renderer() == m_savedRenderer);
ASSERT(m_renderArena);
......
......@@ -59,7 +59,7 @@ void HTMLFrameElement::init()
m_frameBorderSet = false;
m_marginWidth = -1;
m_marginHeight = -1;
m_scrolling = ScrollBarAuto;
m_scrolling = ScrollbarAuto;
m_noResize = false;
m_viewSource = false;
}
......@@ -147,9 +147,9 @@ void HTMLFrameElement::parseMappedAttribute(MappedAttribute *attr)
} else if (attr->name() == scrollingAttr) {
// Auto and yes both simply mean "allow scrolling." No means "don't allow scrolling."
if (equalIgnoringCase(attr->value(), "auto") || equalIgnoringCase(attr->value(), "yes"))
m_scrolling = ScrollBarAuto;
m_scrolling = ScrollbarAuto;
else if (equalIgnoringCase(attr->value(), "no"))
m_scrolling = ScrollBarAlwaysOff;
m_scrolling = ScrollbarAlwaysOff;
// FIXME: If we are already attached, this has no effect.
} else if (attr->name() == viewsourceAttr) {
m_viewSource = !attr->isNull();
......
......@@ -27,7 +27,7 @@
#define HTMLFrameElement_H
#include "HTMLElement.h"
#include "ScrollBarMode.h"
#include "ScrollbarMode.h"
namespace WebCore {
......@@ -72,7 +72,7 @@ public:
virtual bool isURLAttribute(Attribute*) const;
ScrollBarMode scrollingMode() const { return m_scrolling; }
ScrollbarMode scrollingMode() const { return m_scrolling; }
int getMarginWidth() const { return m_marginWidth; }
int getMarginHeight() const { return m_marginHeight; }
......@@ -113,7 +113,7 @@ protected:
int m_marginWidth;
int m_marginHeight;
ScrollBarMode m_scrolling;
ScrollbarMode m_scrolling;
bool m_frameBorder : 1;
bool m_frameBorderSet : 1;
......
......@@ -859,7 +859,7 @@ void Frame::finishedParsing()
// check if the scrollbars are really needed for the content
// if not, remove them, relayout, and repaint
d->m_view->restoreScrollBar();
d->m_view->restoreScrollbar();
gotoAnchor();
}
......@@ -3201,7 +3201,7 @@ bool Frame::scrollbarsVisible()
if (!view())
return false;
if (view()->hScrollBarMode() == ScrollBarAlwaysOff || view()->vScrollBarMode() == ScrollBarAlwaysOff)
if (view()->hScrollbarMode() == ScrollbarAlwaysOff || view()->vScrollbarMode() == ScrollbarAlwaysOff)
return false;
return true;
......
This diff is collapsed.
......@@ -111,9 +111,9 @@ public:
void setMarginWidth(int);
void setMarginHeight(int);
virtual void setVScrollBarMode(ScrollBarMode);
virtual void setHScrollBarMode(ScrollBarMode);
virtual void setScrollBarsMode(ScrollBarMode);
virtual void setVScrollbarMode(ScrollbarMode);
virtual void setHScrollbarMode(ScrollbarMode);
virtual void setScrollbarsMode(ScrollbarMode);
void print();
......@@ -126,7 +126,7 @@ public:
void addRepaintInfo(RenderObject*, const IntRect&);
void resetScrollBars();
void resetScrollbars();
void clear();
......@@ -145,7 +145,7 @@ public:
bool passMouseMoveEventToSubframe(MouseEventWithHitTestResults&, Frame*);
bool passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&, Frame*);
bool passWheelEventToSubframe(PlatformWheelEvent&, Frame*);
bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&, PlatformScrollBar*);
bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&, PlatformScrollbar*);
bool mousePressed();
void setMousePressed(bool);
......@@ -178,7 +178,7 @@ public:
void scheduleHoverStateUpdate();
void adjustViewSize();
void initScrollBars();
void initScrollbars();
void setHasBorder(bool);
bool hasBorder() const;
......@@ -202,7 +202,7 @@ public:
private:
void cleared();
void scrollBarMoved();
void scrollbarMoved();
void resetCursor();
void invalidateClick();
......@@ -233,7 +233,7 @@ private:
Node *nodeUnderMouse() const;
void restoreScrollBar();
void restoreScrollbar();
MouseEventWithHitTestResults prepareMouseEvent(bool readonly, bool active, bool mouseMove, const PlatformMouseEvent&);
......@@ -242,7 +242,7 @@ private:
bool dispatchDragEvent(const AtomicString& eventType, Node* target,
const PlatformMouseEvent&, Clipboard*);
void applyOverflowToViewport(RenderObject* o, ScrollBarMode& hMode, ScrollBarMode& vMode);
void applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, ScrollbarMode& vMode);
virtual bool isFrameView() const;
......
......@@ -35,7 +35,7 @@ static inline Element* targetElement(Node* node)
}
MouseEventWithHitTestResults::MouseEventWithHitTestResults(const PlatformMouseEvent& event,
PassRefPtr<Node> node, PlatformScrollBar* scrollbar, bool isOverLink)
PassRefPtr<Node> node, PlatformScrollbar* scrollbar, bool isOverLink)
: m_event(event)
, m_targetNode(node)
, m_targetElement(targetElement(m_targetNode.get()))
......
......@@ -26,22 +26,22 @@
namespace WebCore {
class PlatformScrollBar;
class PlatformScrollbar;
class MouseEventWithHitTestResults {
public:
MouseEventWithHitTestResults(const PlatformMouseEvent&, PassRefPtr<Node>, PlatformScrollBar*, bool isOverLink);
MouseEventWithHitTestResults(const PlatformMouseEvent&, PassRefPtr<Node>, PlatformScrollbar*, bool isOverLink);
const PlatformMouseEvent& event() const { return m_event; }
Node* targetNode() const;
PlatformScrollBar* scrollbar() const { return m_scrollbar; }
PlatformScrollbar* scrollbar() const { return m_scrollbar; }
bool isOverLink() const { return m_isOverLink; }
private:
PlatformMouseEvent m_event;
RefPtr<Node> m_targetNode;
RefPtr<Element> m_targetElement;
PlatformScrollBar* m_scrollbar;
PlatformScrollbar* m_scrollbar;
bool m_isOverLink;
};
......
......@@ -28,7 +28,7 @@
namespace WebCore {
ScrollBar::ScrollBar(ScrollBarClient* client, ScrollBarOrientation orientation, ScrollBarControlSize controlSize)
Scrollbar::Scrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
: m_client(client)
, m_orientation(orientation)
, m_controlSize(controlSize)
......@@ -40,7 +40,7 @@ ScrollBar::ScrollBar(ScrollBarClient* client, ScrollBarOrientation orientation,
{
}
bool ScrollBar::setValue(int v)
bool Scrollbar::setValue(int v)
{
int maxPos = m_totalSize - m_visibleSize;
if (v > maxPos)
......@@ -59,7 +59,7 @@ bool ScrollBar::setValue(int v)
return true;
}
void ScrollBar::setProportion(int visibleSize, int totalSize)
void Scrollbar::setProportion(int visibleSize, int totalSize)
{
m_visibleSize = visibleSize;
m_totalSize = totalSize;
......@@ -67,16 +67,16 @@ void ScrollBar::setProportion(int visibleSize, int totalSize)
updateThumbProportion();
}
void ScrollBar::setSteps(int lineStep, int pageStep)
void Scrollbar::setSteps(int lineStep, int pageStep)
{
m_lineStep = lineStep;
m_pageStep = pageStep;
}
bool ScrollBar::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
bool Scrollbar::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
{
float delta = 0.0;
if ((direction == ScrollUp && m_orientation == VerticalScrollBar) || (direction == ScrollLeft && m_orientation == HorizontalScrollBar)) {
if ((direction == ScrollUp && m_orientation == VerticalScrollbar) || (direction == ScrollLeft && m_orientation == HorizontalScrollbar)) {
if (granularity == ScrollByLine) {
delta = -m_lineStep;
} else if (granularity == ScrollByPage) {
......@@ -86,7 +86,7 @@ bool ScrollBar::scroll(ScrollDirection direction, ScrollGranularity granularity,
} else if (granularity == ScrollByWheel) {
delta = -m_lineStep;
}
} else if ((direction == ScrollDown && m_orientation == VerticalScrollBar) || (direction == ScrollRight && m_orientation == HorizontalScrollBar)) {
} else if ((direction == ScrollDown && m_orientation == VerticalScrollbar) || (direction == ScrollRight && m_orientation == HorizontalScrollbar)) {
if (granularity == ScrollByLine) {
delta = m_lineStep;
} else if (granularity == ScrollByPage) {
......
......@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ScrollBar_h
#define ScrollBar_h
#ifndef Scrollbar_h
#define Scrollbar_h
#include "Shared.h"
......@@ -32,7 +32,7 @@ namespace WebCore {
class GraphicsContext;
class IntRect;
class ScrollBar;
class Scrollbar;
class PlatformMouseEvent;
// These match the numbers we use over in WebKit (WebFrameView.m).
......@@ -53,29 +53,29 @@ enum ScrollGranularity {
ScrollByWheel
};
enum ScrollBarOrientation { HorizontalScrollBar, VerticalScrollBar };
enum ScrollbarOrientation { HorizontalScrollbar, VerticalScrollbar };
enum ScrollBarControlSize { RegularScrollBar, SmallScrollBar, MiniScrollBar };
enum ScrollbarControlSize { RegularScrollbar, SmallScrollbar, MiniScrollbar };
class ScrollBarClient {
class ScrollbarClient {
public:
virtual ~ScrollBarClient() {}
virtual void valueChanged(ScrollBar*) = 0;
virtual ~ScrollbarClient() {}
virtual void valueChanged(Scrollbar*) = 0;
};
class ScrollBar : public Shared<ScrollBar> {
class Scrollbar : public Shared<Scrollbar> {
protected:
ScrollBar(ScrollBarClient*, ScrollBarOrientation, ScrollBarControlSize);
Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
public:
virtual ~ScrollBar() {}
virtual ~Scrollbar() {}
virtual bool isWidget() const = 0;
ScrollBarOrientation orientation() const { return m_orientation; }
ScrollbarOrientation orientation() const { return m_orientation; }
int value() const { return m_currentPos; }
ScrollBarControlSize controlSize() const { return m_controlSize; }
ScrollbarControlSize controlSize() const { return m_controlSize; }
void setSteps(int lineStep, int pageStep);
......@@ -90,7 +90,7 @@ public:
virtual void setEnabled(bool) = 0;
virtual void paint(GraphicsContext*, const IntRect& damageRect) = 0;
static bool hasPlatformScrollBars() {
static bool hasPlatformScrollbars() {
// To use the platform's built-in scrollbars by default, return true. We may
// support styled engine scrollbars someday, and some platforms may wish to not
// implement a platform scrollbar at all by default. That's what this method is for.
......@@ -107,11 +107,11 @@ protected:
virtual void updateThumbPosition() = 0;
virtual void updateThumbProportion() = 0;
ScrollBarClient* client() const { return m_client; }
ScrollbarClient* client() const { return m_client; }
ScrollBarClient* m_client;
ScrollBarOrientation m_orientation;
ScrollBarControlSize m_controlSize;
ScrollbarClient* m_client;
ScrollbarOrientation m_orientation;
ScrollbarControlSize m_controlSize;
int m_visibleSize;
int m_totalSize;
int m_currentPos;
......
......@@ -23,12 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ScrollBarMode_h
#define ScrollBarMode_h
#ifndef ScrollbarMode_h
#define ScrollbarMode_h
namespace WebCore {
enum ScrollBarMode { ScrollBarAuto, ScrollBarAlwaysOff, ScrollBarAlwaysOn };
enum ScrollbarMode { ScrollbarAuto, ScrollbarAlwaysOff, ScrollbarAlwaysOn };
}
......
......@@ -26,7 +26,7 @@
#ifndef ScrollView_H
#define ScrollView_H
#include "ScrollBarMode.h"
#include "ScrollbarMode.h"
#include "ScrollBar.h"
#include "Widget.h"
#include <wtf/Platform.h>
......@@ -38,7 +38,7 @@ class QScrollArea;
namespace WebCore {
class FloatRect;
class PlatformWheelEvent;
class PlatformScrollBar;
class PlatformScrollbar;
class ScrollView : public Widget {
public:
......@@ -55,17 +55,17 @@ namespace WebCore {
virtual void setContentsPos(int x, int y);
virtual void setVScrollBarMode(ScrollBarMode);
virtual void setHScrollBarMode(ScrollBarMode);
virtual void setVScrollbarMode(ScrollbarMode);
virtual void setHScrollbarMode(ScrollbarMode);
// Set the mode for both scroll bars at once.
virtual void setScrollBarsMode(ScrollBarMode);
// Set the mode for both scrollbars at once.
virtual void setScrollbarsMode(ScrollbarMode);
// This gives us a means of blocking painting on our scrollbars until the first layout has occurred.
void suppressScrollBars(bool suppressed, bool repaintOnUnsuppress = false);
void suppressScrollbars(bool suppressed, bool repaintOnUnsuppress = false);
ScrollBarMode vScrollBarMode() const;
ScrollBarMode hScrollBarMode() const;
ScrollbarMode vScrollbarMode() const;
ScrollbarMode hScrollbarMode() const;
void addChild(Widget*, int x = 0, int y = 0);
void removeChild(Widget*);
......@@ -84,7 +84,7 @@ namespace WebCore {
bool inWindow() const;
// For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
PlatformScrollBar* scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent);
PlatformScrollbar* scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent);
// This method exists for scrollviews that need to handle wheel events manually.
// On Mac the underlying NSScrollView just does the scrolling, but on other platforms
......@@ -110,7 +110,7 @@ namespace WebCore {
virtual void scrolled() const;
private:
void updateScrollBars(const IntSize& desiredOffset);
void updateScrollbars(const IntSize& desiredOffset);
IntSize maximumScroll() const;
class ScrollViewPrivate;
ScrollViewPrivate* m_data;
......@@ -123,7 +123,7 @@ namespace WebCore {
ScrollView();
~ScrollView();
private:
void updateScrollBars();
void updateScrollbars();
IntSize maximumScroll() const;
int updateScrollInfo(short type, int current, int max, int pageSize);
class ScrollViewPrivate;
......
......@@ -2508,7 +2508,7 @@ bool RenderBlock::isPointInScrollbar(NodeInfo& info, int _x, int _y, int _tx, in
width() - borderLeft() - borderRight() - m_layer->verticalScrollbarWidth(),
m_layer->horizontalScrollbarHeight());
if (horizRect.contains(_x, _y)) {
info.setScrollbar(m_layer->horizontalScrollbarWidget());
info.setScrollbar(m_layer->horizontaScrollbarWidget());
return true;
}
}
......
......@@ -126,8 +126,6 @@ m_scrollOriginX(0),
m_scrollLeftOverflow(0),
m_scrollWidth(0),
m_scrollHeight(0),
m_hBar(0),
m_vBar(0),
m_inResizeMode(false),
m_resizeCornerImage(0),
m_posZOrderList(0),
......@@ -148,10 +146,12 @@ m_marquee(0)
RenderLayer::~RenderLayer()
{
destroyScrollbar(HorizontalScrollbar);
destroyScrollbar(VerticalScrollbar);
// Child layers will be deleted by their corresponding render objects, so
// our destructor doesn't have to do anything.
delete m_hBar;
delete m_vBar;
// we don't need to delete them ourselves.
delete m_resizeCornerImage;
delete m_posZOrderList;
delete m_negZOrderList;
......@@ -603,7 +603,7 @@ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repai
RenderView* view = renderer()->view();
if (view) {
#if __APPLE__
#if PLATFORM(MAC)
// Update dashboard regions, scrolling may change the clip of a
// particular region.
view->frameView()->updateDashboardRegions();
......@@ -847,23 +847,23 @@ void RenderLayer::resize(const PlatformMouseEvent& evt, const IntSize& offsetFro
}
}
PlatformScrollBar* RenderLayer::horizontalScrollbarWidget() const
PlatformScrollbar* RenderLayer::horizontaScrollbarWidget() const
{
if (m_hBar && m_hBar->isWidget())
return static_cast<PlatformScrollBar*>(m_hBar);
return static_cast<PlatformScrollbar*>(m_hBar.get());
return 0;
}
PlatformScrollBar* RenderLayer::verticalScrollbarWidget() const
PlatformScrollbar* RenderLayer::verticalScrollbarWidget() const
{
if (m_vBar && m_vBar->isWidget())
return static_cast<PlatformScrollBar*>(m_vBar);
return static_cast<PlatformScrollbar*>(m_vBar.get());
return 0;
}
void RenderLayer::valueChanged(ScrollBar*)
void RenderLayer::valueChanged(Scrollbar*)
{
// Update scroll position from scroll bars.
// Update scroll position from scrollbars.
bool needUpdate = false;
int newX = scrollXOffset();
......@@ -885,37 +885,32 @@ void RenderLayer::valueChanged(ScrollBar*)
scrollToOffset(newX, newY, false);
}
ScrollBar* RenderLayer::createScrollbar(ScrollBarOrientation orientation)
PassRefPtr<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientation)
{
if (ScrollBar::hasPlatformScrollBars()) {
PlatformScrollBar* widget = new PlatformScrollBar(this, orientation, RegularScrollBar);
widget->ref();
m_object->element()->document()->view()->addChild(widget);
return widget;
if (Scrollbar::hasPlatformScrollbars()) {
RefPtr<PlatformScrollbar> widget = new PlatformScrollbar(this, orientation, RegularScrollbar);
m_object->element()->document()->view()->addChild(widget.get());
return widget.release();
}
// FIXME: Create scrollbars using the engine.
return 0;
}
void RenderLayer::destroyScrollbar(ScrollBarOrientation orientation)
void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
{
if (orientation == HorizontalScrollBar) {
if (m_hBar->isWidget()) {
m_object->element()->document()->view()->removeChild(horizontalScrollbarWidget());
m_hBar->deref();
m_hBar = 0;
}
// FIXME: Destroy the engine scrollbar.
} else {
if (m_vBar->isWidget()) {
m_object->element()->document()->view()->removeChild(verticalScrollbarWidget());
m_vBar->deref();
m_vBar = 0;
RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar : m_vBar;
if (scrollbar) {
if (scrollbar->isWidget()) {
PlatformScrollbar* scrollbarWidget = static_cast<PlatformScrollbar*>(scrollbar.get());
if (scrollbarWidget->parent()->isFrameView())
static_cast<FrameView*>(scrollbarWidget->parent())->removeChild(scrollbarWidget);
scrollbarWidget->setParent(0);
}
// FIXME: Destroy the engine scrollbar.
scrollbar = 0;
}
}
......@@ -925,11 +920,11 @@ void RenderLayer::setHasHorizontalScrollbar(bool hasScrollbar)
return;
if (hasScrollbar)
m_hBa