Newlines handled incorrectly by innerText in IE8 #1864
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.
Before this PR: http://dev.cetrez.com/jsx/2/indexie8.html
After this PR: http://dev.cetrez.com/jsx/2/indexie8fix.html
There's already fix to deal with this, but
\r\n
incorrectly become two newlines as you can see above. With this PR, the implementation builds on our "proven" consistent behavior ofinnerHTML
for IE8, rather thanTextNode
, so it should also be favorable in that regard.So if there are any other inconsistencies we are unaware of with
innerHTML
, they should at least be consistent between initial render and update now, which is a preferable behavior IMHO.Pairs well with #1599 and especially #1863 to enjoy less overhead, #1863 could also be transplanted into
setTextContent
if we don't want to take it as-is.PS. While we should probably follow #2273 and drop
setInnerHTML
, it would be too heavy-handed for setting text content. When that time comes, simply strippingsetInnerHTML
down to the essentials and inlining it intosetTextContent
should be the correct approach.