- Revision
- 117907
- Author
- [email protected]
- Date
- 2012-05-21 22:46:40 -0700 (Mon, 21 May 2012)
Log Message
!HAVE(ACCESSIBILITY) should be able to build without linking in any code from WebCore/accessibility
https://bugs.webkit.org/show_bug.cgi?id=87035
Reviewed by Chris Fleizach.
The OS(ANDROID) already builds with !HAVE(ACCESSIBILITY), but because
there are a few straggling references to objects in the
WebCore/accessibility directory, we end up pulling in a bunch of code
into the binary that we don't need.
This patch stubs out a few more functions for !HAVE(ACCESSIBILITY) so
we can link without any objects from WebCore/accessibility. This patch
also locks in that property by actually excluding the
WebCore/accessibility directory from the build on OS(ANDROID).
* WebCore.gyp/WebCore.gyp:
* accessibility/AXObjectCache.h:
(AXObjectCache):
(WebCore::AXObjectCache::enableAccessibility):
(WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
(WebCore::AXObjectCache::accessibilityEnabled):
(WebCore::AXObjectCache::accessibilityEnhancedUserInterfaceEnabled):
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::AXObjectCache::get):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::rootObject):
(WebCore::AXObjectCache::rootObjectForFrame):
(WebCore::AXObjectCache::rootAXEditableElement):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::contentChanged):
(WebCore::AXObjectCache::detachWrapper):
(WebCore::AXObjectCache::handleActiveDescendantChanged):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
(WebCore::AXObjectCache::handleScrolledToAnchor):
(WebCore::AXObjectCache::nodeTextChangeNotification):
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
(WebCore::AXObjectCache::postNotification):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::selectedChildrenChanged):
* accessibility/AccessibilityObject.h:
(WebCore):
(WebCore::AccessibilityObject::updateBackingStore):
(WebCore::AccessibilityObject::lineForPosition):
(WebCore::AccessibilityObject::children):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (117906 => 117907)
--- trunk/Source/WebCore/ChangeLog 2012-05-22 05:46:31 UTC (rev 117906)
+++ trunk/Source/WebCore/ChangeLog 2012-05-22 05:46:40 UTC (rev 117907)
@@ -1,3 +1,53 @@
+2012-05-21 Adam Barth <[email protected]>
+
+ !HAVE(ACCESSIBILITY) should be able to build without linking in any code from WebCore/accessibility
+ https://bugs.webkit.org/show_bug.cgi?id=87035
+
+ Reviewed by Chris Fleizach.
+
+ The OS(ANDROID) already builds with !HAVE(ACCESSIBILITY), but because
+ there are a few straggling references to objects in the
+ WebCore/accessibility directory, we end up pulling in a bunch of code
+ into the binary that we don't need.
+
+ This patch stubs out a few more functions for !HAVE(ACCESSIBILITY) so
+ we can link without any objects from WebCore/accessibility. This patch
+ also locks in that property by actually excluding the
+ WebCore/accessibility directory from the build on OS(ANDROID).
+
+ * WebCore.gyp/WebCore.gyp:
+ * accessibility/AXObjectCache.h:
+ (AXObjectCache):
+ (WebCore::AXObjectCache::enableAccessibility):
+ (WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
+ (WebCore::AXObjectCache::accessibilityEnabled):
+ (WebCore::AXObjectCache::accessibilityEnhancedUserInterfaceEnabled):
+ (WebCore::AXObjectCache::AXObjectCache):
+ (WebCore::AXObjectCache::~AXObjectCache):
+ (WebCore::AXObjectCache::get):
+ (WebCore::AXObjectCache::getOrCreate):
+ (WebCore::AXObjectCache::rootObject):
+ (WebCore::AXObjectCache::rootObjectForFrame):
+ (WebCore::AXObjectCache::rootAXEditableElement):
+ (WebCore::AXObjectCache::childrenChanged):
+ (WebCore::AXObjectCache::contentChanged):
+ (WebCore::AXObjectCache::detachWrapper):
+ (WebCore::AXObjectCache::handleActiveDescendantChanged):
+ (WebCore::AXObjectCache::handleAriaRoleChanged):
+ (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+ (WebCore::AXObjectCache::handleScrolledToAnchor):
+ (WebCore::AXObjectCache::nodeTextChangeNotification):
+ (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
+ (WebCore::AXObjectCache::postNotification):
+ (WebCore::AXObjectCache::postPlatformNotification):
+ (WebCore::AXObjectCache::remove):
+ (WebCore::AXObjectCache::selectedChildrenChanged):
+ * accessibility/AccessibilityObject.h:
+ (WebCore):
+ (WebCore::AccessibilityObject::updateBackingStore):
+ (WebCore::AccessibilityObject::lineForPosition):
+ (WebCore::AccessibilityObject::children):
+
2012-05-21 Andreas Kling <[email protected]>
Use stack-allocated BitArray in StylePropertySet serialization.
Modified: trunk/Source/WebCore/WebCore.gyp/WebCore.gyp (117906 => 117907)
--- trunk/Source/WebCore/WebCore.gyp/WebCore.gyp 2012-05-22 05:46:31 UTC (rev 117906)
+++ trunk/Source/WebCore/WebCore.gyp/WebCore.gyp 2012-05-22 05:46:40 UTC (rev 117907)
@@ -1304,6 +1304,11 @@
'<(chromium_src_dir)/build/linux/system.gyp:gtk',
],
}],
+ ['OS=="android"', {
+ 'sources/': [
+ ['exclude', 'accessibility/'],
+ ],
+ }],
['OS=="mac"', {
'dependencies': [
'webkit_system_interface',
Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (117906 => 117907)
--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2012-05-22 05:46:31 UTC (rev 117906)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2012-05-22 05:46:40 UTC (rev 117907)
@@ -27,6 +27,9 @@
*/
#include "config.h"
+
+#if HAVE(ACCESSIBILITY)
+
#include "AXObjectCache.h"
#include "AccessibilityARIAGrid.h"
@@ -444,14 +447,12 @@
m_idsInUse.remove(objID);
}
-#if HAVE(ACCESSIBILITY)
void AXObjectCache::contentChanged(RenderObject* renderer)
{
AccessibilityObject* object = getOrCreate(renderer);
if (object)
object->contentChanged();
}
-#endif
void AXObjectCache::childrenChanged(RenderObject* renderer)
{
@@ -491,7 +492,6 @@
m_notificationsToPost.clear();
}
-#if HAVE(ACCESSIBILITY)
void AXObjectCache::postNotification(RenderObject* renderer, AXNotification notification, bool postToElement, PostType postType)
{
// Notifications for text input objects are sent to that object.
@@ -567,10 +567,7 @@
AccessibilityObject* obj = getOrCreate(contentRenderer);
frameLoadingEventPlatformNotification(obj, loadingEvent);
}
-#endif
-#if HAVE(ACCESSIBILITY)
-
void AXObjectCache::handleScrollbarUpdate(ScrollView* view)
{
if (!view)
@@ -608,7 +605,6 @@
if (obj && obj->isAccessibilityRenderObject())
static_cast<AccessibilityRenderObject*>(obj)->updateAccessibilityRole();
}
-#endif
VisiblePosition AXObjectCache::visiblePositionForTextMarkerData(TextMarkerData& textMarkerData)
{
@@ -695,3 +691,5 @@
}
} // namespace WebCore
+
+#endif // HAVE(ACCESSIBILITY)
Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (117906 => 117907)
--- trunk/Source/WebCore/accessibility/AXObjectCache.h 2012-05-22 05:46:31 UTC (rev 117906)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h 2012-05-22 05:46:40 UTC (rev 117907)
@@ -96,13 +96,20 @@
void handleScrolledToAnchor(const Node* anchorNode);
void handleAriaExpandedChange(RenderObject*);
void handleScrollbarUpdate(ScrollView*);
-
+
+#if HAVE(ACCESSIBILITY)
static void enableAccessibility() { gAccessibilityEnabled = true; }
// Enhanced user interface accessibility can be toggled by the assistive technology.
static void setEnhancedUserInterfaceAccessibility(bool flag) { gAccessibilityEnhancedUserInterfaceEnabled = flag; }
static bool accessibilityEnabled() { return gAccessibilityEnabled; }
static bool accessibilityEnhancedUserInterfaceEnabled() { return gAccessibilityEnhancedUserInterfaceEnabled; }
+#else
+ static void enableAccessibility() { }
+ static void setEnhancedUserInterfaceAccessibility(bool flag) { }
+ static bool accessibilityEnabled() { return false; }
+ static bool accessibilityEnhancedUserInterfaceEnabled() { return false; }
+#endif
void removeAXID(AccessibilityObject*);
bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); }
@@ -193,24 +200,41 @@
bool nodeHasRole(Node*, const String& role);
#if !HAVE(ACCESSIBILITY)
-inline void AXObjectCache::handleActiveDescendantChanged(RenderObject*) { }
-inline void AXObjectCache::handleAriaRoleChanged(RenderObject*) { }
-inline void AXObjectCache::detachWrapper(AccessibilityObject*) { }
+inline AXObjectCache::AXObjectCache(const Document*) : m_document(0), m_notificationPostTimer(this, 0) { }
+inline AXObjectCache::~AXObjectCache() { }
+inline AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page*) { return 0; }
+inline AccessibilityObject* AXObjectCache::get(RenderObject*) { return 0; }
+inline AccessibilityObject* AXObjectCache::get(Widget*) { return 0; }
+inline AccessibilityObject* AXObjectCache::getOrCreate(AccessibilityRole) { return 0; }
+inline AccessibilityObject* AXObjectCache::getOrCreate(RenderObject*) { return 0; }
+inline AccessibilityObject* AXObjectCache::getOrCreate(Widget*) { return 0; }
+inline AccessibilityObject* AXObjectCache::rootObject() { return 0; }
+inline AccessibilityObject* AXObjectCache::rootObjectForFrame(Frame*) { return 0; }
+inline Element* AXObjectCache::rootAXEditableElement(Node*) { return 0; }
+inline bool nodeHasRole(Node*, const String&) { return false; }
+inline const Element* AXObjectCache::rootAXEditableElement(const Node*) { return 0; }
inline void AXObjectCache::attachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::checkedStateChanged(RenderObject*) { }
-inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
-inline void AXObjectCache::postNotification(RenderObject*, AXNotification, bool postToElement, PostType) { }
-inline void AXObjectCache::postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType) { }
-inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, AXNotification) { }
-inline void AXObjectCache::nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned, const String&) { }
-inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&) { }
+inline void AXObjectCache::childrenChanged(RenderObject*) { }
+inline void AXObjectCache::contentChanged(RenderObject*) { }
+inline void AXObjectCache::detachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::frameLoadingEventNotification(Frame*, AXLoadingEvent) { }
inline void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent) { }
+inline void AXObjectCache::handleActiveDescendantChanged(RenderObject*) { }
+inline void AXObjectCache::handleAriaExpandedChange(RenderObject*) { }
+inline void AXObjectCache::handleAriaRoleChanged(RenderObject*) { }
inline void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) { }
+inline void AXObjectCache::handleScrollbarUpdate(ScrollView*) { }
inline void AXObjectCache::handleScrolledToAnchor(const Node*) { }
-inline void AXObjectCache::contentChanged(RenderObject*) { }
-inline void AXObjectCache::handleAriaExpandedChange(RenderObject*) { }
-inline void AXObjectCache::handleScrollbarUpdate(ScrollView*) { }
+inline void AXObjectCache::nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned, const String&) { }
+inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&) { }
+inline void AXObjectCache::postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType) { }
+inline void AXObjectCache::postNotification(RenderObject*, AXNotification, bool postToElement, PostType) { }
+inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, AXNotification) { }
+inline void AXObjectCache::remove(AXID) { }
+inline void AXObjectCache::remove(RenderObject*) { }
+inline void AXObjectCache::remove(Widget*) { }
+inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
#endif
}
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (117906 => 117907)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2012-05-22 05:46:31 UTC (rev 117906)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2012-05-22 05:46:40 UTC (rev 117907)
@@ -87,7 +87,7 @@
{
#if HAVE(ACCESSIBILITY)
setWrapper(0);
-#endif
+#endif
}
bool AccessibilityObject::isAccessibilityObjectSearchMatch(AccessibilityObject* axObject, AccessibilitySearchCriteria* criteria)
@@ -1024,6 +1024,7 @@
return obj->document()->axObjectCache()->getOrCreate(obj);
}
+#if HAVE(ACCESSIBILITY)
int AccessibilityObject::lineForPosition(const VisiblePosition& visiblePos) const
{
if (visiblePos.isNull() || !node())
@@ -1050,6 +1051,7 @@
return lineCount;
}
+#endif
// NOTE: Consider providing this utility method as AX API
PlainTextRange AccessibilityObject::plainTextRangeForVisiblePositionRange(const VisiblePositionRange& positionRange) const
@@ -1091,13 +1093,15 @@
{
return lineForPosition(visiblePositionForIndex(index, false));
}
-
+
+#if HAVE(ACCESSIBILITY)
void AccessibilityObject::updateBackingStore()
{
// Updating the layout may delete this object.
if (Document* document = this->document())
document->updateLayoutIgnorePendingStylesheets();
}
+#endif
Document* AccessibilityObject::document() const
{
@@ -1128,13 +1132,15 @@
return object->documentFrameView();
}
+#if HAVE(ACCESSIBILITY)
const AccessibilityObject::AccessibilityChildrenVector& AccessibilityObject::children()
{
updateChildrenIfNecessary();
-
+
return m_children;
}
-
+#endif
+
void AccessibilityObject::updateChildrenIfNecessary()
{
if (!hasChildren())
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (117906 => 117907)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2012-05-22 05:46:31 UTC (rev 117906)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2012-05-22 05:46:40 UTC (rev 117907)
@@ -731,6 +731,12 @@
#endif
};
+#if !HAVE(ACCESSIBILITY)
+inline void AccessibilityObject::updateBackingStore() { }
+inline int AccessibilityObject::lineForPosition(const VisiblePosition&) const { return -1; }
+inline const AccessibilityObject::AccessibilityChildrenVector& AccessibilityObject::children() { return m_children; }
+#endif
+
} // namespace WebCore
#endif // AccessibilityObject_h