Fix XML document rendering in Firefox #1954
Merged
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.
Fixes #1949.
This only seems to happen in Firefox. Does Chrome handle the checks we add in this PR internally?
Sample XML document: https://sourceforge.net/sitemap.xml
Sample XHTML document: http://tieba.baidu.com/mo/q---2799060AC2198378C599200012D229ED%3AFG%3D1--1-3-0--2--wapp_1440757687244_809/m?kw=%E9%9A%90%E6%9D%80&lp=1030
This seems like a good thing to have automated tests for, but I haven't yet figured out how to detect the difference between a pretty-rendered XML document in Firefox and a non-pretty-thanks-to-an-injected-script-tag version of the same with Selenium. The problem seems to be that Firefox handles its pretty rendering HTML specially; it's not part of the document (doesn't seem to be even inspectable by dev tools).
Here is my (non-working) test attempt: