Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion source/NVDAObjects/IAccessible/MSHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ def _get_treeInterceptorClass(self):
return super(MSHTML,self).treeInterceptorClass

def _get_isCurrent(self):
return self.HTMLAttributes["aria-current"]
isCurrent = self.HTMLAttributes["aria-current"]
if isCurrent == "false":
isCurrent = None
return isCurrent

def _get_HTMLAttributes(self):
return HTMLAttribCache(self.HTMLNode)
Expand Down
4 changes: 3 additions & 1 deletion source/NVDAObjects/IAccessible/ia2Web.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def _get_positionInfo(self):
return info

def _get_isCurrent(self):
current = self.IA2Attributes.get("current", False)
current = self.IA2Attributes.get("current", None)
if current == "false":
current = None
return current

def _get_placeholder(self):
Expand Down
9 changes: 5 additions & 4 deletions source/NVDAObjects/UIA/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,18 +457,19 @@ def _get_ariaProperties(self):
# RegEx to get the value for the aria-current property. This will be looking for a the value of 'current'
# in a list of strings like "something=true;current=date;". We want to capture one group, after the '='
# character and before the ';' character.
# This could be one of: True, "page", "step", "location", "date", "time"
RE_ARIA_CURRENT_PROP_VALUE = re.compile("current=(\w+);")
# This could be one of: "false", "true", "page", "step", "location", "date", "time"
# "false" is ignored by the regEx and will not produce a match
RE_ARIA_CURRENT_PROP_VALUE = re.compile("current=(?!false)(\w+);")

def _get_isCurrent(self):
ariaProperties=self._getUIACacheablePropertyValue(UIAHandler.UIA_AriaPropertiesPropertyId)
match = self.RE_ARIA_CURRENT_PROP_VALUE.match(ariaProperties)
match = self.RE_ARIA_CURRENT_PROP_VALUE.search(ariaProperties)
log.debug("aria props = %s" % ariaProperties)
if match:
valueOfAriaCurrent = match.group(1)
log.debug("aria current value = %s" % valueOfAriaCurrent)
return valueOfAriaCurrent
return False
return None

def _get_placeholder(self):
ariaPlaceholder = self.ariaProperties.get('placeholder', None)
Expand Down
6 changes: 3 additions & 3 deletions source/NVDAObjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,10 @@ def _get_statusBar(self):

def _get_isCurrent(self):
"""Gets the value that indicates whether this object is the current element in a set of related
elements. This maps to aria-current. Normally returns False. If this object is current
it will return one of the following values: True, "page", "step", "location", "date", "time"
elements. This maps to aria-current. Normally returns None. If this object is current
it will return one of the following values: "true", "page", "step", "location", "date", "time"
"""
return False
return None

def _get_shouldAcceptShowHideCaretEvent(self):
"""Some objects/applications send show/hide caret events when we don't expect it, such as when the cursor is blinking.
Expand Down
2 changes: 1 addition & 1 deletion source/virtualBuffers/MSHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _normalizeFormatField(self, attrs):
def _normalizeControlField(self,attrs):
level=None
ariaCurrent = attrs.get('HTMLAttrib::aria-current', None)
if ariaCurrent is not None:
if ariaCurrent not in (None, "false"):
attrs['current']=ariaCurrent
placeholder = self._getPlaceholderAttribute(attrs, 'HTMLAttrib::aria-placeholder')
if placeholder:
Expand Down
2 changes: 1 addition & 1 deletion source/virtualBuffers/gecko_ia2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _normalizeControlField(self,attrs):
attrs[attr]=int(attrVal)

current = attrs.get("IAccessible2::attribute_current")
if current is not None:
if current not in (None, 'false'):
attrs['current']= current
placeholder = self._getPlaceholderAttribute(attrs, "IAccessible2::attribute_placeholder")
if placeholder is not None:
Expand Down