Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Firefox browse mode adds a non-existing space when the closing tag is standing in a new line #9294
HTML code snippets:
2018.1 (and earlier), 2018.4 (also tested)
Win7x64 (tested) – and maybe until Win10-1903
Name and version of other software in use when reproducing the issue:
Firefox 56.0.2 and 65.0.1
Does the issue still occur after restarting your PC?
Have you tried any other versions of NVDA?
TL;DR: Totally understand the concern here, but I'm not sure how to solve this in Firefox without breaking things.
Whenever there is a new line in HTML, except for the
gets rendered as "test test". The same is true for a new line at the end. It seems, however, that Firefox truncates the space at the end when copying to the clipboard. Regardless, we know it's still in the rendered output because if you make it contenteditable, you can cursor to the space. In other words, this behaviour isn't accessibility specific.
Interestingly, Chrome seems to truncate the space even for contenteditable. That happens even for a space character in the source (as opposed to a new line character).
I don't think we could safely make this change specifically in Firefox accessibility without breaking the contenteditable case. It would need to be made more generally in Firefox (affecting contenteditable as well), but that raises the question of what the web specs actually say.
Spaces and tabs from the beginning of a line are fully ignored by Firefox and Chrome. (Internet Explorer 11 would be a completely other topic.) Adding
So as far as I figured it out right now, Firefox adds a space for every line break, as long as there isn't a HTML tag at the end of the line, but it doesn't look for a HTLM tag "directly" after the line break character too. Firefox in browse mode shows "Text 27 Text 28 Text 29" for closing-span-nospace-comment-newline-opening-span and Chrome "Text 27Text 28Text 29". Same result with Text 30 to Text 32 with a space between the closing span tag and the HTML comment.
Here is a test html file with lots of different examples and their rendering results (browse and focus mode), which you can use for testing. Maybe it helps others to understand how things are rendered in Firefox and Chrome – and also in IE11. I know the differences between
PS: And now I have headache.