Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early support for mathematical content in Kindle for PC. #7536

Merged
merged 2 commits into from Sep 13, 2017
Merged

Conversation

jcsteh
Copy link
Contributor

@jcsteh jcsteh commented Aug 29, 2017

Link to issue number:

None.

Summary of the issue:

A future version of Kindle will expose MathML for books which contain it. We can thus provide access to math in those books using our existing math support.

Description of how this pull request fixes the issue:

Kindle implementation:

  1. A future version of Kindle will expose MathML on embedded objects with ROLE_SYSTEM_EQUATION via a "mathml" IAccessible2 object attribute.
  2. Alternatively, if there is no MathML, alt text might be exposed instead via accName.
  3. Both MathML and alt text can be exposed, in which case we should always use the MathML.

In this PR:

  1. Update the Kindle app module to fetch MathML accordingly. It also ensures that alt text (which is placed in the "content" ControlField attribute) doesn't get reported if there is MathML.
  2. MozillaCompoundTextInfo NVDAObjectAtStart property: Return the embedded object for graphics, math, etc. instead of the parent document. This is necessary to allow for interaction with math.
  3. BrowseModeTreeInterceptor: When activating an NVDAObject, if doAction isn't implemented, just ignore it rather than throwing an exception. Otherwise, pressing enter on a graphic (which can't be activated in Kindle) throws an exception.
  4. Update the User Guide with details about this, as well as adding a link to the MathPlayer documentation about navigation commands.

Testing performed:

Tested with builds and test cases provided by Amazon. Unfortunately, neither builds nor content are publicly available yet.

Known issues with pull request:

No known issues with the implementation. One concern is that content probably won't be publicly available before NVDA 2017.4 is released, so this won't get any public testing before release. However, we don't want to wait until 2018.1 for this to be available, so we're announcing it as "early support".

Change log entry:

New Features:

- Early support for reading and interactive navigation of mathematical content for Kindle books with accessible math. (#7536)

Kindle implementation:

1. A future version of Kindle will expose MathML on embedded objects with ROLE_SYSTEM_EQUATION via a "mathml" IAccessible2 object attribute.
2. Alternatively, if there is no MathML, alt text might be exposed instead via accName.
3. Both MathML and alt text can be exposed, in which case we should always use the MathML.

In this commit:

1. Update the Kindle app module to fetch MathML accordingly. It also ensures that alt text (which is placed in the "content" ControlField attribute) doesn't get reported if there is MathML.
2. MozillaCompoundTextInfo NVDAObjectAtStart property: Return the embedded object for graphics, math, etc. instead of the parent document. This is necessary to allow for interaction with math.
3. BrowseModeTreeInterceptor: When activating an NVDAObject, if doAction isn't implemented, just ignore it rather than throwing an exception. Otherwise, pressing enter on a graphic (which can't be activated in Kindle) throws an exception.
4. Update the User Guide with details about this, as well as adding a link to the MathPlayer documentation about navigation commands.
Copy link
Member

@michaelDCurran michaelDCurran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the what's new entry mention the word Kindle perhaps?

try:
field["mathMl"] = obj.mathMl
except LookupError:
mathMl = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this variable get used?

@jcsteh
Copy link
Contributor Author

jcsteh commented Aug 29, 2017

Should the what's new entry mention the word Kindle perhaps?

Haha. My bad. I'll fix that.

@jcsteh jcsteh merged commit 95c986d into master Sep 13, 2017
@nvaccessAuto nvaccessAuto added this to the 2017.4 milestone Sep 13, 2017
@jcsteh jcsteh deleted the kindleMath branch September 13, 2017 01:38
@josephsl josephsl mentioned this pull request Oct 15, 2017
@codeofdusk
Copy link
Contributor

Are there now test cases for this? these books, for example, don't seem to have accessible mathematics...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants