Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / browser / accessibility / browser_accessibility_win.cc
index 451043b..053ded2 100644 (file)
@@ -499,13 +499,18 @@ STDMETHODIMP BrowserAccessibilityWin::get_accParent(IDispatch** disp_parent) {
     // return the IAccessible for the window.
     parent_obj =
          manager()->ToBrowserAccessibilityManagerWin()->parent_iaccessible();
-
     // |parent| can only be NULL if the manager was created before the parent
     // IAccessible was known and it wasn't subsequently set before a client
-    // requested it. Crash hard if this happens so that we get crash reports.
-    CHECK(parent_obj);
+    // requested it. This has been fixed. |parent| may also be NULL during
+    // destruction. Possible cases where this could occur include tabs being
+    // dragged to a new window, etc.
+    if (!parent_obj) {
+      DVLOG(1) <<  "In Function: "
+               << __FUNCTION__
+               << ". Parent IAccessible interface is NULL. Returning failure";
+      return E_FAIL;
+    }
   }
-
   parent_obj->AddRef();
   *disp_parent = parent_obj;
   return S_OK;
@@ -3357,7 +3362,7 @@ void BrowserAccessibilityWin::InitRoleAndState() {
   // WebKit marks everything as readonly unless it's editable text, so if it's
   // not readonly, mark it as editable now. The final computation of the
   // READONLY state for MSAA is below, after the switch.
-  if (!HasState(ui::AX_STATE_READONLY))
+  if (!HasState(ui::AX_STATE_READ_ONLY))
     ia2_state_ |= IA2_STATE_EDITABLE;
 
   base::string16 invalid;
@@ -3526,7 +3531,7 @@ void BrowserAccessibilityWin::InitRoleAndState() {
       ia_state_ |= STATE_SYSTEM_LINKED;
       ia_state_ |= STATE_SYSTEM_READONLY;
       break;
-    case ui::AX_ROLE_LABEL:
+    case ui::AX_ROLE_LABEL_TEXT:
       ia_role_ = ROLE_SYSTEM_TEXT;
       ia2_role_ = IA2_ROLE_LABEL;
       break;
@@ -3778,7 +3783,7 @@ void BrowserAccessibilityWin::InitRoleAndState() {
       ia_role_ != ROLE_SYSTEM_DOCUMENT) {
     ia_state_ &= ~(STATE_SYSTEM_READONLY);
   }
-  if (!HasState(ui::AX_STATE_READONLY))
+  if (!HasState(ui::AX_STATE_READ_ONLY))
     ia_state_ &= ~(STATE_SYSTEM_READONLY);
   if (GetBoolAttribute(ui::AX_ATTR_ARIA_READONLY))
     ia_state_ |= STATE_SYSTEM_READONLY;