diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index abaceb196675..c418943312fa 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -688,6 +688,9 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState) PRInt32 intrinsicState = mContent->IntrinsicState(); + if (intrinsicState & NS_EVENT_STATE_INVALID) + *aState |= nsIAccessibleStates::STATE_INVALID; + if (intrinsicState & NS_EVENT_STATE_REQUIRED) *aState |= nsIAccessibleStates::STATE_REQUIRED; diff --git a/accessible/tests/mochitest/states/test_inputs.html b/accessible/tests/mochitest/states/test_inputs.html index 92f91a723efd..9f653500ea77 100644 --- a/accessible/tests/mochitest/states/test_inputs.html +++ b/accessible/tests/mochitest/states/test_inputs.html @@ -46,6 +46,14 @@ testStates(invalid[i] + "2", 0, 0, STATE_INVALID); } + // invalid/valid state + var invalid = ["maxlength","pattern","email","url"]; + document.getElementById("maxlength").value = "i am too long"; + for (i in invalid) { + testStates(invalid[i], STATE_INVALID); + testStates(invalid[i] + "2", 0, 0, STATE_INVALID); + } + SimpleTest.finish(); } @@ -75,6 +83,11 @@ title="Expose intrinsic invalid state to accessibility API"> Mozilla Bug 601205 + + Mozilla Bug 601205 +
@@ -121,5 +134,15 @@ + + + + + + + + + +