Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: Source/core/accessibility/AXObject.cpp

Issue 70213002: Update the accessibility tree when a modal dialog is opened/closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sync and remove inert-node-is-hidden.html Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 return IgnoreObject; 282 return IgnoreObject;
283 283
284 if (isPresentationalChildOfAriaRole()) 284 if (isPresentationalChildOfAriaRole())
285 return IgnoreObject; 285 return IgnoreObject;
286 286
287 return accessibilityPlatformIncludesObject(); 287 return accessibilityPlatformIncludesObject();
288 } 288 }
289 289
290 bool AXObject::isInertOrAriaHidden() const 290 bool AXObject::isInertOrAriaHidden() const
291 { 291 {
292 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true")) 292 bool mightBeInInertSubtree = true;
293 return true; 293 for (const AXObject* object = this; object; object = object->parentObject()) {
294 if (node() && node()->isInert())
295 return true;
296
297 for (AXObject* object = parentObject(); object; object = object->parentObjec t()) {
298 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) 294 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
299 return true; 295 return true;
296 if (mightBeInInertSubtree && object->node()) {
297 if (object->node()->isInert())
298 return true;
299 mightBeInInertSubtree = false;
300 }
300 } 301 }
301 302
302 return false; 303 return false;
303 } 304 }
304 305
305 bool AXObject::lastKnownIsIgnoredValue() 306 bool AXObject::lastKnownIsIgnoredValue()
306 { 307 {
307 if (m_lastKnownIsIgnoredValue == DefaultBehavior) 308 if (m_lastKnownIsIgnoredValue == DefaultBehavior)
308 m_lastKnownIsIgnoredValue = accessibilityIsIgnored() ? IgnoreObject : In cludeObject; 309 m_lastKnownIsIgnoredValue = accessibilityIsIgnored() ? IgnoreObject : In cludeObject;
309 310
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 return ToggleButtonRole; 898 return ToggleButtonRole;
898 if (ariaHasPopup()) 899 if (ariaHasPopup())
899 return PopUpButtonRole; 900 return PopUpButtonRole;
900 // We don't contemplate RadioButtonRole, as it depends on the input 901 // We don't contemplate RadioButtonRole, as it depends on the input
901 // type. 902 // type.
902 903
903 return ButtonRole; 904 return ButtonRole;
904 } 905 }
905 906
906 } // namespace WebCore 907 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/inert-node-is-hidden-expected.txt ('k') | Source/core/html/HTMLDialogElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698