@@ -378,7 +378,7 @@ def _get_text(self):
378378 text = self ._rangeObj .text
379379 if not text :
380380 text = u""
381- if controlTypes .STATE_PROTECTED in self .obj .states :
381+ if controlTypes .State . PROTECTED in self .obj .states :
382382 text = u'*' * len (text )
383383 return text
384384
@@ -413,7 +413,7 @@ def _get_bookmark(self):
413413class MSHTML (IAccessible ):
414414
415415 def _get__UIAControl (self ):
416- if UIAHandler .handler and self .role == controlTypes .Role .EDITABLETEXT and controlTypes .STATE_FOCUSED in self .states :
416+ if UIAHandler .handler and self .role == controlTypes .Role .EDITABLETEXT and controlTypes .State . FOCUSED in self .states :
417417 e = UIAHandler .handler .clientObject .getFocusedElementBuildCache (UIAHandler .handler .baseCacheRequest )
418418 obj = UIA (UIAElement = e )
419419 if isinstance (obj ,EditableTextWithoutAutoSelectDetection ):
@@ -720,7 +720,7 @@ def _get_value(self):
720720 return value
721721 IARole = self .IAccessibleRole
722722 # value is not useful on certain nodes that just expose a URL, or they have other ways of getting their content (#4976 - editble combos).
723- if IARole in (oleacc .ROLE_SYSTEM_PANE ,oleacc .ROLE_SYSTEM_TEXT ) or (IARole == oleacc .ROLE_SYSTEM_COMBOBOX and controlTypes .STATE_EDITABLE in self .states ):
723+ if IARole in (oleacc .ROLE_SYSTEM_PANE ,oleacc .ROLE_SYSTEM_TEXT ) or (IARole == oleacc .ROLE_SYSTEM_COMBOBOX and controlTypes .State . EDITABLE in self .states ):
724724 return ""
725725 else :
726726 return super (MSHTML ,self ).value
@@ -778,7 +778,7 @@ def _get_role(self):
778778 return nodeNamesToNVDARoles .get (nodeName ,controlTypes .Role .SECTION )
779779 if self .IAccessibleChildID > 0 :
780780 states = super (MSHTML ,self ).states
781- if controlTypes .STATE_LINKED in states :
781+ if controlTypes .State . LINKED in states :
782782 return controlTypes .Role .LINK
783783 role = super (MSHTML ,self ).role
784784 #IE uses a MSAA role of ROLE_SYSTEM_TEXT with no readonly state for unsupported or future tags with an explicit ARIA role.
@@ -799,36 +799,36 @@ def _get_states(self):
799799 htmlRequired = 'required' in self .HTMLAttributes
800800 ariaRequired = self .HTMLAttributes ['aria-required' ]
801801 if htmlRequired or ariaRequired == "true" :
802- states .add (controlTypes .STATE_REQUIRED )
802+ states .add (controlTypes .State . REQUIRED )
803803 ariaSelected = self .HTMLAttributes ['aria-selected' ]
804804 if ariaSelected == "true" :
805- states .add (controlTypes .STATE_SELECTED )
805+ states .add (controlTypes .State . SELECTED )
806806 elif ariaSelected == "false" :
807- states .discard (controlTypes .STATE_SELECTED )
807+ states .discard (controlTypes .State . SELECTED )
808808 ariaExpanded = self .HTMLAttributes ['aria-expanded' ]
809809 if ariaExpanded == "true" :
810- states .add (controlTypes .STATE_EXPANDED )
810+ states .add (controlTypes .State . EXPANDED )
811811 elif ariaExpanded == "false" :
812- states .add (controlTypes .STATE_COLLAPSED )
812+ states .add (controlTypes .State . COLLAPSED )
813813 ariaInvalid = self .HTMLAttributes ['aria-invalid' ]
814814 if ariaInvalid == "true" :
815- states .add (controlTypes .STATE_INVALID_ENTRY )
815+ states .add (controlTypes .State . INVALID_ENTRY )
816816 ariaGrabbed = self .HTMLAttributes ['aria-grabbed' ]
817817 if ariaGrabbed == "true" :
818- states .add (controlTypes .STATE_DRAGGING )
818+ states .add (controlTypes .State . DRAGGING )
819819 elif ariaGrabbed == "false" :
820- states .add (controlTypes .STATE_DRAGGABLE )
820+ states .add (controlTypes .State . DRAGGABLE )
821821 ariaDropeffect = self .HTMLAttributes ['aria-dropeffect' ]
822822 if ariaDropeffect and ariaDropeffect != "none" :
823- states .add (controlTypes .STATE_DROPTARGET )
823+ states .add (controlTypes .State . DROPTARGET )
824824 if self .HTMLAttributes ["aria-hidden" ]== "true" :
825- states .add (controlTypes .STATE_INVISIBLE )
825+ states .add (controlTypes .State . INVISIBLE )
826826 if self .isContentEditable :
827- states .add (controlTypes .STATE_EDITABLE )
828- states .discard (controlTypes .STATE_READONLY )
827+ states .add (controlTypes .State . EDITABLE )
828+ states .discard (controlTypes .State . READONLY )
829829 nodeName = self .HTMLNodeName
830830 if nodeName == "TEXTAREA" :
831- states .add (controlTypes .STATE_MULTILINE )
831+ states .add (controlTypes .State . MULTILINE )
832832 # #4667: Internet Explorer 11 correctly fires focus events for aria-activeDescendant, but fails to set the focused state.
833833 # Therefore check aria-activeDescendant manually and set these states if this is the active descendant.
834834 try :
@@ -838,8 +838,8 @@ def _get_states(self):
838838 if activeElement :
839839 activeID = activeElement .getAttribute ('aria-activedescendant' )
840840 if activeID and activeID == self .HTMLNode .ID :
841- states .add (controlTypes .STATE_FOCUSABLE )
842- states .add (controlTypes .STATE_FOCUSED )
841+ states .add (controlTypes .State . FOCUSABLE )
842+ states .add (controlTypes .State . FOCUSED )
843843 return states
844844
845845 def _get_isContentEditable (self ):
@@ -1075,7 +1075,7 @@ class V6ComboBox(IAccessible):
10751075
10761076 def event_valueChange (self ):
10771077 focus = api .getFocusObject ()
1078- if controlTypes .STATE_FOCUSED not in self .states or focus .role != controlTypes .Role .COMBOBOX :
1078+ if controlTypes .State . FOCUSED not in self .states or focus .role != controlTypes .Role .COMBOBOX :
10791079 # This combo box is not focused.
10801080 return super (V6ComboBox , self ).event_valueChange ()
10811081 # This combo box is focused. However, the value change is not fired on the real focus object.
@@ -1121,7 +1121,7 @@ def _get_parent(self):
11211121 def _get_shouldAllowIAccessibleFocusEvent (self ):
11221122 # We must override this because we override parent to skip the MSAAHTML Registered Handler client,
11231123 # which might have the focused state.
1124- if controlTypes .STATE_FOCUSED in self .states :
1124+ if controlTypes .State . FOCUSED in self .states :
11251125 return True
11261126 parent = super (Body , self ).parent
11271127 if not parent :
0 commit comments