Commit 9229f615 authored by mrobinson@webkit.org's avatar mrobinson@webkit.org
Browse files

2011-01-16 Martin Robinson <mrobinson@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
        https://bugs.webkit.org/show_bug.cgi?id=49177

        * platform/gtk/Skipped: Unskip this test, as it's now passing.
2011-01-16  Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
        https://bugs.webkit.org/show_bug.cgi?id=49177

        * platform/ScrollView.cpp: Move the platform guards around a little. GTK+
        now shares the implementation of platformAddChild and platformRemoveChild,
        but has its own implementation of removeChild, which knows how to inform
        main frame scrollbars that they no longer control the WebCore scrollbar.
        * platform/gtk/MainFrameScrollbarGtk.cpp:
        (MainFrameScrollbarGtk::attachAdjustment): If we are attaching the same adjustment
        that we already have, bail out early. Apply the value changed signal handler
        after configuring the adjustment. We don't want our reset of the adjustment to
        stomp on WebCore values.
        (MainFrameScrollbarGtk::gtkValueChanged): Do not adjust the value if the WebCore
        state already matches ours. This prevents some unnecessary recursion
        * platform/gtk/ScrollViewGtk.cpp:
        (WebCore::ScrollView::removeChild): Added, special cases main frame scrollbars
        which need their adjustments detached.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 931a4158
2011-01-16 Martin Robinson <mrobinson@igalia.com>
Reviewed by Xan Lopez.
[GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
https://bugs.webkit.org/show_bug.cgi?id=49177
* platform/gtk/Skipped: Unskip this test, as it's now passing.
2011-01-16 Oliver Hunt <oliver@apple.com>
 
Reviewed by Sam Weinig.
......
......@@ -5522,9 +5522,6 @@ fast/frames/meta-refresh-user-gesture.html
# https://bugs.webkit.org/show_bug.cgi?id=49052
fast/canvas/pointInPath.html
# https://bugs.webkit.org/show_bug.cgi?id=49177
fast/events/scroll-after-click-on-tab-index.html
# https://bugs.webkit.org/show_bug.cgi?id=49179
animations/stop-animation-on-suspend.html
......
2011-01-16 Martin Robinson <mrobinson@igalia.com>
Reviewed by Xan Lopez.
[GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
https://bugs.webkit.org/show_bug.cgi?id=49177
* platform/ScrollView.cpp: Move the platform guards around a little. GTK+
now shares the implementation of platformAddChild and platformRemoveChild,
but has its own implementation of removeChild, which knows how to inform
main frame scrollbars that they no longer control the WebCore scrollbar.
* platform/gtk/MainFrameScrollbarGtk.cpp:
(MainFrameScrollbarGtk::attachAdjustment): If we are attaching the same adjustment
that we already have, bail out early. Apply the value changed signal handler
after configuring the adjustment. We don't want our reset of the adjustment to
stomp on WebCore values.
(MainFrameScrollbarGtk::gtkValueChanged): Do not adjust the value if the WebCore
state already matches ours. This prevents some unnecessary recursion
* platform/gtk/ScrollViewGtk.cpp:
(WebCore::ScrollView::removeChild): Added, special cases main frame scrollbars
which need their adjustments detached.
2011-01-13 Yuzo Fujishima <yuzo@google.com>
 
Reviewed by Antti Koivisto.
......
......@@ -75,6 +75,7 @@ void ScrollView::addChild(PassRefPtr<Widget> prpChild)
platformAddChild(child);
}
#if !PLATFORM(GTK)
void ScrollView::removeChild(Widget* child)
{
ASSERT(child->parent() == this);
......@@ -83,6 +84,7 @@ void ScrollView::removeChild(Widget* child)
if (child->platformWidget())
platformRemoveChild(child);
}
#endif
void ScrollView::setHasHorizontalScrollbar(bool hasBar)
{
......@@ -1066,19 +1068,19 @@ void ScrollView::setScrollOrigin(const IntPoint& origin, bool updatePosition)
updateScrollbars(scrollOffset());
}
#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(EFL)
void ScrollView::platformInit()
{
}
#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(EFL)
void ScrollView::platformDestroy()
{
}
#endif
#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(MAC)
#if !PLATFORM(WX) && !PLATFORM(QT) && !PLATFORM(MAC)
void ScrollView::platformAddChild(Widget*)
{
......
......@@ -59,6 +59,9 @@ MainFrameScrollbarGtk::~MainFrameScrollbarGtk()
void MainFrameScrollbarGtk::attachAdjustment(GtkAdjustment* adjustment)
{
if (m_adjustment.get() == adjustment)
return;
if (m_adjustment)
detachAdjustment();
......@@ -66,9 +69,10 @@ void MainFrameScrollbarGtk::attachAdjustment(GtkAdjustment* adjustment)
if (!m_adjustment)
return;
g_signal_connect(m_adjustment.get(), "value-changed", G_CALLBACK(MainFrameScrollbarGtk::gtkValueChanged), this);
updateThumbProportion();
updateThumbPosition();
g_signal_connect(m_adjustment.get(), "value-changed", G_CALLBACK(MainFrameScrollbarGtk::gtkValueChanged), this);
}
void MainFrameScrollbarGtk::detachAdjustment()
......@@ -108,7 +112,9 @@ void MainFrameScrollbarGtk::updateThumbProportion()
void MainFrameScrollbarGtk::gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk* that)
{
that->setValue(static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get())), NotFromScrollAnimator);
int newValue = static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get()));
if (newValue != that->value())
that->setValue(newValue, NotFromScrollAnimator);
}
void MainFrameScrollbarGtk::paint(GraphicsContext* context, const IntRect& rect)
......
......@@ -51,10 +51,6 @@ using namespace std;
namespace WebCore {
void ScrollView::platformInit()
{
}
void ScrollView::platformDestroy()
{
m_horizontalAdjustment = 0;
......@@ -78,6 +74,21 @@ PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientati
return MainFrameScrollbarGtk::create(this, orientation, m_verticalAdjustment.get());
}
void ScrollView::removeChild(Widget* child)
{
ASSERT(child->parent() == this);
child->setParent(0);
m_children.remove(child);
// We need to override the version of ScrollView::removeChild in ScrollView.cpp because
// we must inform main frame scrollbars that their adjustments no longer control the
// WebCore scrollbars. We cannot use platformRemoveChild for this task, because even
// main frame scrollbars do not have a platform widget (a GtkAdjustment is not a GtkWidget).
if (parent() || (child != horizontalScrollbar()) && (child != verticalScrollbar()))
return;
static_cast<MainFrameScrollbarGtk*>(child)->detachAdjustment();
}
void ScrollView::setHorizontalAdjustment(GtkAdjustment* hadj, bool resetValues)
{
ASSERT(!parent() || !hadj);
......@@ -162,14 +173,6 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
setVerticalAdjustment(vadj, resetValues);
}
void ScrollView::platformAddChild(Widget* child)
{
}
void ScrollView::platformRemoveChild(Widget* child)
{
}
IntRect ScrollView::visibleContentRect(bool includeScrollbars) const
{
// If we are an interior frame scrollbar or are in some sort of transition
......
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