Stop regex_error exception when quick navigating to article landmarks#9299
Merged
Conversation
…en using them in regular expressions when finding nodes. Also catch regex_error thrown by regex_match.
jcsteh
approved these changes
Feb 20, 2019
jcsteh
approved these changes
Feb 20, 2019
jcsteh
left a comment
Contributor
There was a problem hiding this comment.
It's worth noting that because this count is before expansion, the truncated string might actually be longer than 100 chars. I don't think that really matters, though, and the alternative is more confusing.
| // @param out the stream to which the escaped attribute string should be written | ||
| // @param text The attribute string to be escaped | ||
| // @param maxLength the maximum length of the attribute string that should be copied. If maxLength is 0 or not specified, the entire string is copied. | ||
| // @return the number of characters written to the output stream (before expantion / filtering). This number can be used to see if the string was truncated at all. |
Contributor
There was a problem hiding this comment.
nit: expantion -> expansion (s instead of t)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #8980
Summary of the issue:
NvDA's browseMode quick navigation in virtualBuffers uses regular expressions to match on a node's attributes to locate the next valid item.
However, in certain scenarios, Firefox can seem to freeze when quick navigating by landmarks, if the extendedAria add-on in installed and reportArticles is enabled.
Technically:
In Firefox at least, it seems that the c++ regex_match function can throw a regex_error exception if the input string is too long. For instance, if searching for landmarks (including articles) and it comes upon an article node with an aria-label with a length greater than 294 characters.
Description of how this pull request fixes the issue:
Testing performed:
Tested the original testcases in #8980. The correct articles were found, and no freeze occured.
Known issues with pull request:
None.
Change log entry:
Bug fixes: