Repository: nvaccess/nvda

Issue:
Include applications, dialogs and audio/video tags in embedded object quick navigation
Embedded objects based on the html object tag are getting more rare these days. There are two things I see happening more regularly:

1. Applications embedded inside a document, e.g. [MediaElement.js audio and video players](http://www.mediaelementjs.com/). You can find at least two players on this page using the application role. I'm not sure whether this meets the accessibility standard, it's just that they seem to have implemented it this way. Other examples include rich text editors, which are in fact edit fields but they aren't accessible using quick nav. Since treating them as edit boxes will be quite difficult probably (you can't see whether an application is a richt text editor or not), I think object would be a nice alternative
2. Websites that have dialogs embedded on them. Usually, those dialogs should receive focus automatically, but they often don't, which requires you to find the dialog using browse mode. Quick nav for this is something I'd certainly use.


Discussion:
@derekriemer: Given your comment in https://github.com/nvaccess/nvda/issues/124#issuecomment-217989072 , what do you think about this?
I think it would make sense.
I think this makes sense, but please note that the command descriptions and User Guide needs to explicitly mention this in the appropriate places. Regarding the User Guide, from memory, you should check the section that lists first letter navigation keys, as well as the specific section on embedded objects.

Resolving patch:
diff --git a/source/UIABrowseMode.py b/source/UIABrowseMode.py
--- a/source/UIABrowseMode.py
+++ b/source/UIABrowseMode.py
@@ -1,7 +1,7 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2015-2016 NV Access Limited
+#Copyright (C) 2015-2017 NV Access Limited, Babbage B.V.
 
 from ctypes import byref
 from comtypes import COMError
@@ -299,6 +299,9 @@ def _iterNodesByType(self,nodeType,direction="next",pos=None):
 		elif nodeType=="nonTextContainer":
 			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ListControlTypeId,UIAHandler.UIA_IsKeyboardFocusablePropertyId:True},{UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ComboBoxControlTypeId})
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
+		elif nodeType=="embeddedObject":
+			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_PaneControlTypeId,UIAHandler.UIA_AriaRolePropertyId:[u"application",u"alertdialog",u"dialog"]})
+			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
 		raise NotImplementedError
 
 	def _activateNVDAObject(self,obj):
diff --git a/source/virtualBuffers/MSHTML.py b/source/virtualBuffers/MSHTML.py
--- a/source/virtualBuffers/MSHTML.py
+++ b/source/virtualBuffers/MSHTML.py
@@ -2,7 +2,7 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2009-2016 NV Access Limited, Babbage B.V.
+#Copyright (C) 2009-2017 NV Access Limited, Babbage B.V.
 
 from comtypes import COMError
 import eventHandler
@@ -312,7 +312,10 @@ def _searchableAttribsForNodeType(self,nodeType):
 				{"IHTMLDOMNode::nodeName": [VBufStorage_findMatch_word(lr.upper()) for lr in aria.htmlNodeNameToAriaLandmarkRoles]}
 				]
 		elif nodeType == "embeddedObject":
-			attrs = {"IHTMLDOMNode::nodeName": ["OBJECT","EMBED","APPLET"]}
+			attrs = [
+				{"IHTMLDOMNode::nodeName": ["OBJECT","EMBED","APPLET","AUDIO","VIDEO"]},
+				{"IAccessible::role":[oleacc.ROLE_SYSTEM_APPLICATION,oleacc.ROLE_SYSTEM_DIALOG]},
+			]
 		elif nodeType == "separator":
 			attrs = {"IHTMLDOMNode::nodeName": ["HR"]}
 		else:
diff --git a/source/virtualBuffers/gecko_ia2.py b/source/virtualBuffers/gecko_ia2.py
--- a/source/virtualBuffers/gecko_ia2.py
+++ b/source/virtualBuffers/gecko_ia2.py
@@ -2,7 +2,7 @@
 #A part of NonVisual Desktop Access (NVDA)
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
-#Copyright (C) 2008-2016 NV Access Limited, Babbage B.V.
+#Copyright (C) 2008-2017 NV Access Limited, Babbage B.V.
 
 from . import VirtualBuffer, VirtualBufferTextInfo, VBufStorage_findMatch_word, VBufStorage_findMatch_notEmpty
 import treeInterceptorHandler
@@ -239,7 +239,10 @@ def _searchableAttribsForNodeType(self,nodeType):
 					"name": [VBufStorage_findMatch_notEmpty]}
 				]
 		elif nodeType=="embeddedObject":
-			attrs={"IAccessible2::attribute_tag":self._searchableTagValues(["embed","object","applet"])}
+			attrs=[
+				{"IAccessible2::attribute_tag":self._searchableTagValues(["embed","object","applet","audio","video"])},
+				{"IAccessible::role":[oleacc.ROLE_SYSTEM_APPLICATION,oleacc.ROLE_SYSTEM_DIALOG]},
+			]
 		else:
 			return None
 		return attrs


Test patch: