Commit bdb0fd3e authored by Joanmarie Diggs's avatar Joanmarie Diggs

Web: Announce when rows, columns get reordered due to aria-sort changing

Note: This support requires browsers to emit the expected signals.
Chromium will soon; Firefox doesn't yet.
parent 5175b246
......@@ -165,6 +165,16 @@ class Script(web.Script):
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onCheckedChanged(self, event)
def onColumnReordered(self, event):
"""Callback for object:column-reordered accessibility events."""
if super().onColumnReordered(event):
return
msg = "CHROMIUM: Passing along event to default script"
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onColumnReordered(self, event)
def onChildrenAdded(self, event):
"""Callback for object:children-changed:add accessibility events."""
......@@ -299,6 +309,16 @@ class Script(web.Script):
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onNameChanged(self, event)
def onRowReordered(self, event):
"""Callback for object:row-reordered accessibility events."""
if super().onRowReordered(event):
return
msg = "CHROMIUM: Passing along event to default script"
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onRowReordered(self, event)
def onSelectedChanged(self, event):
"""Callback for object:state-changed:selected accessibility events."""
......
......@@ -131,6 +131,16 @@ class Script(web.Script):
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onCheckedChanged(self, event)
def onColumnReordered(self, event):
"""Callback for object:column-reordered accessibility events."""
if super().onColumnReordered(event):
return
msg = "GECKO: Passing along event to default script"
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onColumnReordered(self, event)
def onChildrenAdded(self, event):
"""Callback for object:children-changed:add accessibility events."""
......@@ -255,6 +265,16 @@ class Script(web.Script):
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onNameChanged(self, event)
def onRowReordered(self, event):
"""Callback for object:row-reordered accessibility events."""
if super().onRowReordered(event):
return
msg = "GECKO: Passing along event to default script"
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onRowReordered(self, event)
def onSelectedChanged(self, event):
"""Callback for object:state-changed:selected accessibility events."""
......
......@@ -1792,6 +1792,23 @@ class Script(default.Script):
return False
def onColumnReordered(self, event):
"""Callback for object:column-reordered accessibility events."""
if not self.utilities.inDocumentContent(event.source):
msg = "WEB: Event source is not in document content"
debug.println(debug.LEVEL_INFO, msg, True)
return False
if event.source != self.utilities.getTable(orca_state.locusOfFocus):
msg = "WEB: locusOfFocus (%s) is not in this table" % orca_state.locusOfFocus
debug.println(debug.LEVEL_INFO, msg, True)
return False
self.pointOfReference['last-table-sort-time'] = time.time()
self.presentMessage(messages.TABLE_REORDERED_COLUMNS)
return True
def onDocumentLoadComplete(self, event):
"""Callback for document:load-complete accessibility events."""
......@@ -2006,6 +2023,23 @@ class Script(default.Script):
return True
def onRowReordered(self, event):
"""Callback for object:row-reordered accessibility events."""
if not self.utilities.inDocumentContent(event.source):
msg = "WEB: Event source is not in document content"
debug.println(debug.LEVEL_INFO, msg, True)
return False
if event.source != self.utilities.getTable(orca_state.locusOfFocus):
msg = "WEB: locusOfFocus (%s) is not in this table" % orca_state.locusOfFocus
debug.println(debug.LEVEL_INFO, msg, True)
return False
self.pointOfReference['last-table-sort-time'] = time.time()
self.presentMessage(messages.TABLE_REORDERED_ROWS)
return True
def onSelectedChanged(self, event):
"""Callback for object:state-changed:selected accessibility events."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment