Newlines handled incorrectly by innerText in IE8#1864
Merged
syranide merged 1 commit intofacebook:masterfrom Feb 2, 2015
syranide:ie8text2
Merged
Newlines handled incorrectly by innerText in IE8#1864syranide merged 1 commit intofacebook:masterfrom syranide:ie8text2
syranide merged 1 commit intofacebook:masterfrom
syranide:ie8text2
Conversation
Contributor
Author
|
I've submitted #2340, which should be fine to rely on, but it is probably not a good idea from a performance perspective and inlining the essential guts (replaceNode and prepend non-whitespace char) of the old |
syranide
added a commit
that referenced
this pull request
Feb 2, 2015
Newlines handled incorrectly by innerText in IE8
|
Changes Unknown when pulling c371709 on syranide:ie8text2 into * on facebook:master*. |
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.
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\nincorrectly become two newlines as you can see above. With this PR, the implementation builds on our "proven" consistent behavior ofinnerHTMLfor 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
setTextContentif 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 strippingsetInnerHTMLdown to the essentials and inlining it intosetTextContentshould be the correct approach.