Commit af5528c8 authored by alice.liu@apple.com's avatar alice.liu@apple.com
Browse files

2008-04-17 Alice Liu <alice.liu@apple.com>

        Reviewed by Jon Honeycutt.

        Added some asserts to catch undesirable usage of setWrapper and addChildren.

        * page/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::addChildren):
        * page/AccessibilityObject.h:
        (WebCore::AccessibilityObject::setWrapper):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cc3a0bc3
2008-04-17 Alice Liu <alice.liu@apple.com>
Reviewed by Jon Honeycutt.
Added some asserts to catch undesirable usage of setWrapper and addChildren.
* page/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::addChildren):
* page/AccessibilityObject.h:
(WebCore::AccessibilityObject::setWrapper):
2008-04-17 Brady Eidson <beidson@apple.com> 2008-04-17 Brady Eidson <beidson@apple.com>
   
Reviewed by the Mitzpettel Reviewed by the Mitzpettel
...@@ -1843,6 +1843,10 @@ bool AccessibilityObject::hasChildren() const ...@@ -1843,6 +1843,10 @@ bool AccessibilityObject::hasChildren() const
void AccessibilityObject::addChildren() void AccessibilityObject::addChildren()
{ {
// If the need to add more children in addition to existing children arises,
// childrenChanged should have been called, leaving the object with no children.
ASSERT(!hasChildren());
// nothing to add if there is no RenderObject // nothing to add if there is no RenderObject
if (!m_renderer) if (!m_renderer)
return; return;
......
...@@ -315,7 +315,11 @@ public: ...@@ -315,7 +315,11 @@ public:
#if HAVE(ACCESSIBILITY) #if HAVE(ACCESSIBILITY)
AccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); } AccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); }
void setWrapper(AccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; } void setWrapper(AccessibilityObjectWrapper* wrapper)
{
ASSERT(!m_wrapper);
m_wrapper = wrapper;
}
#endif #endif
private: private:
......
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