Diff
Modified: trunk/Source/WebCore/ChangeLog (148822 => 148823)
--- trunk/Source/WebCore/ChangeLog 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/ChangeLog 2013-04-21 10:07:28 UTC (rev 148823)
@@ -1,3 +1,47 @@
+2013-04-21 Carlos Garcia Campos <[email protected]>
+
+ Widget should not depend on AXObjectCache
+ https://bugs.webkit.org/show_bug.cgi?id=114514
+
+ Reviewed by Chris Fleizach.
+
+ Move AXObjectCache usage from platform files to FrameView.
+
+ * WebCore.exp.in: Update symbols.
+ * page/FrameView.cpp:
+ (WebCore::FrameView::didAddScrollbar): Handle scrollbar updates in
+ AXObjectCache.
+ (WebCore::FrameView::willRemoveScrollbar): Handle scrollbar
+ updates in AXObjectCache and remove the scrollbar from the cache.
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::setHasHorizontalScrollbar): Use
+ didAddScrollbar/willRemoveScrollbar
+ (WebCore::ScrollView::setHasVerticalScrollbar): Ditto.
+ * platform/ScrollableArea.cpp:
+ (WebCore::ScrollableArea::didAddScrollbar): This is the old
+ didAddVerticalScrollbar and didAddHorizontalScrollbar joined in a
+ single method that receives a ScrollbarOrientation parameter.
+ (WebCore::ScrollableArea::willRemoveScrollbar): This is the old
+ willRemoveVerticalScrollbar and
+ willRemoveHorizontalScrollbarScrollbar joined in a single method
+ that receives a ScrollbarOrientation parameter.
+ * platform/ScrollableArea.h:
+ (ScrollableArea):
+ * platform/Scrollbar.cpp:
+ (WebCore::Scrollbar::~Scrollbar): Remove AXObjectCache usage.
+ * platform/Scrollbar.h:
+ * platform/Widget.h:
+ (Widget): Remove axObjectCache() method.
+ * platform/mac/ScrollAnimatorMac.h:
+ (ScrollAnimatorMac):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::createScrollbar): Use didAddScrollbar.
+ (WebCore::RenderLayer::destroyScrollbar): Use willRemoveScrollbar.
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::createScrollbar): Use didAddScrollbar.
+ (WebCore::RenderListBox::destroyScrollbar): Use willRemoveScrollbar.
+
2013-04-20 Dirk Schulze <[email protected]>
[Part 5] Parse color value for custom() function parameters
Modified: trunk/Source/WebCore/WebCore.exp.in (148822 => 148823)
--- trunk/Source/WebCore/WebCore.exp.in 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-04-21 10:07:28 UTC (rev 148823)
@@ -365,19 +365,17 @@
__ZN7WebCore14SchemeRegistry58registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsingERKN3WTF6StringE
__ZN7WebCore14SchemeRegistry62registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsingERKN3WTF6StringE
__ZN7WebCore14ScrollableArea15contentsResizedEv
+__ZN7WebCore14ScrollableArea15didAddScrollbarEPNS_9ScrollbarENS_20ScrollbarOrientationE
__ZN7WebCore14ScrollableArea16handleWheelEventERKNS_18PlatformWheelEventE
__ZN7WebCore14ScrollableArea17willEndLiveResizeEv
+__ZN7WebCore14ScrollableArea19willRemoveScrollbarEPNS_9ScrollbarENS_20ScrollbarOrientationE
__ZN7WebCore14ScrollableArea19willStartLiveResizeEv
__ZN7WebCore14ScrollableArea19invalidateScrollbarEPNS_9ScrollbarERKNS_7IntRectE
__ZNK7WebCore14ScrollableArea21mouseEnteredScrollbarEPNS_9ScrollbarE
__ZN7WebCore14ScrollableArea22invalidateScrollCornerERKNS_7IntRectE
-__ZN7WebCore14ScrollableArea23didAddVerticalScrollbarEPNS_9ScrollbarE
__ZN7WebCore14ScrollableArea24setScrollbarOverlayStyleENS_21ScrollbarOverlayStyleE
-__ZN7WebCore14ScrollableArea25didAddHorizontalScrollbarEPNS_9ScrollbarE
-__ZN7WebCore14ScrollableArea27willRemoveVerticalScrollbarEPNS_9ScrollbarE
__ZN7WebCore14ScrollableArea27notifyScrollPositionChangedERKNS_8IntPointE
__ZN7WebCore14ScrollableArea28setScrollOffsetFromInternalsERKNS_8IntPointE
-__ZN7WebCore14ScrollableArea29willRemoveHorizontalScrollbarEPNS_9ScrollbarE
__ZN7WebCore14ScrollableArea30scrollToOffsetWithoutAnimationERKNS_10FloatPointE
__ZN7WebCore14ScrollableArea6scrollENS_15ScrollDirectionENS_17ScrollGranularityEf
__ZN7WebCore14ScrollableAreaC2Ev
Modified: trunk/Source/WebCore/page/FrameView.cpp (148822 => 148823)
--- trunk/Source/WebCore/page/FrameView.cpp 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/page/FrameView.cpp 2013-04-21 10:07:28 UTC (rev 148823)
@@ -4129,4 +4129,20 @@
#endif
}
+void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
+{
+ ScrollableArea::didAddScrollbar(scrollbar, orientation);
+ if (AXObjectCache* cache = axObjectCache())
+ cache->handleScrollbarUpdate(this);
+}
+
+void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
+{
+ ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
+ if (AXObjectCache* cache = axObjectCache()) {
+ cache->remove(scrollbar);
+ cache->handleScrollbarUpdate(this);
+ }
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/page/FrameView.h (148822 => 148823)
--- trunk/Source/WebCore/page/FrameView.h 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/page/FrameView.h 2013-04-21 10:07:28 UTC (rev 148823)
@@ -38,6 +38,7 @@
namespace WebCore {
+class AXObjectCache;
class Element;
class Event;
class FloatSize;
@@ -485,6 +486,10 @@
#endif
#endif
+ // Override scrollbar notifications to update the AXObject cache.
+ virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE;
+ virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE;
+
void scheduleResizeEvent();
void sendResizeEvent();
void delayedResizeEventTimerFired(Timer<FrameView>*);
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (148822 => 148823)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2013-04-21 10:07:28 UTC (rev 148823)
@@ -26,7 +26,6 @@
#include "config.h"
#include "ScrollView.h"
-#include "AXObjectCache.h"
#include "GraphicsContext.h"
#include "GraphicsLayer.h"
#include "HostWindow.h"
@@ -91,16 +90,13 @@
if (hasBar && !m_horizontalScrollbar) {
m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
addChild(m_horizontalScrollbar.get());
- didAddHorizontalScrollbar(m_horizontalScrollbar.get());
+ didAddScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar);
m_horizontalScrollbar->styleChanged();
} else if (!hasBar && m_horizontalScrollbar) {
- willRemoveHorizontalScrollbar(m_horizontalScrollbar.get());
+ willRemoveScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar);
removeChild(m_horizontalScrollbar.get());
m_horizontalScrollbar = 0;
}
-
- if (AXObjectCache* cache = axObjectCache())
- cache->handleScrollbarUpdate(this);
}
void ScrollView::setHasVerticalScrollbar(bool hasBar)
@@ -109,16 +105,13 @@
if (hasBar && !m_verticalScrollbar) {
m_verticalScrollbar = createScrollbar(VerticalScrollbar);
addChild(m_verticalScrollbar.get());
- didAddVerticalScrollbar(m_verticalScrollbar.get());
+ didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar);
m_verticalScrollbar->styleChanged();
} else if (!hasBar && m_verticalScrollbar) {
- willRemoveVerticalScrollbar(m_verticalScrollbar.get());
+ willRemoveScrollbar(m_verticalScrollbar.get(), VerticalScrollbar);
removeChild(m_verticalScrollbar.get());
m_verticalScrollbar = 0;
}
-
- if (AXObjectCache* cache = axObjectCache())
- cache->handleScrollbarUpdate(this);
}
#if !PLATFORM(GTK)
Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (148822 => 148823)
--- trunk/Source/WebCore/platform/ScrollableArea.cpp 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp 2013-04-21 10:07:28 UTC (rev 148823)
@@ -261,32 +261,25 @@
scrollAnimator->finishCurrentScrollAnimations();
}
-void ScrollableArea::didAddVerticalScrollbar(Scrollbar* scrollbar)
+void ScrollableArea::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
{
- scrollAnimator()->didAddVerticalScrollbar(scrollbar);
+ if (orientation == VerticalScrollbar)
+ scrollAnimator()->didAddVerticalScrollbar(scrollbar);
+ else
+ scrollAnimator()->didAddHorizontalScrollbar(scrollbar);
// <rdar://problem/9797253> AppKit resets the scrollbar's style when you attach a scrollbar
setScrollbarOverlayStyle(scrollbarOverlayStyle());
}
-void ScrollableArea::willRemoveVerticalScrollbar(Scrollbar* scrollbar)
+void ScrollableArea::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
{
- scrollAnimator()->willRemoveVerticalScrollbar(scrollbar);
+ if (orientation == VerticalScrollbar)
+ scrollAnimator()->willRemoveVerticalScrollbar(scrollbar);
+ else
+ scrollAnimator()->willRemoveHorizontalScrollbar(scrollbar);
}
-void ScrollableArea::didAddHorizontalScrollbar(Scrollbar* scrollbar)
-{
- scrollAnimator()->didAddHorizontalScrollbar(scrollbar);
-
- // <rdar://problem/9797253> AppKit resets the scrollbar's style when you attach a scrollbar
- setScrollbarOverlayStyle(scrollbarOverlayStyle());
-}
-
-void ScrollableArea::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)
-{
- scrollAnimator()->willRemoveHorizontalScrollbar(scrollbar);
-}
-
void ScrollableArea::contentsResized()
{
if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
Modified: trunk/Source/WebCore/platform/ScrollableArea.h (148822 => 148823)
--- trunk/Source/WebCore/platform/ScrollableArea.h 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/platform/ScrollableArea.h 2013-04-21 10:07:28 UTC (rev 148823)
@@ -83,10 +83,8 @@
void finishCurrentScrollAnimations() const;
- void didAddVerticalScrollbar(Scrollbar*);
- void willRemoveVerticalScrollbar(Scrollbar*);
- virtual void didAddHorizontalScrollbar(Scrollbar*);
- virtual void willRemoveHorizontalScrollbar(Scrollbar*);
+ virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation);
+ virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation);
virtual void contentsResized();
Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (148822 => 148823)
--- trunk/Source/WebCore/platform/Scrollbar.cpp 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp 2013-04-21 10:07:28 UTC (rev 148823)
@@ -38,9 +38,6 @@
#endif
// FIXME: The following #includes are a layering violation and should be removed.
-#include "AXObjectCache.h"
-#include "AccessibilityScrollbar.h"
-#include "Document.h"
#include "EventHandler.h"
#include "Frame.h"
#include "FrameView.h"
@@ -110,9 +107,6 @@
Scrollbar::~Scrollbar()
{
- if (AXObjectCache* cache = existingAXObjectCache())
- cache->remove(this);
-
stopTimerIfNeeded();
m_theme->unregisterScrollbar(this);
@@ -567,14 +561,6 @@
return m_scrollableArea && m_scrollableArea->isActive();
}
-AXObjectCache* Scrollbar::existingAXObjectCache() const
-{
- if (!parent())
- return 0;
-
- return parent()->axObjectCache();
-}
-
void Scrollbar::invalidateRect(const IntRect& rect)
{
if (suppressInvalidation())
Modified: trunk/Source/WebCore/platform/Scrollbar.h (148822 => 148823)
--- trunk/Source/WebCore/platform/Scrollbar.h 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/platform/Scrollbar.h 2013-04-21 10:07:28 UTC (rev 148823)
@@ -206,7 +206,6 @@
private:
virtual bool isScrollbar() const { return true; }
- virtual AXObjectCache* existingAXObjectCache() const;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/Widget.h (148822 => 148823)
--- trunk/Source/WebCore/platform/Widget.h 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/platform/Widget.h 2013-04-21 10:07:28 UTC (rev 148823)
@@ -97,7 +97,6 @@
namespace WebCore {
-class AXObjectCache;
class Cursor;
class Event;
class Font;
@@ -231,9 +230,6 @@
virtual IntPoint convertToContainingView(const IntPoint&) const;
virtual IntPoint convertFromContainingView(const IntPoint&) const;
- // A means to access the AX cache when this object can get a pointer to it.
- virtual AXObjectCache* axObjectCache() const { return 0; }
-
private:
void init(PlatformWidget); // Must be called by all Widget constructors to initialize cross-platform data.
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (148822 => 148823)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2013-04-21 10:07:28 UTC (rev 148823)
@@ -2876,10 +2876,7 @@
widget = RenderScrollbar::createCustomScrollbar(this, orientation, actualRenderer->node());
else {
widget = Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
- if (orientation == HorizontalScrollbar)
- didAddHorizontalScrollbar(widget.get());
- else
- didAddVerticalScrollbar(widget.get());
+ didAddScrollbar(widget.get(), orientation);
}
renderer()->document()->view()->addChild(widget.get());
return widget.release();
@@ -2891,12 +2888,8 @@
if (!scrollbar)
return;
- if (!scrollbar->isCustomScrollbar()) {
- if (orientation == HorizontalScrollbar)
- willRemoveHorizontalScrollbar(scrollbar.get());
- else
- willRemoveVerticalScrollbar(scrollbar.get());
- }
+ if (!scrollbar->isCustomScrollbar())
+ willRemoveScrollbar(scrollbar.get(), orientation);
scrollbar->removeFromParent();
scrollbar->disconnectFromScrollableArea();
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (148822 => 148823)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2013-04-21 10:07:28 UTC (rev 148823)
@@ -850,7 +850,7 @@
widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar, this->node());
else {
widget = Scrollbar::createNativeScrollbar(this, VerticalScrollbar, theme()->scrollbarControlSizeForPart(ListboxPart));
- didAddVerticalScrollbar(widget.get());
+ didAddScrollbar(widget.get(), VerticalScrollbar);
}
document()->view()->addChild(widget.get());
return widget.release();
@@ -862,7 +862,7 @@
return;
if (!m_vBar->isCustomScrollbar())
- ScrollableArea::willRemoveVerticalScrollbar(m_vBar.get());
+ ScrollableArea::willRemoveScrollbar(m_vBar.get(), VerticalScrollbar);
m_vBar->removeFromParent();
m_vBar->disconnectFromScrollableArea();
m_vBar = 0;
Modified: trunk/Source/WebKit2/ChangeLog (148822 => 148823)
--- trunk/Source/WebKit2/ChangeLog 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebKit2/ChangeLog 2013-04-21 10:07:28 UTC (rev 148823)
@@ -1,3 +1,18 @@
+2013-04-21 Carlos Garcia Campos <[email protected]>
+
+ Widget should not depend on AXObjectCache
+ https://bugs.webkit.org/show_bug.cgi?id=114514
+
+ Reviewed by Chris Fleizach.
+
+ Update to API changes.
+
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit::PDFPlugin::createScrollbar):
+ * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
+ (WebKit::SimplePDFPlugin::createScrollbar):
+ (WebKit::SimplePDFPlugin::destroyScrollbar):
+
2013-04-20 Manuel Rego Casasnovas <[email protected]>
[GTK] Fix unit test webkit2/WebKitFindController/hide
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm (148822 => 148823)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm 2013-04-21 10:07:28 UTC (rev 148823)
@@ -275,14 +275,11 @@
if (orientation == HorizontalScrollbar) {
m_horizontalScrollbarLayer.adoptNS([[WKPDFPluginScrollbarLayer alloc] initWithPDFPlugin:this]);
[m_containerLayer.get() addSublayer:m_horizontalScrollbarLayer.get()];
-
- didAddHorizontalScrollbar(widget.get());
} else {
m_verticalScrollbarLayer.adoptNS([[WKPDFPluginScrollbarLayer alloc] initWithPDFPlugin:this]);
[m_containerLayer.get() addSublayer:m_verticalScrollbarLayer.get()];
-
- didAddVerticalScrollbar(widget.get());
}
+ didAddScrollbar(widget.get(), orientation);
pluginView()->frame()->view()->addChild(widget.get());
return widget.release();
}
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm (148822 => 148823)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm 2013-04-21 09:26:25 UTC (rev 148822)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm 2013-04-21 10:07:28 UTC (rev 148823)
@@ -260,10 +260,7 @@
PassRefPtr<Scrollbar> SimplePDFPlugin::createScrollbar(ScrollbarOrientation orientation)
{
RefPtr<Scrollbar> widget = Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
- if (orientation == HorizontalScrollbar)
- didAddHorizontalScrollbar(widget.get());
- else
- didAddVerticalScrollbar(widget.get());
+ didAddScrollbar(widget.get(), orientation);
pluginView()->frame()->view()->addChild(widget.get());
return widget.release();
}
@@ -274,11 +271,7 @@
if (!scrollbar)
return;
- if (orientation == HorizontalScrollbar)
- willRemoveHorizontalScrollbar(scrollbar.get());
- else
- willRemoveVerticalScrollbar(scrollbar.get());
-
+ willRemoveScrollbar(scrollbar.get(), orientation);
scrollbar->removeFromParent();
scrollbar->disconnectFromScrollableArea();
scrollbar = 0;