OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google 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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 1841 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
1842 alterSliderValue(false); | 1842 alterSliderValue(false); |
1843 } | 1843 } |
1844 | 1844 |
1845 void AXNodeObject::childrenChanged() | 1845 void AXNodeObject::childrenChanged() |
1846 { | 1846 { |
1847 // This method is meant as a quick way of marking a portion of the accessibi
lity tree dirty. | 1847 // This method is meant as a quick way of marking a portion of the accessibi
lity tree dirty. |
1848 if (!node() && !layoutObject()) | 1848 if (!node() && !layoutObject()) |
1849 return; | 1849 return; |
1850 | 1850 |
1851 axObjectCache()->postNotification(this, document(), AXObjectCacheImpl::AXChi
ldrenChanged, true); | 1851 axObjectCache()->postNotification(this, AXObjectCacheImpl::AXChildrenChanged
, true); |
1852 | 1852 |
1853 // Go up the accessibility parent chain, but only if the element already exi
sts. This method is | 1853 // Go up the accessibility parent chain, but only if the element already exi
sts. This method is |
1854 // called during layout, minimal work should be done. | 1854 // called during layout, minimal work should be done. |
1855 // If AX elements are created now, they could interrogate the layout tree wh
ile it's in a funky state. | 1855 // If AX elements are created now, they could interrogate the layout tree wh
ile it's in a funky state. |
1856 // At the same time, process ARIA live region changes. | 1856 // At the same time, process ARIA live region changes. |
1857 for (AXObject* parent = this; parent; parent = parent->parentObjectIfExists(
)) { | 1857 for (AXObject* parent = this; parent; parent = parent->parentObjectIfExists(
)) { |
1858 parent->setNeedsToUpdateChildren(); | 1858 parent->setNeedsToUpdateChildren(); |
1859 | 1859 |
1860 // These notifications always need to be sent because screenreaders are
reliant on them to perform. | 1860 // These notifications always need to be sent because screenreaders are
reliant on them to perform. |
1861 // In other words, they need to be sent even when the screen reader has
not accessed this live region since the last update. | 1861 // In other words, they need to be sent even when the screen reader has
not accessed this live region since the last update. |
1862 | 1862 |
1863 // If this element supports ARIA live regions, then notify the AT of cha
nges. | 1863 // If this element supports ARIA live regions, then notify the AT of cha
nges. |
1864 if (parent->isLiveRegion()) | 1864 if (parent->isLiveRegion()) |
1865 axObjectCache()->postNotification(parent, parent->document(), AXObje
ctCacheImpl::AXLiveRegionChanged, true); | 1865 axObjectCache()->postNotification(parent, AXObjectCacheImpl::AXLiveR
egionChanged, true); |
1866 | 1866 |
1867 // If this element is an ARIA text box or content editable, post a "valu
e changed" notification on it | 1867 // If this element is an ARIA text box or content editable, post a "valu
e changed" notification on it |
1868 // so that it behaves just like a native input element or textarea. | 1868 // so that it behaves just like a native input element or textarea. |
1869 if (isNonNativeTextControl()) | 1869 if (isNonNativeTextControl()) |
1870 axObjectCache()->postNotification(parent, parent->document(), AXObje
ctCacheImpl::AXValueChanged, true); | 1870 axObjectCache()->postNotification(parent, AXObjectCacheImpl::AXValue
Changed, true); |
1871 } | 1871 } |
1872 } | 1872 } |
1873 | 1873 |
1874 void AXNodeObject::selectionChanged() | 1874 void AXNodeObject::selectionChanged() |
1875 { | 1875 { |
1876 // Post the selected text changed event on the first ancestor that's | 1876 // Post the selected text changed event on the first ancestor that's |
1877 // focused (to handle form controls, ARIA text boxes and contentEditable), | 1877 // focused (to handle form controls, ARIA text boxes and contentEditable), |
1878 // or the web area if the selection is just in the document somewhere. | 1878 // or the web area if the selection is just in the document somewhere. |
1879 if (isFocused() || isWebArea()) | 1879 if (isFocused() || isWebArea()) |
1880 axObjectCache()->postNotification(this, document(), AXObjectCacheImpl::A
XSelectedTextChanged, true); | 1880 axObjectCache()->postNotification(this, AXObjectCacheImpl::AXSelectedTex
tChanged, true); |
1881 else | 1881 else |
1882 AXObject::selectionChanged(); // Calls selectionChanged on parent. | 1882 AXObject::selectionChanged(); // Calls selectionChanged on parent. |
1883 } | 1883 } |
1884 | 1884 |
1885 void AXNodeObject::textChanged() | 1885 void AXNodeObject::textChanged() |
1886 { | 1886 { |
1887 // If this element supports ARIA live regions, or is part of a region with a
n ARIA editable role, | 1887 // If this element supports ARIA live regions, or is part of a region with a
n ARIA editable role, |
1888 // then notify the AT of changes. | 1888 // then notify the AT of changes. |
1889 AXObjectCacheImpl* cache = axObjectCache(); | 1889 AXObjectCacheImpl* cache = axObjectCache(); |
1890 for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentN
ode()) { | 1890 for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentN
ode()) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 float range = maxValueForRange() - minValueForRange(); | 1997 float range = maxValueForRange() - minValueForRange(); |
1998 float value = valueForRange(); | 1998 float value = valueForRange(); |
1999 | 1999 |
2000 value += range * (percentChange / 100); | 2000 value += range * (percentChange / 100); |
2001 setValue(String::number(value)); | 2001 setValue(String::number(value)); |
2002 | 2002 |
2003 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged,
true); | 2003 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged,
true); |
2004 } | 2004 } |
2005 | 2005 |
2006 } // namespace blink | 2006 } // namespace blink |
OLD | NEW |