Repository: nvaccess/nvda

Issue:
can't get landmark from a pdf in edge
### Steps to reproduce:

1. Open this pdf in edge.
2. Read down by line, and move forward by character after my objective and proficiency.
3. Note this error.
error executing script: <bound method EdgeHTMLTreeInterceptor.script_moveByCharacter_forward of <NVDAObjects.UIA.edge.EdgeHTMLTreeInterceptor object at 0x051FCF90>> with gesture u'right arrow'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 187, in executeScript
  File "cursorManager.pyc", line 196, in script_moveByCharacter_forward
  File "cursorManager.pyc", line 141, in _caretMovementScriptHelper
  File "speech.pyc", line 749, in speakTextInfo
  File "treeInterceptorHandler.pyc", line 217, in getTextWithFields
  File "NVDAObjects\UIA\edge.pyc", line 179, in getTextWithFields
  File "NVDAObjects\UIA\__init__.pyc", line 588, in getTextWithFields
  File "NVDAObjects\UIA\__init__.pyc", line 502, in _getTextWithFieldsForUIARange
  File "NVDAObjects\UIA\edge.pyc", line 137, in _getControlFieldForObject
AttributeError: 'UIA' object has no attribute 'landmark'

### Expected behavior:
The info on those lines should read.

### Actual behavior:
An error.

### System configuration:
Version: next-14293,8d368f7e

NVDA Installed or portable: Installed

Other information:
@leonardder might this be a regression from your localized landmarks fix? Thought'd check.


Discussion:
PDF: 
[resume.pdf](https://github.com/nvaccess/nvda/files/1219998/resume.pdf)

Ough, this is very like caused by the landmarks localisation fix indeed. Could you please double check this with 2017.2? If this works properly there, I will try to fix this in time for 2017.3, probably not that difficult.

@MichaelDCurran: I'm thinking about adding a landmark property to the base UIA class, but we could even consider adding it to the base NVDAObject, defaulting to None.
This is either a p1 or a p2 to me, since it breaks PDF reading in Edge in a major way and is probably a regression.
hold on, I will have to get a 2017.2 installer.
yes, this is a regression from 17.2
A base NVDAObject landmark property is fine with me.




Resolving patch:
diff --git a/source/NVDAObjects/UIA/edge.py b/source/NVDAObjects/UIA/edge.py
--- a/source/NVDAObjects/UIA/edge.py
+++ b/source/NVDAObjects/UIA/edge.py
@@ -494,7 +494,6 @@ def _get__isTextEmpty(self):
 		return False
 
 	def _get_landmark(self):
-		"""Fetches the aria landmark role for this object."""
 		landmarkId=self._getUIACacheablePropertyValue(UIAHandler.UIA_LandmarkTypePropertyId)
 		if not landmarkId: # will be 0 for non-landmarks
 			return None
diff --git a/source/NVDAObjects/__init__.py b/source/NVDAObjects/__init__.py
--- a/source/NVDAObjects/__init__.py
+++ b/source/NVDAObjects/__init__.py
@@ -839,6 +839,13 @@ def _get_placeholder(self):
 		log.debug("Potential unimplemented child class: %r" %self)
 		return None
 
+	def _get_landmark(self):
+		"""If this object represents an ARIA landmark, fetches the ARIA landmark role.
+		@return: ARIA landmark role else None
+		@rtype: String or None
+		"""
+		return None
+
 	def _reportErrorInPreviousWord(self):
 		try:
 			# self might be a descendant of the text control; e.g. Symphony.


Test patch: