Permalink
Show file tree
Hide file tree
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix #12120. Always stack .before/.after, and fix disconnected nodes.
- Loading branch information
Showing
2 changed files
with
9 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
e2eac3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to brake something in IE9. After this change it now throws error "Invalid argument" when using prepend in some cases like space before first tag in html string.
test case: http://jsfiddle.net/xhZJz/7/
e2eac3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original fiddle is still reproducible: http://jsfiddle.net/3qqXG/.
The issue is not
arguments.length
, but!isDisconnected( this[0] )
that makes theif
fail in case of an empty set. So a stack is only added in case of an empty set, which makes.end
unusable.e2eac3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, IE of all vintages doesn't like this patch. It seemed to work locally but it was a caching problem. So there's more work to do.
@pimvdb the problem was/is that the elements created by string arguments like
"<p>hello</p>"
are falsely claimed to be connected, because their parentNode points to thediv
we used to create them. Yes, the issue in your test case wasn't arguments.length, but we still need to stack for that case if we want to be consistent. And I'll add another test case.