Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / web / WebAXObject.cpp
index 317a5b0..76cfc64 100644 (file)
  */
 
 #include "config.h"
-#include "WebAXObject.h"
+#include "public/web/WebAXObject.h"
 
 #include "HTMLNames.h"
-#include "WebDocument.h"
-#include "WebNode.h"
 #include "core/accessibility/AXObject.h"
 #include "core/accessibility/AXObjectCache.h"
 #include "core/accessibility/AXTable.h"
 #include "core/css/CSSPrimitiveValueMappings.h"
 #include "core/dom/Document.h"
 #include "core/dom/Node.h"
-#include "core/page/EventHandler.h"
 #include "core/frame/FrameView.h"
+#include "core/page/EventHandler.h"
+#include "core/rendering/RenderView.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "platform/PlatformKeyboardEvent.h"
 #include "public/platform/WebPoint.h"
 #include "public/platform/WebRect.h"
 #include "public/platform/WebString.h"
 #include "public/platform/WebURL.h"
+#include "public/web/WebDocument.h"
+#include "public/web/WebNode.h"
 #include "wtf/text/StringBuilder.h"
 
 using namespace WebCore;
@@ -90,16 +91,6 @@ void WebAXObject::enableInlineTextBoxAccessibility()
     AXObjectCache::setInlineTextBoxAccessibility(true);
 }
 
-void WebAXObject::startCachingComputedObjectAttributesUntilTreeMutates()
-{
-    m_private->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMutates();
-}
-
-void WebAXObject::stopCachingComputedObjectAttributes()
-{
-    m_private->axObjectCache()->stopCachingComputedObjectAttributes();
-}
-
 bool WebAXObject::isDetached() const
 {
     if (m_private.isNull())
@@ -547,6 +538,10 @@ WebRect WebAXObject::boundingBoxRect() const
     if (isDetached())
         return WebRect();
 
+    // It's not safe to call boundingBoxRect if a layout is pending.
+    // Clients should call updateBackingStoreAndCheckValidity first.
+    ASSERT(m_private->document() && m_private->document()->lifecycle().state() >= DocumentLifecycle::LayoutClean);
+
     return pixelSnappedIntRect(m_private->elementRect());
 }