Commit b3fa3406 authored by carlosgc@webkit.org's avatar carlosgc@webkit.org

Scrollbar should not depend on EventHandler, Frame and FrameView

https://bugs.webkit.org/show_bug.cgi?id=114941

Reviewed by Darin Adler.

It's a layering violation that Scrollbar uses EventHandler, Frame
and FrameView. Frame is used to get the EventHandler that is used
to set mousePressed to false after a Scrollbar::mouseUp(). This is
not really needed, since EventHandler already sets m_mousePressed
to false when calling Scrollbar::mouseUp(). The PopupMenu windows
implementation also calls Scrollbar::mouseUp(), but that scrollbar
is not inside a FrameView.

* platform/Scrollbar.cpp:
(WebCore::Scrollbar::isScrollViewScrollbar):
isScrollViewScrollbar() is a method of ScrollView so we don't need
to cast to FrameView.
(WebCore::Scrollbar::mouseUp): Remove EventHandler ussage.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8db55015
2013-04-22 Carlos Garcia Campos <cgarcia@igalia.com>
Scrollbar should not depend on EventHandler, Frame and FrameView
https://bugs.webkit.org/show_bug.cgi?id=114941
Reviewed by Darin Adler.
It's a layering violation that Scrollbar uses EventHandler, Frame
and FrameView. Frame is used to get the EventHandler that is used
to set mousePressed to false after a Scrollbar::mouseUp(). This is
not really needed, since EventHandler already sets m_mousePressed
to false when calling Scrollbar::mouseUp(). The PopupMenu windows
implementation also calls Scrollbar::mouseUp(), but that scrollbar
is not inside a FrameView.
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::isScrollViewScrollbar):
isScrollViewScrollbar() is a method of ScrollView so we don't need
to cast to FrameView.
(WebCore::Scrollbar::mouseUp): Remove EventHandler ussage.
2013-04-22 Andreas Kling <akling@apple.com>
Shrink baseline size of WTF::Vector on 64-bit by switching to unsigned capacity and size.
......@@ -29,6 +29,7 @@
#include "GraphicsContext.h"
#include "PlatformMouseEvent.h"
#include "ScrollAnimator.h"
#include "ScrollView.h"
#include "ScrollableArea.h"
#include "ScrollbarTheme.h"
#include <algorithm>
......@@ -37,11 +38,6 @@
#include "PlatformGestureEvent.h"
#endif
// FIXME: The following #includes are a layering violation and should be removed.
#include "EventHandler.h"
#include "Frame.h"
#include "FrameView.h"
using namespace std;
#if PLATFORM(GTK)
......@@ -130,7 +126,7 @@ bool Scrollbar::isScrollableAreaActive() const
bool Scrollbar::isScrollViewScrollbar() const
{
return parent() && parent()->isFrameView() && toFrameView(parent())->isScrollViewScrollbar(this);
return parent() && parent()->isScrollViewScrollbar(this);
}
void Scrollbar::offsetDidChange()
......@@ -458,9 +454,6 @@ bool Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent)
m_scrollableArea->mouseExitedScrollbar(this);
}
if (parent() && parent()->isFrameView())
toFrameView(parent())->frame()->eventHandler()->setMousePressed(false);
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment